Class: UnitHosting::CLI

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCLI

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

#commandsObject

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

#versionObject



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