3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/configuration.rb', line 3
def self.config
config_file = "#{Dir.home}/.aws-config.yml"
unless File.file?(config_file)
begin
entry = Hash.new
say("Configuration Details:")
entry[:access_key_id] = ask("Access Key: ")
entry[:secret_access_key] = ask("Secret Key: ")
entry[:path_to_keypairs] = ask("Path to keypairs(/path/to/keypairs/): ")
end
File.open("#{config_file}", "w") { |file| YAML.dump(entry, file) }
end
AWS.config(YAML.load(File.read(config_file)))
end
|