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.



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

def initialize args
  command_class = self.command_klass args.shift
  command_class.run(args) if command_class
end

Instance Method Details

#command_klass(arg) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/dyci.rb', line 12

def command_klass arg
  case arg
  when 'install'
    InstallCommand
  when 'uninstall'
    UninstallCommand
  else
    usage 
    exit 0
  end
end

#usageObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/dyci.rb', line 24

def usage
  puts <<-EOF
Usage: 
  dyci install parameter

Available parameters:
  as_plugin - install XCode compiler plugin
  as_proxy - replace current clang with fake clang script
  app_code - install AppCode DyCI plugin

Examples:
  dyci install as_plugin
  dyci install as_proxy app_code
  dyci install as_plugin as_proxy app_code
  EOF
end