Class: DockerRailsProxy::Compose::Up

Inherits:
DockerRailsProxy::Compose show all
Defined in:
lib/docker_rails_proxy/commands/compose/up.rb

Constant Summary collapse

FSWATCH_CMD =
<<-EOS.strip.freeze
  fswatch -r -0 \
    --latency=0.1 \
    --exclude '.git' \
    --exclude '4913' \
    "#{[APP_PATH, GEMS_PATH].compact.join('" "')}" | xargs -0 -n1 -I{} echo {}
EOS
EIO_ERROR =
%(
  Errno:EIO error, but this probably just means that the process
  has finished giving output
).freeze

Constants included from DockerRailsProxy::Callbacks

DockerRailsProxy::Callbacks::INHERITABLE_CALLBACKS, DockerRailsProxy::Callbacks::UNINHERITABLE_CALLBACKS

Instance Attribute Summary collapse

Attributes inherited from Docker

#app_container_id, #docker_options

Attributes inherited from Base

#additional_arguments, #additional_arguments_options, #arguments

Instance Method Summary collapse

Methods inherited from Base

build_path, call, command, execute, #initialize

Methods included from Logger

included, #logger

Methods included from Rsync

included, #sync

Methods included from DockerRailsProxy::Callbacks

included

Methods included from InheritableAttributes

included

Constructor Details

This class inherits a constructor from DockerRailsProxy::Base

Instance Attribute Details

#branch_nameObject

Returns the value of attribute branch_name.



19
20
21
# File 'lib/docker_rails_proxy/commands/compose/up.rb', line 19

def branch_name
  @branch_name
end

#from_scratchObject Also known as: from_scratch?

Returns the value of attribute from_scratch.



19
20
21
# File 'lib/docker_rails_proxy/commands/compose/up.rb', line 19

def from_scratch
  @from_scratch
end

#optionsObject

Returns the value of attribute options.



19
20
21
# File 'lib/docker_rails_proxy/commands/compose/up.rb', line 19

def options
  @options
end

#stoppingObject Also known as: stopping?

Returns the value of attribute stopping.



19
20
21
# File 'lib/docker_rails_proxy/commands/compose/up.rb', line 19

def stopping
  @stopping
end

Instance Method Details

#processObject



45
46
47
48
49
50
51
52
# File 'lib/docker_rails_proxy/commands/compose/up.rb', line 45

def process
  system 'docker-compose up -d' if docker_compose?
  sync_app_and_gems_folders

  set_app_container_id if app_container_id.empty?
  run_bundle_install   if options[:bundle]
  seed                 if from_scratch?
end