Class: DPM::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/dpm/runner.rb

Constant Summary collapse

CONTAINER_NAME_PREFIX =
"dpm-"
BASH_COLOR_GRAY =
"\033[0;37m"
BASH_COLOR_NONE =
"\033[0m"
DOCKER_COMMANDS =
%w[list status start stop restart cleanup].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Runner

Returns a new instance of Runner.



19
20
21
# File 'lib/dpm/runner.rb', line 19

def initialize(options)
  self.options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



13
14
15
# File 'lib/dpm/runner.rb', line 13

def options
  @options
end

Class Method Details

.call!(options) ⇒ Object



15
16
17
# File 'lib/dpm/runner.rb', line 15

def self.call!(options)
  new(options).call!
end

Instance Method Details

#call!Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/dpm/runner.rb', line 23

def call!
  case options.command
  when *DOCKER_COMMANDS
    call_docker!
  when "packages"
    call_packages!
  when "tags"
    call_tags!
  when "configure"
    call_configure!
  end
end