Created
January 13, 2013 19:23
-
-
Save maxmanders/4525773 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 current_account = '' | |
60 case line | |
61 when /^\[(.*)\]$/ | |
62 account_name = (line.match(/^\[(.*)\]$/).captures)[0] | |
63 p 'account_name = ' + account_name | |
64 current_account = account_name | |
65 p 'current_account = ' + current_account | |
66 @accounts[current_account] = {} unless @accounts.has_key? current_account | |
67 when /^aws_access_key_id=.*$/ | |
68 aws_access_key_id = (line.match(/^aws_access_key_id=(.*)$/).captures)[0] | |
69 p 'aws_access_key_id = ' + aws_access_key_id | |
70 p 'current_account = ' + current_account | |
71 @accounts[current_account] = aws_access_key_id | |
72 when /^aws_secret_access_key=.*$/ | |
73 aws_secret_access_key = (line.match(/^aws_secret_access_key=(.*)$/).captures)[0] | |
74 p 'aws_secret_access_key = ' + aws_secret_access_key | |
75 p 'current_account = ' + current_account | |
76 @accounts[current_account] = aws_secret_access_key | |
77 when /^region=.*$/ | |
78 region = (line.match(/^region=(.*)$/).captures)[0] | |
79 p 'region = ' + region | |
80 p 'current_account = ' + current_account | |
81 @accounts[current_account] = region | |
82 end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment