aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/journey/path/pattern.rb6
-rw-r--r--actionpack/lib/action_dispatch/journey/router/strexp.rb9
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb5
3 files changed, 9 insertions, 11 deletions
diff --git a/actionpack/lib/action_dispatch/journey/path/pattern.rb b/actionpack/lib/action_dispatch/journey/path/pattern.rb
index 64b48ca45f..5d1680f3a7 100644
--- a/actionpack/lib/action_dispatch/journey/path/pattern.rb
+++ b/actionpack/lib/action_dispatch/journey/path/pattern.rb
@@ -7,14 +7,14 @@ module ActionDispatch
attr_reader :spec, :requirements, :anchored
def self.from_string string
- new Journey::Router::Strexp.build(string, {}, ["/.?"], true)
+ new Journey::Router::Strexp.build(string, {}, ["/.?"]), true
end
- def initialize(strexp)
+ def initialize(strexp, anchored)
@spec = strexp.ast
@requirements = strexp.requirements
@separators = strexp.separators.join
- @anchored = strexp.anchor
+ @anchored = anchored
@names = nil
@optional_names = nil
diff --git a/actionpack/lib/action_dispatch/journey/router/strexp.rb b/actionpack/lib/action_dispatch/journey/router/strexp.rb
index 4b7738f335..53630ea87b 100644
--- a/actionpack/lib/action_dispatch/journey/router/strexp.rb
+++ b/actionpack/lib/action_dispatch/journey/router/strexp.rb
@@ -6,20 +6,19 @@ module ActionDispatch
alias :compile :new
end
- attr_reader :path, :requirements, :separators, :anchor, :ast
+ attr_reader :path, :requirements, :separators, :ast
- def self.build(path, requirements, separators, anchor = true)
+ def self.build(path, requirements, separators)
parser = Journey::Parser.new
ast = parser.parse path
- new ast, path, requirements, separators, anchor
+ new ast, path, requirements, separators
end
- def initialize(ast, path, requirements, separators, anchor = true)
+ def initialize(ast, path, requirements, separators)
@ast = ast
@path = path
@requirements = requirements
@separators = separators
- @anchor = anchor
end
end
end
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index b72031633b..0455686ec0 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -541,10 +541,9 @@ module ActionDispatch
ast,
path,
requirements,
- SEPARATORS,
- anchor)
+ SEPARATORS)
- pattern = Journey::Path::Pattern.new(strexp)
+ pattern = Journey::Path::Pattern.new(strexp, anchor)
builder = Journey::GTG::Builder.new ast