Class: DockerRailsProxy::Rails

Inherits:
SyncBack show all
Defined in:
lib/docker_rails_proxy/commands/rails.rb

Constant Summary

Constants included from Callbacks

Callbacks::INHERITABLE_CALLBACKS, 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 Callbacks

included

Methods included from InheritableAttributes

included

Constructor Details

This class inherits a constructor from DockerRailsProxy::Base

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



3
4
5
# File 'lib/docker_rails_proxy/commands/rails.rb', line 3

def args
  @args
end

Instance Method Details

#processObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/docker_rails_proxy/commands/rails.rb', line 5

def process
  command, *@args = arguments

  case command
  when 'c',  'console'    then console
  when 'db', 'dbconsole'  then db
  when 'logs'             then logs
  when 'restart', 'touch' then restart
  when 'secrets'          then secrets
  when 'credentials'      then credentials
  else
    execute "bin/rails #{command} #{args.join(' ')}", tty: true
  end
end