diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/journey/path/pattern.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/journey/path/pattern.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/journey/path/pattern.rb b/actionpack/lib/action_dispatch/journey/path/pattern.rb index 5d1680f3a7..24b90e214d 100644 --- a/actionpack/lib/action_dispatch/journey/path/pattern.rb +++ b/actionpack/lib/action_dispatch/journey/path/pattern.rb @@ -1,5 +1,3 @@ -require 'action_dispatch/journey/router/strexp' - module ActionDispatch module Journey # :nodoc: module Path # :nodoc: @@ -7,13 +5,19 @@ module ActionDispatch attr_reader :spec, :requirements, :anchored def self.from_string string - new Journey::Router::Strexp.build(string, {}, ["/.?"]), true + build(string, {}, ["/.?"], true) + end + + def self.build(path, requirements, separators, anchored) + parser = Journey::Parser.new + ast = parser.parse path + new ast, requirements, separators, anchored end - def initialize(strexp, anchored) - @spec = strexp.ast - @requirements = strexp.requirements - @separators = strexp.separators.join + def initialize(ast, requirements, separators, anchored) + @spec = ast + @requirements = requirements + @separators = separators.join @anchored = anchored @names = nil |