Class: Dru::CLI
- Inherits:
-
Thor
- Object
- Thor
- Dru::CLI
- 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)
Class Method Summary collapse
Instance Method Summary collapse
- #attach ⇒ Object
- #docker_compose(*command) ⇒ Object
- #down ⇒ Object
- #exec(*command) ⇒ Object
- #runner(*command) ⇒ Object
- #up ⇒ Object
- #version ⇒ Object
Class Method Details
.help(shell, subcommand = false) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/dru/cli.rb', line 19 def self.help(shell, subcommand = false) shell.say `#{DOCKER_COMPOSE_COMMAND} help` shell.say shell.say <<-OUT These Docker-Compose commands are provided by Dru: Usage: dru [-e ENV] [docker-compose-options] [COMMAND] [ARGS...] dru -h|--help OUT super end |
Instance Method Details
#attach ⇒ Object
70 71 72 73 74 75 76 77 |
# File 'lib/dru/cli.rb', line 70 def attach(*) if [:help] invoke :help, ['attach'] else require_relative 'commands/attach' Dru::Commands::Attach.new(options: ).execute end end |
#docker_compose(*command) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/dru/cli.rb', line 44 def docker_compose(*command) if command.empty? invoke :help else require_relative 'commands/docker_compose' Dru::Commands::DockerCompose.new(command: command, options: ).execute end end |
#down ⇒ Object
56 57 58 59 60 61 62 63 |
# File 'lib/dru/cli.rb', line 56 def down(*) if [:help] invoke :help, ['down'] else require_relative 'commands/down' Dru::Commands::Down.new.execute end end |
#exec(*command) ⇒ Object
84 85 86 87 88 89 90 91 |
# File 'lib/dru/cli.rb', line 84 def exec(*command) if [:help] invoke :help, ['exec'] else require_relative 'commands/exec' Dru::Commands::Exec.new(command: command, options: ).execute end end |
#runner(*command) ⇒ Object
112 113 114 115 116 117 118 119 |
# File 'lib/dru/cli.rb', line 112 def runner(*command) if [:help] invoke :help, ['runner'] else require_relative 'commands/runner' Dru::Commands::Runner.new(command: command, options: ).execute end end |
#up ⇒ Object
98 99 100 101 102 103 104 105 |
# File 'lib/dru/cli.rb', line 98 def up(*) if [:help] invoke :help, ['up'] else require_relative 'commands/up' Dru::Commands::Up.new(options: ).execute end end |
#version ⇒ Object
36 37 38 39 40 |
# File 'lib/dru/cli.rb', line 36 def version require_relative 'version' shell.say "dru version: #{Dru::VERSION}" shell.say `#{DOCKER_COMPOSE_COMMAND} version` end |