diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-29 15:44:54 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-29 15:44:54 -0700 |
commit | bb207ea7b6df6101860d5de6e47ad0e0f1ea2cdf (patch) | |
tree | 17f6d5937caaae970e74286cb98b05098c96078a /actionpack/lib/action_dispatch | |
parent | 5682596db740d53e1deaf9244fcc004ccffe1fb4 (diff) | |
download | rails-bb207ea7b6df6101860d5de6e47ad0e0f1ea2cdf.tar.gz rails-bb207ea7b6df6101860d5de6e47ad0e0f1ea2cdf.tar.bz2 rails-bb207ea7b6df6101860d5de6e47ad0e0f1ea2cdf.zip |
Path::Pattern is instantiated internally, so make the contructor require a strexp object
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/journey/path/pattern.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/journey/path/pattern.rb b/actionpack/lib/action_dispatch/journey/path/pattern.rb index da9d54cf6a..c39f8e850a 100644 --- a/actionpack/lib/action_dispatch/journey/path/pattern.rb +++ b/actionpack/lib/action_dispatch/journey/path/pattern.rb @@ -1,18 +1,17 @@ +require 'action_dispatch/journey/router/strexp' + module ActionDispatch module Journey # :nodoc: module Path # :nodoc: class Pattern # :nodoc: attr_reader :spec, :requirements, :anchored - def initialize(strexp) - @anchored = true + def self.from_string string + new Journey::Router::Strexp.build(string, {}, ["/.?"], true) + end + def initialize(strexp) case strexp - when String - parser = Journey::Parser.new - @spec = parser.parse(strexp) - @requirements = {} - @separators = "/.?" when Router::Strexp @spec = strexp.ast @requirements = strexp.requirements |