Class: KTools::Application

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

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Application

Returns a new instance of Application.



3
4
5
6
7
8
9
# File 'lib/ktools/application.rb', line 3

def initialize(args)
  Setup.perform unless Setup.done?

  @config = Setup.load
  @command = args[0]
  @tail = drop_first_arg(args)
end

Instance Method Details

#startObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ktools/application.rb', line 11

def start
  case @command
  when 'spy'
    Tools::Spy.start(@tail)
  when 'deliver'
    Tools::Deliver.start(@tail)
  when 'swap'
    Tools::Swap.start(@tail)
  when 'setup'
    Setup.perform
  else
    Tools::Help.display
  end
end