22
33module Config
44 module Integrations
5- class Heroku < Struct . new ( :app )
5+ Heroku = Struct . new ( :app ) do
66 def invoke
77 puts 'Setting vars...'
88 heroku_command = "config:set #{ vars } "
@@ -14,14 +14,14 @@ def invoke
1414 def vars
1515 # Load only local options to Heroku
1616 Config . load_and_set_settings (
17- Rails . root . join ( " config" , "#{ Config . file_name } .local.yml" ) . to_s ,
18- Rails . root . join ( " config" , Config . dir_name , "#{ environment } .local.yml" ) . to_s ,
19- Rails . root . join ( " config" , " environments" , "#{ environment } .local.yml" ) . to_s
17+ Rails . root . join ( ' config' , "#{ Config . file_name } .local.yml" ) . to_s ,
18+ Rails . root . join ( ' config' , Config . dir_name , "#{ environment } .local.yml" ) . to_s ,
19+ Rails . root . join ( ' config' , ' environments' , "#{ environment } .local.yml" ) . to_s
2020 )
2121
2222 out = ''
2323 dotted_hash = to_dotted_hash Kernel . const_get ( Config . const_name ) . to_hash , { } , Config . const_name
24- dotted_hash . each { |key , value | out += " #{ key } =#{ value } " }
24+ dotted_hash . each { |key , value | out += " #{ key } =#{ value } " }
2525 out
2626 end
2727
@@ -30,7 +30,7 @@ def environment
3030 end
3131
3232 def heroku ( command )
33- with_app = app ? " --app #{ app } " : ""
33+ with_app = app ? " --app #{ app } " : ''
3434 `heroku #{ command } #{ with_app } `
3535 end
3636
@@ -41,16 +41,16 @@ def `(command)
4141 def to_dotted_hash ( source , target = { } , namespace = nil )
4242 prefix = "#{ namespace } ." if namespace
4343 case source
44- when Hash
45- source . each do |key , value |
46- to_dotted_hash ( value , target , "#{ prefix } #{ key } " )
47- end
48- when Array
49- source . each_with_index do |value , index |
50- to_dotted_hash ( value , target , "#{ prefix } #{ index } " )
51- end
52- else
53- target [ namespace ] = source
44+ when Hash
45+ source . each do |key , value |
46+ to_dotted_hash ( value , target , "#{ prefix } #{ key } " )
47+ end
48+ when Array
49+ source . each_with_index do |value , index |
50+ to_dotted_hash ( value , target , "#{ prefix } #{ index } " )
51+ end
52+ else
53+ target [ namespace ] = source
5454 end
5555 target
5656 end
0 commit comments