Class: Recipes::Heroku

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

Constant Summary collapse

NAME_PREFIX =
'pl'
ENVIRONMENTS =
['staging', 'production']
HEROKU_NAMES_MAX_CHARS =
30

Instance Method Summary collapse

Instance Method Details

#askObject



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/potassium/recipes/heroku.rb', line 6

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

  if heroku
    set(:heroku, heroku)

    ENVIRONMENTS.each { |environment| set_app_name_for(environment) }
  end
end

#createObject



18
19
20
# File 'lib/potassium/recipes/heroku.rb', line 18

def create
  add_heroku if get(:heroku)
end

#installObject



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

def install
  add_heroku
end

#installed?Boolean

Returns:

  • (Boolean)


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

def installed?
  gem_exists?(/heroku-stage/)
end