Class: UnitHosting::CLI

Inherits:
CommandLineUtils::CLI
  • Object
show all
Defined in:
lib/unit-hosting/cli.rb

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



6
7
8
9
# File 'lib/unit-hosting/cli.rb', line 6

def initialize
  super
  @commands = Commands.new
end

Instance Method Details

#dispatch(cmd, cmd_argv) ⇒ Object



16
17
18
# File 'lib/unit-hosting/cli.rb', line 16

def dispatch(cmd,cmd_argv)
  @commands.send(cmd.sub(/:/,"_"))
end

#versionObject



10
11
12
13
14
15
# File 'lib/unit-hosting/cli.rb', line 10

def version
  File.open(File.join(File.dirname(__FILE__) ,
                      "..","..","VERSION"),"r") { |file|
    puts file.gets
  }
end