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
Search Repo:
Merge branch 'pidfiles_cluster_fix' of git://github.com/gabriel/merb-core
ezmobius (author)
Sat May 03 16:50:53 -0700 2008
commit  d1d534d78a8549fb76b9714cd7ada6eb699786d3
tree    edc8ca0bd77468c97e2a94f32a997d45390e6628
parent  d9f42d9004623df64b29fb2b96c05a7a4b5c8025 parent  f08bd8868ba3dac4b402006211e9f784fd4de830
...
189
190
191
192
 
 
 
 
193
194
195
...
189
190
191
 
192
193
194
195
196
197
198
0
@@ -189,7 +189,10 @@
0
       def pid_files
0
         if Merb::Config[:pid_file]
0
           if Merb::Config[:cluster]
0
- Dir[Merb::Config[:pid_file] + ".*.pid"]
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
           else
0
             [ Merb::Config[:pid_file] ]
0
           end
...
71
72
73
74
 
 
75
76
77
78
79
80
 
 
 
81
82
83
84
85
 
 
 
86
87
88
...
71
72
73
 
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
0
@@ -71,18 +71,25 @@
0
 
0
   it "should have server return PIDfile setting as is with no cluster nodes" do
0
     Merb::Config.parse_args(["-P", "pidfile", "-p", "6000"])
0
- Merb::Server.pid_file(6000).should == "pidfile"
0
+ Merb::Server.pid_file(6000).should == "pidfile"
0
+ Merb::Server.pid_files.should == ["pidfile"]
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::Server.pid_file(6000).should == "/tmp/merb.6000.pidfile"
0
     Merb::Server.pid_file(6001).should == "/tmp/merb.6001.pidfile"
0
+
0
+ Dir.should_receive(:[]).with("/tmp/merb.*.pidfile")
0
+ Merb::Server.pid_files
0
   end
0
 
0
   it "should support default PIDfile setting" do
0
     Merb::Config.parse_args(["-p", "6000"])
0
     Merb::Server.pid_file(6000).should == Merb.log_path / "merb.6000.pid"
0
+
0
+ Dir.should_receive(:[]).with(Merb.log_path / "merb.*.pid")
0
+ Merb::Server.pid_files
0
   end
0
 
0
   it "should support -h to set the hostname" do

Comments

    No one has commented yet.