Class: Recipes::Heroku

Inherits:
Rails::AppBuilder
  • Object
show all
Defined in:
lib/potassium/recipes/heroku.rb

Constant Summary collapse

NAME_PREFIX =
'pl'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Heroku

Returns a new instance of Heroku.



6
7
8
9
10
# File 'lib/potassium/recipes/heroku.rb', line 6

def initialize(args)
  super(args)
  set(:heroku_app_name_staging, app_name_for('staging'))
  set(:heroku_app_name_production, app_name_for('production'))
end

Instance Attribute Details

#app_name_stagingObject

Returns the value of attribute app_name_staging.



4
5
6
# File 'lib/potassium/recipes/heroku.rb', line 4

def app_name_staging
  @app_name_staging
end

Instance Method Details

#askObject



12
13
14
15
16
17
18
19
20
# File 'lib/potassium/recipes/heroku.rb', line 12

def ask
  heroku = answer(:heroku) do
    Ask.confirm("Are you going to deploy to heroku? (#{who_am_i})")
  end

  if heroku
    set(:heroku, heroku)
  end
end

#createObject



22
23
24
# File 'lib/potassium/recipes/heroku.rb', line 22

def create
  add_heroku if get(:heroku)
end

#installObject



26
27
28
# File 'lib/potassium/recipes/heroku.rb', line 26

def install
  add_heroku
end

#installed?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/potassium/recipes/heroku.rb', line 30

def installed?
  gem_exists?(/rails_stdout_logging/)
end