Class: DockerRack::CLI::Base
- Inherits:
-
Thor
- Object
- Thor
- DockerRack::CLI::Base
- Defined in:
- lib/docker_rack/cli/base.rb
Instance Method Summary collapse
- #exec(name) ⇒ Object
- #list(all = nil) ⇒ Object
-
#version ⇒ Object
CLI command that returns the version of Docker Rack.
Instance Method Details
#exec(name) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/docker_rack/cli/base.rb', line 31 def exec(name) ct = init_runner unless ct.contains?(name) puts "Task with name '#{name}' doesn't exist." abort end puts "Executing '#{name}'" ct.invoke(name) end |
#list(all = nil) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/docker_rack/cli/base.rb', line 19 def list(all = nil) ct = init_runner ct.tasks.map do |task| comment = task.comment next if all != 'all' && comment.nil? comment = (comment.nil?) ? '' : '# ' + comment printf("%-40s %-40s\n\r", task.name, comment) end end |
#version ⇒ Object
CLI command that returns the version of Docker Rack
14 15 16 |
# File 'lib/docker_rack/cli/base.rb', line 14 def version puts DockerRack::VERSION end |