Permalink
Browse files

Break up inflector to reduce the dependency burden on dependency-les …

…methods like constantize.
  • Loading branch information...
Yehuda Katz
Yehuda Katz committed Nov 7, 2009
1 parent cbded53 commit e1b5e3cc709df12d2d8495737e524f60015e6f5c
@@ -6,6 +6,7 @@
require 'active_support/core_ext/array/wrap'
require 'active_support/core_ext/hash/indifferent_access'
require 'active_support/core_ext/object/tap'
+require 'active_support/core_ext/string/access'
module ActionDispatch
class Request < Rack::Request
@@ -1,3 +1,5 @@
+require "active_support/inflector/methods"
+
module ActionDispatch
class MiddlewareStack < Array
class Middleware
@@ -32,7 +34,7 @@ def klass
elsif @klass.respond_to?(:call)
@klass.call
else
- @klass.to_s.constantize
+ ActiveSupport::Inflector.constantize(@klass.to_s)
end
end
@@ -53,7 +55,7 @@ def ==(middleware)
when Class
klass == middleware
else
- klass == middleware.to_s.constantize
+ klass == ActiveSupport::Inflector.constantize(middleware.to_s)
end
end
@@ -1,3 +1,5 @@
+require "active_support/multibyte"
+
class String
unless '1.9'.respond_to?(:force_encoding)
# Returns the character at the +position+ treating the string as an array (where 0 is the first character).
Oops, something went wrong.

0 comments on commit e1b5e3c

Please sign in to comment.