public
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/macournoyer/thin.git
Search Repo:
Fix current cluster port number not beeing forwarded to thin script.
macournoyer (author)
Sat Jan 12 08:49:14 -0800 2008
commit  d39a4de1448b9a7de3e311789311158f6d22252c
tree    f6f40e43f9fb520c1dbfb37a1f38e222c76cd16d
parent  6a7725668ba733c1d23fc1df3c0aa0a0d0d05c3e
...
72
73
74
75
 
76
77
 
 
78
79
80
...
72
73
74
 
75
76
 
77
78
79
80
81
0
@@ -72,9 +72,10 @@
0
     private
0
       # Send the command to the +thin+ script
0
       def run(cmd, options, port)
0
- shell_cmd = shellify(cmd, options.merge(:p:pid => pid_file_for(port), :log => log_file_for(port)))
0
+ shell_cmd = shellify(cmd, options.merge(:port => port, :pid => pid_file_for(port), :log => log_file_for(port)))
0
         trace shell_cmd
0
- log `#{shell_cmd}`
0
+ ouput = `#{shell_cmd}`.chomp
0
+ log ouput unless ouput.empty?
0
       end
0
       
0
       # Turn into a runnable shell command
...
39
40
41
42
43
44
45
 
 
 
 
 
 
46
47
48
49
50
51
52
53
54
55
56
57
58
59
 
 
 
60
 
 
61
62
...
39
40
41
 
 
 
 
42
43
44
45
46
47
48
49
50
 
 
 
 
 
 
 
 
 
 
 
51
52
53
54
55
56
57
58
0
@@ -39,25 +39,21 @@
0
   end
0
   
0
   it 'should start on specified port' do
0
- @cluster.start_on_port 3000
0
-
0
- File.exist?(@cluster.pid_file_for(3000)).should be_true
0
- File.exist?(@cluster.log_file_for(3000)).should be_true
0
+ @cluster.should_receive(:`) do |with|
0
+ with.should include('thin start', '--daemonize', 'thin.3001.log', 'thin.3001.pid', '--port=3001')
0
+ ''
0
+ end
0
+
0
+ @cluster.start_on_port 3001
0
   end
0
 
0
   it 'should stop on specified port' do
0
- @cluster.start_on_port 3000
0
- @cluster.stop_on_port 3000
0
-
0
- File.exist?(@cluster.pid_file_for(3000)).should be_false
0
- end
0
-
0
- after do
0
- 3000.upto(3003) do |port|
0
- Process.kill 9, @cluster.pid_for(port) rescue nil
0
- File.delete @cluster.pid_file_for(port) rescue nil
0
- File.delete @cluster.log_file_for(port) rescue nil
0
+ @cluster.should_receive(:`) do |with|
0
+ with.should include('thin stop', '--daemonize', 'thin.3001.log', 'thin.3001.pid', '--port=3001')
0
+ ''
0
     end
0
+
0
+ @cluster.stop_on_port 3001
0
   end
0
 end

Comments

    No one has commented yet.