Class: Dru::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/dru/cli.rb

Overview

Handle the application command line parsing and the dispatch to various command objects

Constant Summary collapse

Error =

Error raised by this runner

Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#exec(*command) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/dru/cli.rb', line 28

def exec(*command)
  if options[:help]
    invoke :help, ['exec']
  else
    require_relative 'commands/exec'
    Dru::Commands::Exec.new(command: command, options: options).execute
  end
end

#runner(*command) ⇒ Object



58
59
60
61
62
63
64
65
# File 'lib/dru/cli.rb', line 58

def runner(*command)
  if options[:help]
    invoke :help, ['runner']
  else
    require_relative 'commands/runner'
    Dru::Commands::Runner.new(command: command, options: options).execute
  end
end

#upObject



42
43
44
45
46
47
48
49
# File 'lib/dru/cli.rb', line 42

def up(*)
  if options[:help]
    invoke :help, ['up']
  else
    require_relative 'commands/up'
    Dru::Commands::Up.new(options: options).execute
  end
end

#versionObject



15
16
17
18
# File 'lib/dru/cli.rb', line 15

def version
  require_relative 'version'
  puts "v#{Dru::VERSION}"
end