Class: DockerRack::CLI::Base

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

Instance Method Summary collapse

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

#versionObject

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