Class: UnitHosting::CLI
- Inherits:
-
CommandLineUtils::CLI
- Object
- CommandLineUtils::CLI
- UnitHosting::CLI
- Defined in:
- lib/unit-hosting/cli.rb
Instance Attribute Summary collapse
-
#commands ⇒ Object
Returns the value of attribute commands.
Instance Method Summary collapse
- #dispatch(cmd, cmd_argv) ⇒ Object
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #version ⇒ Object
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
7 8 9 10 |
# File 'lib/unit-hosting/cli.rb', line 7 def initialize super @commands = Commands.new end |
Instance Attribute Details
#commands ⇒ Object
Returns the value of attribute commands.
6 7 8 |
# File 'lib/unit-hosting/cli.rb', line 6 def commands @commands end |
Instance Method Details
#dispatch(cmd, cmd_argv) ⇒ Object
17 18 19 |
# File 'lib/unit-hosting/cli.rb', line 17 def dispatch(cmd,cmd_argv) @commands.send(cmd.sub(/:/,"_")) end |
#version ⇒ Object
11 12 13 14 15 16 |
# File 'lib/unit-hosting/cli.rb', line 11 def version File.open(File.join(File.dirname(__FILE__) , "..","..","VERSION"),"r") { |file| puts file.gets } end |