Merged updates from trunk into stable branch
[feedcatcher.git] / vendor / rails / actionpack / lib / action_controller / vendor / rack-1.0 / rack / handler / thin.rb
diff --git a/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/thin.rb b/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/thin.rb
new file mode 100644 (file)
index 0000000..3d4fedf
--- /dev/null
@@ -0,0 +1,18 @@
+require "thin"
+require "rack/content_length"
+require "rack/chunked"
+
+module Rack
+  module Handler
+    class Thin
+      def self.run(app, options={})
+        app = Rack::Chunked.new(Rack::ContentLength.new(app))
+        server = ::Thin::Server.new(options[:Host] || '0.0.0.0',
+                                    options[:Port] || 8080,
+                                    app)
+        yield server if block_given?
+        server.start
+      end
+    end
+  end
+end