Class: Vixen::CommandLine
- Inherits:
-
Object
- Object
- Vixen::CommandLine
- Defined in:
- lib/vixen/command_line.rb
Defined Under Namespace
Classes: Base, Halt, Resume, Snapshot, Status, Suspend, Up
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/vixen/command_line.rb', line 4 def execute command = ARGV.shift command ||= 'status' begin require "vixen/command_line/#{command}" klass = self.class.const_get(command.split('_').map {|s| s.capitalize }.join) raise "Couldn't find #{command}" unless klass klass.new.execute rescue LoadError puts "Unknown command: #{command}" end end |