Class: Jumpup::Heroku::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/jumpup/heroku/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



17
18
19
20
# File 'lib/jumpup/heroku/configuration.rb', line 17

def initialize
  @run_database_tasks ||= true
  @host ||= 'heroku.com'
end

Instance Attribute Details

#appObject

Returns the value of attribute app.



15
16
17
# File 'lib/jumpup/heroku/configuration.rb', line 15

def app
  @app
end

#hostObject

Returns the value of attribute host.



15
16
17
# File 'lib/jumpup/heroku/configuration.rb', line 15

def host
  @host
end

#production_appObject

Returns the value of attribute production_app.



15
16
17
# File 'lib/jumpup/heroku/configuration.rb', line 15

def production_app
  @production_app
end

#run_database_tasksObject

Returns the value of attribute run_database_tasks.



15
16
17
# File 'lib/jumpup/heroku/configuration.rb', line 15

def run_database_tasks
  @run_database_tasks
end

#staging_appObject

Returns the value of attribute staging_app.



15
16
17
# File 'lib/jumpup/heroku/configuration.rb', line 15

def staging_app
  @staging_app
end

Instance Method Details

#account(account_token) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/jumpup/heroku/configuration.rb', line 22

def ()
  if  == 
    self.app = nil
    self.host = "heroku.#{}"
    yield(self)
  end
end

#deploy_branchObject



34
35
36
# File 'lib/jumpup/heroku/configuration.rb', line 34

def deploy_branch
  'master'
end

#deploy_to_production_branchObject



38
39
40
41
# File 'lib/jumpup/heroku/configuration.rb', line 38

def deploy_to_production_branch
  return 'production' if production_app
  'master'
end

#valid?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/jumpup/heroku/configuration.rb', line 30

def valid?
  boolean_run_database_tasks? && (only_app? || only_production_and_staging_apps?)
end