Class: Duty::CLI
- Inherits:
-
Object
- Object
- Duty::CLI
- Defined in:
- lib/duty/cli.rb
Constant Summary collapse
- DUTY_CONFIG_FILENAME =
'.duty.yml'
Instance Attribute Summary collapse
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
Instance Method Summary collapse
- #exec ⇒ Object
-
#initialize(args) ⇒ CLI
constructor
A new instance of CLI.
Constructor Details
#initialize(args) ⇒ CLI
12 13 14 15 16 |
# File 'lib/duty/cli.rb', line 12 def initialize(args) @input = Duty::IO::CLI::Input.new(args) @output = Duty::IO::CLI::Output.new($stdout, $stderr) @registry = Duty::Registry.register(Duty::Plugins.load(DUTY_CONFIG_FILENAME)) end |
Instance Attribute Details
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
10 11 12 |
# File 'lib/duty/cli.rb', line 10 def registry @registry end |
Instance Method Details
#exec ⇒ Object
18 19 20 21 22 |
# File 'lib/duty/cli.rb', line 18 def exec explain_duty if needs_help? complete_task if needs_completion? execute_task end |