@@ -19,7 +19,9 @@ def self.boot(options = {})
19
19
def initialize ( options = { } )
20
20
@foreground = options . fetch ( :foreground , false )
21
21
@env = options [ :env ] || default_env
22
- @applications = Hash . new { |h , k | h [ k ] = ApplicationManager . new ( k , env ) }
22
+ @applications = Hash . new do |hash , key |
23
+ hash [ key ] = ApplicationManager . new ( *key , env )
24
+ end
23
25
@pidfile = env . pidfile_path . open ( 'a' )
24
26
@mutex = Mutex . new
25
27
end
@@ -57,12 +59,12 @@ def serve(client)
57
59
app_client = client . recv_io
58
60
command = JSON . load ( client . read ( client . gets . to_i ) )
59
61
60
- args , default_rails_env = command . values_at ( 'args' , 'default_rails_env' )
62
+ args , default_rails_env , spawn_env = command . values_at ( 'args' , 'default_rails_env' , 'spawn_env ')
61
63
62
64
if Spring . command? ( args . first )
63
65
log "running command #{ args . first } "
64
66
client . puts
65
- client . puts @applications [ rails_env_for ( args , default_rails_env ) ] . run ( app_client )
67
+ client . puts @applications [ rails_env_for ( args , default_rails_env , spawn_env ) ] . run ( app_client )
66
68
else
67
69
log "command not found #{ args . first } "
68
70
client . close
@@ -73,8 +75,8 @@ def serve(client)
73
75
redirect_output
74
76
end
75
77
76
- def rails_env_for ( args , default_rails_env )
77
- Spring . command ( args . first ) . env ( args . drop ( 1 ) ) || default_rails_env
78
+ def rails_env_for ( args , default_rails_env , spawn_env )
79
+ [ Spring . command ( args . first ) . env ( args . drop ( 1 ) ) || default_rails_env , spawn_env ]
78
80
end
79
81
80
82
# Boot the server into the process group of the current session.
0 commit comments