Class: Shippy::Commander
- Inherits:
-
Object
- Object
- Shippy::Commander
- Defined in:
- lib/shippy/commander.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#config_file ⇒ Object
Returns the value of attribute config_file.
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#verbosity ⇒ Object
Returns the value of attribute verbosity.
Instance Method Summary collapse
- #compile ⇒ Object
- #config ⇒ Object
- #current_app_path ⇒ Object
-
#initialize(config_file: nil, verbosity: :info) ⇒ Commander
constructor
A new instance of Commander.
- #with_verbosity(level) ⇒ Object
Constructor Details
#initialize(config_file: nil, verbosity: :info) ⇒ Commander
Returns a new instance of Commander.
6 7 8 |
# File 'lib/shippy/commander.rb', line 6 def initialize(config_file: nil, verbosity: :info) @config_file, @verbosity = config_file, verbosity end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
3 4 5 |
# File 'lib/shippy/commander.rb', line 3 def app @app end |
#config_file ⇒ Object
Returns the value of attribute config_file.
3 4 5 |
# File 'lib/shippy/commander.rb', line 3 def config_file @config_file end |
#repo ⇒ Object
Returns the value of attribute repo.
3 4 5 |
# File 'lib/shippy/commander.rb', line 3 def repo @repo end |
#verbosity ⇒ Object
Returns the value of attribute verbosity.
3 4 5 |
# File 'lib/shippy/commander.rb', line 3 def verbosity @verbosity end |
Instance Method Details
#compile ⇒ Object
28 29 30 |
# File 'lib/shippy/commander.rb', line 28 def compile Shippy::Compiler.new(app, config: config).compile end |
#config ⇒ Object
10 11 12 13 14 |
# File 'lib/shippy/commander.rb', line 10 def config @config ||= Shippy::Config .new(config_file) .tap { |config| configure_sshkit_with(config) } end |
#current_app_path ⇒ Object
32 33 34 |
# File 'lib/shippy/commander.rb', line 32 def current_app_path deploy_path.join("apps", app.name) end |
#with_verbosity(level) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/shippy/commander.rb', line 16 def with_verbosity(level) old_level = verbosity self.verbosity = level SSHKit.config.output_verbosity = level yield ensure self.verbosity = old_level SSHKit.config.output_verbosity = old_level end |