Class: Figaro::Tasks::Heroku

Inherits:
Struct
  • Object
show all
Defined in:
lib/figaro/tasks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#appObject

Returns the value of attribute app

Returns:

  • (Object)

    the current value of app



5
6
7
# File 'lib/figaro/tasks.rb', line 5

def app
  @app
end

Instance Method Details

#`(command) ⇒ Object



23
24
25
# File 'lib/figaro/tasks.rb', line 23

def `(command)
  Bundler.with_clean_env { super }
end

#environmentObject



14
15
16
# File 'lib/figaro/tasks.rb', line 14

def environment
  heroku("run 'echo $RAILS_ENV'").chomp[/(\w+)\z/]
end

#heroku(command) ⇒ Object



18
19
20
21
# File 'lib/figaro/tasks.rb', line 18

def heroku(command)
  with_app = app ? " --app #{app}" : ""
  `heroku #{command}#{with_app}`
end

#invokeObject



6
7
8
# File 'lib/figaro/tasks.rb', line 6

def invoke
  heroku("config:set #{vars}")
end

#varsObject



10
11
12
# File 'lib/figaro/tasks.rb', line 10

def vars
  Figaro.vars(environment)
end