File tree 2 files changed +24
-4
lines changed
2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 5
5
6
6
require 'rubygems'
7
7
8
- deps = ARGV . shift . split ( "," ) . each do |s |
8
+ gems = ARGV . shift
9
+
10
+ inc = ""
11
+
12
+ if gems == "-I"
13
+ inc = ARGV . shift
14
+ $LOAD_PATH. concat inc . split ( ":" )
15
+ gems = ARGV . shift
16
+ end
17
+
18
+ gems . split ( "," ) . each do |s |
9
19
name , ver = s . split ( ":" , 2 )
10
20
gem name , ver
11
21
end
12
22
23
+ module Puma ; end
24
+
25
+ Puma . const_set ( "WILD_ARGS" , [ "-I" , inc , gems ] )
26
+
13
27
require 'puma/cli'
14
28
15
29
cli = Puma ::CLI . new ARGV
Original file line number Diff line number Diff line change @@ -363,7 +363,11 @@ def generate_restart_data
363
363
lib = File . expand_path "lib"
364
364
arg0 [ 1 , 0 ] = [ "-I" , lib ] if $:[ 0 ] == lib
365
365
366
- @restart_argv = arg0 + ARGV
366
+ if defined? Puma ::WILD_ARGS
367
+ @restart_argv = arg0 + Puma ::WILD_ARGS + ARGV
368
+ else
369
+ @restart_argv = arg0 + ARGV
370
+ end
367
371
end
368
372
end
369
373
@@ -431,6 +435,7 @@ def restart!
431
435
Dir . chdir @restart_dir
432
436
433
437
argv += [ redirects ] unless RUBY_VERSION < '1.9'
438
+
434
439
Kernel . exec ( *argv )
435
440
end
436
441
end
@@ -467,8 +472,9 @@ def run
467
472
468
473
wild = File . expand_path ( File . join ( puma_lib_dir , "../bin/puma-wild" ) )
469
474
470
- args = [ Gem . ruby ] + dirs . map { |x | [ "-I" , x ] } . flatten +
471
- [ wild , deps ] + @original_argv
475
+ wild_loadpath = dirs . join ( ":" )
476
+
477
+ args = [ Gem . ruby ] + [ wild , "-I" , wild_loadpath , deps ] + @original_argv
472
478
473
479
Kernel . exec ( *args )
474
480
end
You can’t perform that action at this time.
0 commit comments