Permalink
Browse files

Merge branch 'master' of git@github.com:rails/rails

  • Loading branch information...
2 parents d9c95c8 + c80fe10 commit 8d2ca7dde1993dea6f01ea504e7c1e154a09dbd0 @jeremy jeremy committed Nov 26, 2008
Showing with 161 additions and 4,244 deletions.
  1. +2 −0 actionmailer/lib/action_mailer/helpers.rb
  2. +1 −0 actionpack/Rakefile
  3. +5 −1 actionpack/lib/action_controller.rb
  4. +1 −0 actionpack/lib/action_controller/assertions/model_assertions.rb
  5. +0 −1 actionpack/lib/action_controller/base.rb
  6. +8 −1 actionpack/lib/action_controller/vendor/html-scanner.rb
  7. +0 −81 actionpack/lib/action_controller/vendor/rack-0.4.0/rack.rb
  8. +0 −22 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/adapter/camping.rb
  9. +0 −28 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/auth/abstract/handler.rb
  10. +0 −37 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/auth/abstract/request.rb
  11. +0 −58 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/auth/basic.rb
  12. +0 −124 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/auth/digest/md5.rb
  13. +0 −51 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/auth/digest/nonce.rb
  14. +0 −55 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/auth/digest/params.rb
  15. +0 −40 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/auth/digest/request.rb
  16. +0 −437 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/auth/openid.rb
  17. +0 −56 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/builder.rb
  18. +0 −36 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/cascade.rb
  19. +0 −61 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/commonlogger.rb
  20. +0 −63 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/deflater.rb
  21. +0 −158 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/directory.rb
  22. +0 −116 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/file.rb
  23. +0 −44 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/handler.rb
  24. +0 −57 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/handler/cgi.rb
  25. +0 −8 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/handler/evented_mongrel.rb
  26. +0 −84 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/handler/fastcgi.rb
  27. +0 −52 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/handler/lsws.rb
  28. +0 −78 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/handler/mongrel.rb
  29. +0 −57 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/handler/scgi.rb
  30. +0 −57 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/handler/webrick.rb
  31. +0 −401 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/lint.rb
  32. +0 −65 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/lobster.rb
  33. +0 −160 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/mock.rb
  34. +0 −57 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/recursive.rb
  35. +0 −64 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/reloader.rb
  36. +0 −209 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/request.rb
  37. +0 −166 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/response.rb
  38. +0 −140 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/session/abstract/id.rb
  39. +0 −71 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/session/cookie.rb
  40. +0 −97 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/session/memcache.rb
  41. +0 −73 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/session/pool.rb
  42. +0 −344 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/showexceptions.rb
  43. +0 −105 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/showstatus.rb
  44. +0 −38 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/static.rb
  45. +0 −48 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/urlmap.rb
  46. +0 −318 actionpack/lib/action_controller/vendor/rack-0.4.0/rack/utils.rb
  47. +0 −9 actionpack/lib/action_controller/vendor/rack.rb
  48. +2 −2 actionpack/test/controller/action_pack_assertions_test.rb
  49. +1 −1 activesupport/CHANGELOG
  50. +1 −0 activesupport/lib/active_support.rb
  51. +69 −0 activesupport/lib/active_support/message_encryptor.rb
  52. +46 −0 activesupport/test/message_encryptor_test.rb
  53. +3 −13 railties/lib/commands/server.rb
  54. +1 −0 railties/lib/rails/rack.rb
  55. +21 −0 railties/lib/rails/rack/debugger.rb
@@ -1,3 +1,5 @@
+require 'active_support/dependencies'
+
module ActionMailer
module Helpers #:nodoc:
def self.included(base) #:nodoc:
View
@@ -81,6 +81,7 @@ spec = Gem::Specification.new do |s|
s.requirements << 'none'
s.add_dependency('activesupport', '= 2.3.0' + PKG_BUILD)
+ s.add_dependency('rack', '= 0.4.0')
s.require_path = 'lib'
s.autorequire = 'action_controller'
@@ -31,6 +31,9 @@
end
end
+gem 'rack', '~> 0.4.0'
+require 'rack'
+
module ActionController
# TODO: Review explicit to see if they will automatically be handled by
# the initilizer if they are really needed.
@@ -99,4 +102,5 @@ class Session
autoload :Mime, 'action_controller/mime_type'
autoload :HTML, 'action_controller/vendor/html-scanner'
-autoload :Rack, 'action_controller/vendor/rack'
+
+require 'action_view'
@@ -11,6 +11,7 @@ module ModelAssertions
# assert_valid(model)
#
def assert_valid(record)
+ ::ActiveSupport::Deprecation.warn("assert_valid is deprecated. Use assert record.valid? instead", caller)
clean_backtrace do
assert record.valid?, record.errors.full_messages.join("\n")
end
@@ -1,4 +1,3 @@
-require 'action_view'
require 'set'
module ActionController #:nodoc:
@@ -1,9 +1,16 @@
$LOAD_PATH << "#{File.dirname(__FILE__)}/html-scanner"
module HTML
+ autoload :CDATA, 'html/node'
autoload :Document, 'html/document'
- autoload :Sanitizer, 'html/sanitizer'
autoload :FullSanitizer, 'html/sanitizer'
autoload :LinkSanitizer, 'html/sanitizer'
+ autoload :Node, 'html/node'
+ autoload :Sanitizer, 'html/sanitizer'
+ autoload :Selector, 'html/selector'
+ autoload :Tag, 'html/node'
+ autoload :Text, 'html/node'
+ autoload :Tokenizer, 'html/tokenizer'
+ autoload :Version, 'html/version'
autoload :WhiteListSanitizer, 'html/sanitizer'
end
@@ -1,81 +0,0 @@
-# Copyright (C) 2007, 2008 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.
-
-$: << 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
- "0.4"
- end
-
- autoload :Builder, "rack/builder"
- autoload :Cascade, "rack/cascade"
- autoload :CommonLogger, "rack/commonlogger"
- autoload :File, "rack/file"
- autoload :Deflater, "rack/deflater"
- autoload :Directory, "rack/directory"
- autoload :ForwardRequest, "rack/recursive"
- autoload :Handler, "rack/handler"
- autoload :Lint, "rack/lint"
- 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]
- end
- end
- end
-end
@@ -1,28 +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, &authenticator)
- @app, @authenticator = app, authenticator
- end
-
-
- private
-
- def unauthorized(www_authenticate = challenge)
- return [ 401, { 'WWW-Authenticate' => www_authenticate.to_s }, [] ]
- end
-
- def bad_request
- [ 400, {}, [] ]
- 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 8d2ca7d

Please sign in to comment.