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

#attachObject



38
39
40
41
42
43
44
45
# File 'lib/dru/cli.rb', line 38

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

#downObject



24
25
26
27
28
29
30
31
# File 'lib/dru/cli.rb', line 24

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

#exec(*command) ⇒ Object



54
55
56
57
58
59
60
61
# File 'lib/dru/cli.rb', line 54

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



84
85
86
87
88
89
90
91
# File 'lib/dru/cli.rb', line 84

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



68
69
70
71
72
73
74
75
# File 'lib/dru/cli.rb', line 68

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