Class: WebSystem::RackCommand

Inherits:
DevSystem::Command show all
Defined in:
lib/web_system/sub/rack/commands/rack_command.rb

Instance Method Summary collapse

Methods inherited from DevSystem::Command

call, get_command_signatures

Methods inherited from Liza::Controller

color, inherited, on_connected

Methods inherited from Liza::Unit

const_missing, division, part, system, #system, test_class

Instance Method Details

#call(args) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/web_system/sub/rack/commands/rack_command.rb', line 3

def call args
  log "args = #{args.inspect}"

  server = nil
  host = nil
  port = nil

  if args.any? && !args[0].include?("=")
    server = args.shift
  end

  args.each do |arg|
    host = arg.split("=")[1] if arg.start_with? "h="
    port = arg.split("=")[1] if arg.start_with? "p="
  end

  env = {server:, host:, port:}

  log env

  rack_panel.call env
end

#rack_panelObject



26
27
28
# File 'lib/web_system/sub/rack/commands/rack_command.rb', line 26

def rack_panel
  @rack_panel ||= WebBox[:rack]
end