Class: DyCI::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/dyci.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Runner

Returns a new instance of Runner.



6
7
8
9
10
11
12
# File 'lib/dyci.rb', line 6

def initialize args
  command_class = self.command_klass args
  if command_class
    command = command_class.new
    command.run
  end
end

Instance Method Details

#command_klass(args) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/dyci.rb', line 14

def command_klass args
  case args[0]
#      when 'setup'
#        Setup
  when 'install'
    InstallCommand
#      when 'uninstall'
#        Uninstall
#      when 'cleanup'
#        Cleanup
  else
    # TODO: add usage 
    puts "print usage"
    nil
  end
end