public
Rubygem
Description: Merb Core: All you need. None you don't.
Homepage: http://www.merbivore.com
Clone URL: git://github.com/wycats/merb-core.git
Tests pass: we don't need to fork for class load in test env, plus update config 
spec for some small changes to the internal API
wycats (author)
Sat Sep 27 13:23:28 -0700 2008
commit  afc291cd9d5c660c4071741b21e79a3df62223f2
tree    9cdf7dc797772bbf506d7431ca00f168af4b1acf
parent  67e1756c267edb27f0229e0e7f9883736868742a
...
380
381
382
383
 
384
385
386
...
380
381
382
 
383
384
385
386
0
@@ -380,7 +380,7 @@ class Merb::BootLoader::LoadClasses < Merb::BootLoader
0
       @ran = true
0
       $0 = "merb: master"
0
       
0
-      if Merb::Config[:fork_for_class_load]
0
+      if Merb::Config[:fork_for_class_load] && !Merb.env == "test"
0
         start_transaction
0
       else
0
         trap('INT') do 
...
82
83
84
85
 
86
87
88
...
236
237
238
239
240
241
242
 
243
244
245
...
82
83
84
 
85
86
87
88
...
236
237
238
 
 
 
 
239
240
241
242
0
@@ -82,7 +82,7 @@ module Merb
0
         rescue Errno::EACCES => e
0
           Merb.fatal! e.message, e
0
         rescue Errno::ENOENT => e
0
-          Merb.fatal! "Could not find a PID file at #{pid_file(port)}", e
0
+          Merb.fatal! "Could not find a PID file at #{pid_file(port)}", e           
0
         end
0
         if sig.is_a?(Integer)
0
           sig = Signal.list.invert[sig]
0
@@ -236,10 +236,7 @@ module Merb
0
       def pid_files
0
         if Merb::Config[:pid_file]
0
           if Merb::Config[:cluster]
0
-            ext = File.extname(Merb::Config[:pid_file])
0
-            base = File.basename(Merb::Config[:pid_file], ext)
0
-            dir = File.dirname(Merb::Config[:pid_file])
0
-            Dir[dir / "#{base}.*#{ext}"]
0
+            Dir[Merb::Config[:pid_file] % "*"]
0
           else
0
             [ Merb::Config[:pid_file] ]
0
           end
...
56
57
58
59
 
60
61
62
63
64
 
65
66
67
...
76
77
78
79
 
80
81
82
83
84
 
85
86
87
...
96
97
98
99
 
100
101
102
...
144
145
146
147
 
148
149
150
151
152
 
153
154
155
...
56
57
58
 
59
60
61
62
63
 
64
65
66
67
...
76
77
78
 
79
80
81
82
83
 
84
85
86
87
...
96
97
98
 
99
100
101
102
...
144
145
146
 
147
148
149
150
151
 
152
153
154
155
0
@@ -56,12 +56,12 @@ describe Merb::Config do
0
 
0
   it "should support -c to set the number of cluster nodes" do
0
     Merb::Config.parse_args(["-c", "4"])
0
-    Merb::Config[:cluster].should == "4"
0
+    Merb::Config[:cluster].should == 4
0
   end
0
 
0
   it "should support -p to set the port number" do
0
     Merb::Config.parse_args(["-p", "6000"])
0
-    Merb::Config[:port].should == "6000"
0
+    Merb::Config[:port].should == 6000
0
   end
0
 
0
   it "should support -o to set the socket filename" do
0
@@ -76,12 +76,12 @@ describe Merb::Config do
0
 
0
   it "should support -s to set the socket number" do
0
     Merb::Config.parse_args(["-s", "0"])
0
-    Merb::Config[:socket].should == "0"
0
+    Merb::Config[:socket].should == 0
0
   end
0
 
0
   it "should support --socket to set the socket number" do
0
     Merb::Config.parse_args(["--socket", "3"])
0
-    Merb::Config[:socket].should == "3"
0
+    Merb::Config[:socket].should == 3
0
   end
0
 
0
   it "should support -P to set the PIDfile" do
0
@@ -96,7 +96,7 @@ describe Merb::Config do
0
   end
0
 
0
   it "should support setting of PIDfile with cluster nodes" do
0
-    Merb::Config.parse_args(["-P", "/tmp/merb.pidfile", "-c", "2", "-p", "6000"])
0
+    Merb::Config.parse_args(["-P", "/tmp/merb.%s.pidfile", "-c", "2", "-p", "6000"])
0
     Merb::Server.pid_file(6000).should == "/tmp/merb.6000.pidfile"
0
     Merb::Server.pid_file(6001).should == "/tmp/merb.6001.pidfile"
0
 
0
@@ -144,12 +144,12 @@ describe Merb::Config do
0
   end
0
 
0
   it "should support -K for a graceful kill" do
0
-    Merb::Server.should_receive(:kill).with("all", 1)
0
+    Merb::Server.should_receive(:kill).with("main", 2)
0
     Merb.start(["-K", "all"])
0
   end
0
 
0
   it "should support -k for a hard kill" do
0
-    Merb::Server.should_receive(:kill).with("all", 9)
0
+    Merb::Server.should_receive(:kill).with("main", 9)
0
     Merb.start(["-k", "all"])
0
   end
0
 

Comments