Class: Serverkit::Command
- Inherits:
-
Object
- Object
- Serverkit::Command
- Defined in:
- lib/serverkit/command.rb
Constant Summary collapse
- ACTION_NAMES =
%w( apply check )
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(argv) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(argv) ⇒ Command
Returns a new instance of Command.
13 14 15 |
# File 'lib/serverkit/command.rb', line 13 def initialize(argv) @argv = argv end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/serverkit/command.rb', line 17 def call case when has_no_action_name? abort_for_missing_action_name when has_unknown_action_name? abort_for_unknown_action_name when action_name == "apply" apply when action_name == "check" check end rescue Slop::MissingOptionError => exception abort "Error: #{exception}" end |