Class: Dru::Commands::Up

Inherits:
Dru::Command show all
Defined in:
lib/dru/commands/up.rb

Constant Summary

Constants inherited from Dru::Command

Dru::Command::DOCKER_COMPOSE_COMMAND

Instance Attribute Summary

Attributes inherited from Dru::Command

#options

Instance Method Summary collapse

Methods inherited from Dru::Command

#command, #container_name_to_id, #cursor, #default_docker_compose, #docker_compose_paths, #editor, #environment, #environment_docker_compose, #exec_exist?, #generator, #pager, #platform, #project_configuration_path, #project_name, #prompt, #run_docker_compose_command, #screen, #which

Constructor Details

#initialize(options:) ⇒ Up

Returns a new instance of Up.



9
10
11
# File 'lib/dru/commands/up.rb', line 9

def initialize(options:)
  @options = options
end

Instance Method Details

#execute(input: $stdin, output: $stdout) ⇒ Object



13
14
15
16
17
18
# File 'lib/dru/commands/up.rb', line 13

def execute(input: $stdin, output: $stdout)
  start_docker_compose
  return if options[:detach]

  attach_to_default_container
end