Class: DyCI::Runner
- Inherits:
-
Object
- Object
- DyCI::Runner
- Defined in:
- lib/dyci.rb
Instance Method Summary collapse
- #command_klass(arg) ⇒ Object
-
#initialize(args) ⇒ Runner
constructor
A new instance of Runner.
- #usage ⇒ Object
Constructor Details
#initialize(args) ⇒ Runner
Returns a new instance of Runner.
6 7 8 9 |
# File 'lib/dyci.rb', line 6 def initialize args command_class = self.command_klass args.shift command_class.run(args) if command_class end |
Instance Method Details
#command_klass(arg) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/dyci.rb', line 11 def command_klass arg case arg when 'install' InstallCommand else usage exit 0 end end |
#usage ⇒ Object
21 22 23 |
# File 'lib/dyci.rb', line 21 def usage puts "Usage" end |