1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

removing backwards compatibility module

This commit is contained in:
Aaron Patterson 2011-09-12 16:50:25 -07:00
parent 68ec26c70c
commit f65b2215cd
3 changed files with 8 additions and 9 deletions

View file

@ -45,7 +45,7 @@ module ActionDispatch
rewritten_url << (options[:trailing_slash] ? path.sub(/\?|\z/) { "/" + $& } : path) rewritten_url << (options[:trailing_slash] ? path.sub(/\?|\z/) { "/" + $& } : path)
rewritten_url << "?#{params.to_query}" unless params.empty? rewritten_url << "?#{params.to_query}" unless params.empty?
rewritten_url << "##{Rack::Mount::Utils.escape_uri(options[:anchor].to_param.to_s)}" if options[:anchor] rewritten_url << "##{Journey::Router::Utils.escape_uri(options[:anchor].to_param.to_s)}" if options[:anchor]
rewritten_url rewritten_url
end end

View file

@ -213,8 +213,8 @@ module ActionDispatch
end end
def segment_keys def segment_keys
@segment_keys ||= Rack::Mount::RegexpWithNamedGroups.new( @segment_keys ||= Journey::Path::Pattern.new(
Rack::Mount::Strexp.compile(@path, requirements, SEPARATORS) Journey::Router::Strexp.compile(@path, requirements, SEPARATORS)
).names ).names
end end
@ -235,7 +235,7 @@ module ActionDispatch
# (:locale) becomes (/:locale) instead of /(:locale). Except # (:locale) becomes (/:locale) instead of /(:locale). Except
# for root cases, where the latter is the correct one. # for root cases, where the latter is the correct one.
def self.normalize_path(path) def self.normalize_path(path)
path = Rack::Mount::Utils.normalize_path(path) path = Journey::Router::Utils.normalize_path(path)
path.gsub!(%r{/(\(+)/?}, '\1/') unless path =~ %r{^/\(+[^/]+\)$} path.gsub!(%r{/(\(+)/?}, '\1/') unless path =~ %r{^/\(+[^/]+\)$}
path path
end end

View file

@ -1,5 +1,4 @@
require 'journey/router' require 'journey/router'
require 'journey/backwards'
require 'forwardable' require 'forwardable'
require 'active_support/core_ext/object/blank' require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/object/to_query' require 'active_support/core_ext/object/to_query'
@ -394,10 +393,10 @@ module ActionDispatch
if name == :controller if name == :controller
value value
elsif value.is_a?(Array) elsif value.is_a?(Array)
value.map { |v| Rack::Mount::Utils.escape_uri(v.to_param) }.join('/') value.map { |v| Journey::Router::Utils.escape_uri(v.to_param) }.join('/')
else else
return nil unless param = value.to_param return nil unless param = value.to_param
param.split('/').map { |v| Rack::Mount::Utils.escape_uri(v) }.join("/") param.split('/').map { |v| Journey::Router::Utils.escape_uri(v) }.join("/")
end end
end end
@ -496,7 +495,7 @@ module ActionDispatch
return [path, params.keys] if @extras return [path, params.keys] if @extras
[path, params] [path, params]
rescue Rack::Mount::RoutingError rescue Journey::Router::RoutingError
raise_routing_error raise_routing_error
end end
@ -573,7 +572,7 @@ module ActionDispatch
def recognize_path(path, environment = {}) def recognize_path(path, environment = {})
method = (environment[:method] || "GET").to_s.upcase method = (environment[:method] || "GET").to_s.upcase
path = Rack::Mount::Utils.normalize_path(path) unless path =~ %r{://} path = Journey::Router::Utils.normalize_path(path) unless path =~ %r{://}
begin begin
env = Rack::MockRequest.env_for(path, {:method => method}) env = Rack::MockRequest.env_for(path, {:method => method})