Class: HerokuConfig::AwsRotateAll
- Defined in:
- lib/heroku_config/aws_rotate_all.rb
Instance Method Summary collapse
- #apps ⇒ Object
-
#initialize(options = {}) ⇒ AwsRotateAll
constructor
A new instance of AwsRotateAll.
- #run ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(options = {}) ⇒ AwsRotateAll
Returns a new instance of AwsRotateAll.
3 4 5 6 |
# File 'lib/heroku_config/aws_rotate_all.rb', line 3 def initialize(={}) @options = @file = [:file] end |
Instance Method Details
#apps ⇒ Object
24 25 26 27 |
# File 'lib/heroku_config/aws_rotate_all.rb', line 24 def apps lines = IO.readlines(@file).map(&:strip).reject(&:empty?) lines.map { |l| l.split(':') } end |
#run ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/heroku_config/aws_rotate_all.rb', line 8 def run if ENV['HEROKU_CONFIG_TEST'] puts "NOOP" return end apps.each do |app, id_key_name, secret_key_name| = @options.merge( app: app, id_key_name: id_key_name || 'AWS_ACCESS_KEY_ID', secret_key_name: secret_key_name || 'AWS_SECRET_ACCESS_KEY', ) AwsRotate.new().run end end |