diff options
author | Dmitry Polushkin <dmitry.polushkin@gmail.com> | 2011-09-15 09:39:26 +0100 |
---|---|---|
committer | Dmitry Polushkin <dmitry.polushkin@gmail.com> | 2011-09-15 09:39:26 +0100 |
commit | 9d54f8994d09db5435d6c234430ae13333928fb9 (patch) | |
tree | 12413c10ed50c181f5bea0980edca998e72969bb /actionpack/lib/action_dispatch/routing/mapper.rb | |
parent | edd2f21e8095fe4a38e812025b4d9fd0e0cc28f1 (diff) | |
parent | da7f0426ec7b0aa053489633c2a8a3da6423654f (diff) | |
download | rails-9d54f8994d09db5435d6c234430ae13333928fb9.tar.gz rails-9d54f8994d09db5435d6c234430ae13333928fb9.tar.bz2 rails-9d54f8994d09db5435d6c234430ae13333928fb9.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 4d65173f61..cd59b13c42 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -213,8 +213,8 @@ module ActionDispatch end def segment_keys - @segment_keys ||= Rack::Mount::RegexpWithNamedGroups.new( - Rack::Mount::Strexp.compile(@path, requirements, SEPARATORS) + @segment_keys ||= Journey::Path::Pattern.new( + Journey::Router::Strexp.compile(@path, requirements, SEPARATORS) ).names end @@ -235,7 +235,7 @@ module ActionDispatch # (:locale) becomes (/:locale) instead of /(:locale). Except # for root cases, where the latter is the correct one. 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 end @@ -1465,9 +1465,9 @@ module ActionDispatch end module Shorthand #:nodoc: - def match(*args) - if args.size == 1 && args.last.is_a?(Hash) - options = args.pop + def match(path, *rest) + if rest.empty? && Hash === path + options = path path, to = options.find { |name, value| name.is_a?(String) } options.merge!(:to => to).delete(path) super(path, options) |