Permalink
Browse files

* Require Rack 1.0.0

* Require EventMachine 0.12.6
  • Loading branch information...
1 parent a303c27 commit ed2325ff41c187156abf17a61453653eadcaea98 @macournoyer macournoyer committed May 2, 2009
Showing with 19 additions and 7 deletions.
  1. +3 −1 CHANGELOG
  2. +1 −1 lib/thin/version.rb
  3. +13 −3 spec/server/stopping_spec.rb
  4. +2 −2 tasks/gem.rake
View
@@ -1,5 +1,7 @@
== 1.2.1 Asynctilicious Ultra Supreme release
- * Use Rails Rack based dispatcher when available in Rails 2.3
+ * Require Rack 1.0.0
+ * Require EventMachine 0.12.6
+ * Use Rails Rack based dispatcher when available
* Allow String for response body
* Require openssl before eventmachine to prevent crash in 1.9
View
@@ -12,7 +12,7 @@ module VERSION #:nodoc:
CODENAME = "Asynctilicious Ultra Supreme".freeze
- RACK = [0, 1].freeze # Rack protocol version that was tested
+ RACK = [1, 0].freeze # Rack protocol version
end
NAME = 'thin'.freeze
@@ -5,13 +5,21 @@
start_server do |env|
[200, { 'Content-Type' => 'text/html' }, ['ok']]
end
+ @done = false
end
it "should wait for current requests before soft stopping" do
socket = TCPSocket.new('0.0.0.0', 3333)
socket.write("GET / HTTP/1.1")
- @server.stop # Stop the server in the middle of a request
- socket.write("\r\n\r\n")
+ EventMachine.next_tick do
+ @server.stop # Stop the server in the middle of a request
+ socket.write("\r\n\r\n")
+ @done = true
+ end
+
+ timeout(2) do
+ Thread.pass until @done
+ end
out = socket.read
socket.close
@@ -36,7 +44,9 @@
socket.write("GET / HTTP/1.1")
@server.stop! # Force stop the server in the middle of a request
- EventMachine.next_tick { socket.should be_closed }
+ EventMachine.next_tick do
+ socket.should be_closed
+ end
end
after do
View
@@ -20,8 +20,8 @@ spec = Gem::Specification.new do |s|
s.required_ruby_version = '>= 1.8.5'
- s.add_dependency 'rack', '>= 0.9.1'
- s.add_dependency 'eventmachine', '>= 0.12.4'
+ s.add_dependency 'rack', '>= 1.0.0'
+ s.add_dependency 'eventmachine', '>= 0.12.6'
unless WIN
s.add_dependency 'daemons', '>= 1.0.9'
end

0 comments on commit ed2325f

Please sign in to comment.