Permalink
Browse files

Remove vendored version of Rack

  • Loading branch information...
1 parent 044794f commit b69da86ea545b342036fb37a472ec5abefaf3bd5 @josh josh committed Apr 25, 2009
Showing with 8 additions and 5,007 deletions.
  1. +2 −7 actionpack/lib/action_dispatch.rb
  2. +5 −1 actionpack/lib/action_dispatch/http/request.rb
  3. +0 −89 actionpack/lib/action_dispatch/vendor/rack-1.0/rack.rb
  4. +0 −22 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/adapter/camping.rb
  5. +0 −37 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/abstract/handler.rb
  6. +0 −37 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/abstract/request.rb
  7. +0 −58 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/basic.rb
  8. +0 −124 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/digest/md5.rb
  9. +0 −51 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/digest/nonce.rb
  10. +0 −55 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/digest/params.rb
  11. +0 −40 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/digest/request.rb
  12. +0 −480 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/openid.rb
  13. +0 −63 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/builder.rb
  14. +0 −36 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/cascade.rb
  15. +0 −49 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/chunked.rb
  16. +0 −61 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/commonlogger.rb
  17. +0 −45 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/conditionalget.rb
  18. +0 −29 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/content_length.rb
  19. +0 −23 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/content_type.rb
  20. +0 −85 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/deflater.rb
  21. +0 −153 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/directory.rb
  22. +0 −88 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/file.rb
  23. +0 −48 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler.rb
  24. +0 −61 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/cgi.rb
  25. +0 −8 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/evented_mongrel.rb
  26. +0 −89 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/fastcgi.rb
  27. +0 −55 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/lsws.rb
  28. +0 −84 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/mongrel.rb
  29. +0 −59 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/scgi.rb
  30. +0 −8 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/swiftiplied_mongrel.rb
  31. +0 −18 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/thin.rb
  32. +0 −67 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/webrick.rb
  33. +0 −19 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/head.rb
  34. +0 −462 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/lint.rb
  35. +0 −65 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/lobster.rb
  36. +0 −16 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/lock.rb
  37. +0 −27 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/methodoverride.rb
  38. +0 −204 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/mime.rb
  39. +0 −160 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/mock.rb
  40. +0 −57 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/recursive.rb
  41. +0 −64 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/reloader.rb
  42. +0 −241 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/request.rb
  43. +0 −179 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/response.rb
  44. +0 −142 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/session/abstract/id.rb
  45. +0 −91 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/session/cookie.rb
  46. +0 −109 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/session/memcache.rb
  47. +0 −100 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/session/pool.rb
  48. +0 −349 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/showexceptions.rb
  49. +0 −106 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/showstatus.rb
  50. +0 −38 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/static.rb
  51. +0 −55 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/urlmap.rb
  52. +0 −392 actionpack/lib/action_dispatch/vendor/rack-1.0/rack/utils.rb
  53. +1 −1 actionpack/test/dispatch/request/multipart_params_parsing_test.rb
@@ -32,13 +32,8 @@
end
require 'active_support/core/all'
-$:.unshift "#{File.dirname(__FILE__)}/action_dispatch/vendor/rack-1.0"
-begin
- gem 'rack', '~> 1.0.0'
- require 'rack'
-rescue Gem::LoadError
- require 'action_dispatch/vendor/rack-1.0/rack'
-end
+gem 'rack', '~> 1.0.0'
+require 'rack'
module ActionDispatch
autoload :Request, 'action_dispatch/http/request'
@@ -93,7 +93,11 @@ def content_type
end
end
end
-
+
+ def media_type
+ content_type.to_s
+ end
+
# Returns the accepted MIME type for the request.
def accepts
@accepts ||= begin
@@ -1,89 +0,0 @@
-# Copyright (C) 2007, 2008, 2009 Christian Neukirchen <purl.org/net/chneukirchen>
-#
-# Rack is freely distributable under the terms of an MIT-style license.
-# See COPYING or http://www.opensource.org/licenses/mit-license.php.
-
-$:.unshift(File.expand_path(File.dirname(__FILE__)))
-
-
-# The Rack main module, serving as a namespace for all core Rack
-# modules and classes.
-#
-# All modules meant for use in your application are <tt>autoload</tt>ed here,
-# so it should be enough just to <tt>require rack.rb</tt> in your code.
-
-module Rack
- # The Rack protocol version number implemented.
- VERSION = [0,1]
-
- # Return the Rack protocol version as a dotted string.
- def self.version
- VERSION.join(".")
- end
-
- # Return the Rack release as a dotted string.
- def self.release
- "1.0 bundled"
- end
-
- autoload :Builder, "rack/builder"
- autoload :Cascade, "rack/cascade"
- autoload :Chunked, "rack/chunked"
- autoload :CommonLogger, "rack/commonlogger"
- autoload :ConditionalGet, "rack/conditionalget"
- autoload :ContentLength, "rack/content_length"
- autoload :ContentType, "rack/content_type"
- autoload :File, "rack/file"
- autoload :Deflater, "rack/deflater"
- autoload :Directory, "rack/directory"
- autoload :ForwardRequest, "rack/recursive"
- autoload :Handler, "rack/handler"
- autoload :Head, "rack/head"
- autoload :Lint, "rack/lint"
- autoload :Lock, "rack/lock"
- autoload :MethodOverride, "rack/methodoverride"
- autoload :Mime, "rack/mime"
- autoload :Recursive, "rack/recursive"
- autoload :Reloader, "rack/reloader"
- autoload :ShowExceptions, "rack/showexceptions"
- autoload :ShowStatus, "rack/showstatus"
- autoload :Static, "rack/static"
- autoload :URLMap, "rack/urlmap"
- autoload :Utils, "rack/utils"
-
- autoload :MockRequest, "rack/mock"
- autoload :MockResponse, "rack/mock"
-
- autoload :Request, "rack/request"
- autoload :Response, "rack/response"
-
- module Auth
- autoload :Basic, "rack/auth/basic"
- autoload :AbstractRequest, "rack/auth/abstract/request"
- autoload :AbstractHandler, "rack/auth/abstract/handler"
- autoload :OpenID, "rack/auth/openid"
- module Digest
- autoload :MD5, "rack/auth/digest/md5"
- autoload :Nonce, "rack/auth/digest/nonce"
- autoload :Params, "rack/auth/digest/params"
- autoload :Request, "rack/auth/digest/request"
- end
- end
-
- module Session
- autoload :Cookie, "rack/session/cookie"
- autoload :Pool, "rack/session/pool"
- autoload :Memcache, "rack/session/memcache"
- end
-
- # *Adapters* connect Rack with third party web frameworks.
- #
- # Rack includes an adapter for Camping, see README for other
- # frameworks supporting Rack in their code bases.
- #
- # Refer to the submodules for framework-specific calling details.
-
- module Adapter
- autoload :Camping, "rack/adapter/camping"
- end
-end
@@ -1,22 +0,0 @@
-module Rack
- module Adapter
- class Camping
- def initialize(app)
- @app = app
- end
-
- def call(env)
- env["PATH_INFO"] ||= ""
- env["SCRIPT_NAME"] ||= ""
- controller = @app.run(env['rack.input'], env)
- h = controller.headers
- h.each_pair do |k,v|
- if v.kind_of? URI
- h[k] = v.to_s
- end
- end
- [controller.status, controller.headers, [controller.body.to_s]]
- end
- end
- end
-end
@@ -1,37 +0,0 @@
-module Rack
- module Auth
- # Rack::Auth::AbstractHandler implements common authentication functionality.
- #
- # +realm+ should be set for all handlers.
-
- class AbstractHandler
-
- attr_accessor :realm
-
- def initialize(app, realm=nil, &authenticator)
- @app, @realm, @authenticator = app, realm, authenticator
- end
-
-
- private
-
- def unauthorized(www_authenticate = challenge)
- return [ 401,
- { 'Content-Type' => 'text/plain',
- 'Content-Length' => '0',
- 'WWW-Authenticate' => www_authenticate.to_s },
- []
- ]
- end
-
- def bad_request
- return [ 400,
- { 'Content-Type' => 'text/plain',
- 'Content-Length' => '0' },
- []
- ]
- end
-
- end
- end
-end
@@ -1,37 +0,0 @@
-module Rack
- module Auth
- class AbstractRequest
-
- def initialize(env)
- @env = env
- end
-
- def provided?
- !authorization_key.nil?
- end
-
- def parts
- @parts ||= @env[authorization_key].split(' ', 2)
- end
-
- def scheme
- @scheme ||= parts.first.downcase.to_sym
- end
-
- def params
- @params ||= parts.last
- end
-
-
- private
-
- AUTHORIZATION_KEYS = ['HTTP_AUTHORIZATION', 'X-HTTP_AUTHORIZATION', 'X_HTTP_AUTHORIZATION']
-
- def authorization_key
- @authorization_key ||= AUTHORIZATION_KEYS.detect { |key| @env.has_key?(key) }
- end
-
- end
-
- end
-end
@@ -1,58 +0,0 @@
-require 'rack/auth/abstract/handler'
-require 'rack/auth/abstract/request'
-
-module Rack
- module Auth
- # Rack::Auth::Basic implements HTTP Basic Authentication, as per RFC 2617.
- #
- # Initialize with the Rack application that you want protecting,
- # and a block that checks if a username and password pair are valid.
- #
- # See also: <tt>example/protectedlobster.rb</tt>
-
- class Basic < AbstractHandler
-
- def call(env)
- auth = Basic::Request.new(env)
-
- return unauthorized unless auth.provided?
-
- return bad_request unless auth.basic?
-
- if valid?(auth)
- env['REMOTE_USER'] = auth.username
-
- return @app.call(env)
- end
-
- unauthorized
- end
-
-
- private
-
- def challenge
- 'Basic realm="%s"' % realm
- end
-
- def valid?(auth)
- @authenticator.call(*auth.credentials)
- end
-
- class Request < Auth::AbstractRequest
- def basic?
- :basic == scheme
- end
-
- def credentials
- @credentials ||= params.unpack("m*").first.split(/:/, 2)
- end
-
- def username
- credentials.first
- end
- end
-
- end
- end
-end
Oops, something went wrong.

0 comments on commit b69da86

Please sign in to comment.