Class: Jumpup::Heroku::Configuration
- Inherits:
-
Object
- Object
- Jumpup::Heroku::Configuration
- Defined in:
- lib/jumpup/heroku/configuration.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#host ⇒ Object
Returns the value of attribute host.
-
#production_app ⇒ Object
Returns the value of attribute production_app.
-
#run_database_tasks ⇒ Object
Returns the value of attribute run_database_tasks.
-
#staging_app ⇒ Object
Returns the value of attribute staging_app.
Instance Method Summary collapse
- #account(account_token) ⇒ Object
- #deploy_branch ⇒ Object
- #deploy_to_production_branch ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
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
#app ⇒ Object
Returns the value of attribute app.
15 16 17 |
# File 'lib/jumpup/heroku/configuration.rb', line 15 def app @app end |
#host ⇒ Object
Returns the value of attribute host.
15 16 17 |
# File 'lib/jumpup/heroku/configuration.rb', line 15 def host @host end |
#production_app ⇒ Object
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_tasks ⇒ Object
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_app ⇒ Object
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 account(account_token) if account_token == current_account self.app = nil self.host = "heroku.#{account_token}" yield(self) end end |
#deploy_branch ⇒ Object
34 35 36 |
# File 'lib/jumpup/heroku/configuration.rb', line 34 def deploy_branch 'master' end |
#deploy_to_production_branch ⇒ Object
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
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 |