Class: Golem::Command::Base Abstract
- Inherits:
-
Object
- Object
- Golem::Command::Base
- Defined in:
- lib/golem/command.rb
Overview
This class is abstract.
Subclass and override #run to implement a custom Command class.
Abstract class for commands.
Direct Known Subclasses
Auth, ClearRepositories, CreateRepository, DeleteRepository, Environment, SaveConfig, SetupDb, UpdateHooks, UpdateKeysFile
Instance Method Summary collapse
-
#command(cmd, *args) ⇒ Object
Run another command.
-
#initialize(opts) ⇒ Base
constructor
A new instance of Base.
-
#run ⇒ Object
Run the command.
-
#verbose? ⇒ Boolean
Check verbosity.
Constructor Details
#initialize(opts) ⇒ Base
Returns a new instance of Base.
58 59 60 |
# File 'lib/golem/command.rb', line 58 def initialize(opts) @opts = opts end |
Instance Method Details
#command(cmd, *args) ⇒ Object
Run another command.
75 76 77 |
# File 'lib/golem/command.rb', line 75 def command(cmd, *args) Golem::Command.run(cmd, @opts, *args) end |
#run ⇒ Object
Run the command.
68 69 70 |
# File 'lib/golem/command.rb', line 68 def run abort "Bad command." end |
#verbose? ⇒ Boolean
Check verbosity.
63 64 65 |
# File 'lib/golem/command.rb', line 63 def verbose? !!@opts[:verbose] end |