From a0b2ee5f2975430627aa959ed8c9de044ec85528 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 5 Sep 2009 13:27:50 -0500 Subject: rackup should expect $LOAD_PATH to already be set up --- bin/rackup | 3 +-- test/cgi/test.ru | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/rackup b/bin/rackup index 874fe192..91abe17b 100755 --- a/bin/rackup +++ b/bin/rackup @@ -1,8 +1,7 @@ #!/usr/bin/env ruby # -*- ruby -*- -$LOAD_PATH.unshift File.expand_path("#{__FILE__}/../../lib") -autoload :Rack, 'rack' +require 'rack' require 'optparse' diff --git a/test/cgi/test.ru b/test/cgi/test.ru index 4054b886..fc9b6ffc 100755 --- a/test/cgi/test.ru +++ b/test/cgi/test.ru @@ -1,5 +1,4 @@ -#!/usr/bin/env ../../bin/rackup -#\ -E deployment -I ../../lib +#!/usr/bin/env ruby -I ../../lib ../../bin/rackup -E deployment -I ../../lib # -*- ruby -*- require '../testrequest' -- cgit v1.2.3-24-ge0c7 From 18cbfc5bcd22193b42bfff69bd8ad17d26eec594 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 5 Sep 2009 13:29:45 -0500 Subject: lib/ should already be added to the $LOAD_PATH by the package manager --- lib/rack.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/rack.rb b/lib/rack.rb index 371d0156..8d0815b6 100644 --- a/lib/rack.rb +++ b/lib/rack.rb @@ -3,10 +3,6 @@ # Rack is freely distributable under the terms of an MIT-style license. # See COPYING or http://www.opensource.org/licenses/mit-license.php. -path = File.expand_path(File.dirname(__FILE__)) -$:.unshift(path) unless $:.include?(path) - - # The Rack main module, serving as a namespace for all core Rack # modules and classes. # -- cgit v1.2.3-24-ge0c7 From 3d000c5690715be1f1424ce70b08a702c8528d03 Mon Sep 17 00:00:00 2001 From: Michael Fellinger Date: Tue, 8 Sep 2009 19:11:05 +0200 Subject: Pass more options to mongrel --- lib/rack/handler/mongrel.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/rack/handler/mongrel.rb b/lib/rack/handler/mongrel.rb index 7b448261..cd1af2de 100644 --- a/lib/rack/handler/mongrel.rb +++ b/lib/rack/handler/mongrel.rb @@ -7,8 +7,12 @@ module Rack module Handler class Mongrel < ::Mongrel::HttpHandler def self.run(app, options={}) - server = ::Mongrel::HttpServer.new(options[:Host] || '0.0.0.0', - options[:Port] || 8080) + server = ::Mongrel::HttpServer.new( + options[:Host] || '0.0.0.0', + options[:Port] || 8080, + options[:num_processors] || 950, + options[:throttle] || 0, + options[:timeout] || 60) # Acts like Rack::URLMap, utilizing Mongrel's own path finding methods. # Use is similar to #run, replacing the app argument with a hash of # { path=>app, ... } or an instance of Rack::URLMap. -- cgit v1.2.3-24-ge0c7 From de668df02802a0335376a81ba709270e43ba9d55 Mon Sep 17 00:00:00 2001 From: raggi Date: Mon, 5 Oct 2009 22:53:28 +0100 Subject: Relax Lint slightly to allow subclasses of the required types --- lib/rack/lint.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/rack/lint.rb b/lib/rack/lint.rb index 796807a0..a1fcc3c6 100644 --- a/lib/rack/lint.rb +++ b/lib/rack/lint.rb @@ -61,7 +61,7 @@ module Rack ## subclassing allowed) that includes CGI-like headers. ## The application is free to modify the environment. assert("env #{env.inspect} is not a Hash, but #{env.class}") { - env.instance_of? Hash + env.kind_of? Hash } ## @@ -175,7 +175,7 @@ module Rack env.each { |key, value| next if key.include? "." # Skip extensions assert("env variable #{key} has non-string value #{value.inspect}") { - value.instance_of? String + value.kind_of? String } } @@ -184,7 +184,7 @@ module Rack ## * rack.version must be an array of Integers. assert("rack.version must be an Array, was #{env["rack.version"].class}") { - env["rack.version"].instance_of? Array + env["rack.version"].kind_of? Array } ## * rack.url_scheme must either be +http+ or +https+. assert("rack.url_scheme unknown: #{env["rack.url_scheme"].inspect}") { @@ -269,7 +269,7 @@ module Rack assert("rack.input#gets called with arguments") { args.size == 0 } v = @input.gets assert("rack.input#gets didn't return a String") { - v.nil? or v.instance_of? String + v.nil? or v.kind_of? String } v end @@ -304,7 +304,7 @@ module Rack v = @input.read(*args) assert("rack.input#read didn't return nil or a String") { - v.nil? or v.instance_of? String + v.nil? or v.kind_of? String } if args[0].nil? assert("rack.input#read(nil) returned nil on EOF") { @@ -320,7 +320,7 @@ module Rack assert("rack.input#each called with arguments") { args.size == 0 } @input.each { |line| assert("rack.input#each didn't yield a String") { - line.instance_of? String + line.kind_of? String } yield line } @@ -373,7 +373,7 @@ module Rack ## * +write+ must be called with a single argument that is a String. def write(str) - assert("rack.errors#write not called with a String") { str.instance_of? String } + assert("rack.errors#write not called with a String") { str.kind_of? String } @error.write str end @@ -407,7 +407,7 @@ module Rack header.each { |key, value| ## The header keys must be Strings. assert("header key must be a string, was #{key.class}") { - key.instance_of? String + key.kind_of? String } ## The header must not contain a +Status+ key, assert("header must not contain Status") { key.downcase != "status" } @@ -499,7 +499,7 @@ module Rack @body.each { |part| ## and must only yield String values. assert("Body yielded non-string value #{part.inspect}") { - part.instance_of? String + part.kind_of? String } yield part } -- cgit v1.2.3-24-ge0c7