Module: Formatron::Generators::Credentials

Defined in:
lib/formatron/generators/credentials.rb

Overview

generates a credentials JSON file

Class Method Summary collapse

Class Method Details

.generate(file, region, access_key_id, secret_access_key) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/formatron/generators/credentials.rb', line 5

def self.generate(file, region, access_key_id, secret_access_key)
  FileUtils.mkdir_p File.dirname(file)
  File.write file, <<-EOH.gsub(/^ {10}/, '')
    {
      "region": "#{region}",
      "access_key_id": "#{access_key_id}",
      "secret_access_key": "#{secret_access_key}"
    }
  EOH
end