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:
Allow passing port as a string in Server.new
macournoyer (author)
Fri Apr 18 12:16:33 -0700 2008
commit  c90f50f691e8325cd7a964b0a0d3b2052332a0ed
tree    4ffa0fb5cbe084b2d97987a086c9cf4638bcd309
parent  b02c717f59378f71f11469d2698d96e8a7d197c4
...
1
 
2
3
4
...
1
2
3
4
5
0
@@ -1,4 +1,5 @@
0
 == 0.8.1 Rebel Porpoise release
0
+ * Allow passing port as a string in Server.new
0
  * Define deferred?(env) in your Rack application to set if a request is handled in a
0
    thread (return true) or not (return false).
0
 
...
90
91
92
93
94
95
 
 
 
96
97
98
...
90
91
92
 
 
 
93
94
95
96
97
98
0
@@ -90,9 +90,9 @@
0
       
0
       args.each do |arg|
0
         case arg
0
- when String then host = arg
0
- when Fixnum then port = arg
0
- when Hash then options = arg
0
+ when Fixnum, /^\d+$/ then port = arg.to_i
0
+ when String then host = arg
0
+ when Hash then options = arg
0
         else
0
           @app = arg if arg.respond_to?(:call)
0
         end
...
81
82
83
 
 
 
 
 
 
 
 
84
85
86
...
81
82
83
84
85
86
87
88
89
90
91
92
93
94
0
@@ -81,6 +81,14 @@
0
     server.backend.should be_kind_of(Thin::Backends::SwiftiplyClient)
0
   end
0
   
0
+ it "should set port as string" do
0
+ app = proc {}
0
+ server = Server.new('192.168.1.1', '8080')
0
+
0
+ server.host.should == '192.168.1.1'
0
+ server.port.should == 8080
0
+ end
0
+
0
   it "should not register signals w/ :signals => false" do
0
     Server.should_not_receive(:setup_signals)
0
     Server.new(:signals => false)

Comments

    No one has commented yet.