diff --git a/actionpack/lib/action_dispatch/journey/nodes/node.rb b/actionpack/lib/action_dispatch/journey/nodes/node.rb index ea0a6835e9..04503e4010 100644 --- a/actionpack/lib/action_dispatch/journey/nodes/node.rb +++ b/actionpack/lib/action_dispatch/journey/nodes/node.rb @@ -86,10 +86,6 @@ module ActionDispatch @name = -left.tr("*:", "") end - def default_regexp? - regexp == DEFAULT_EXP - end - def type; :SYMBOL; end def symbol?; true; end end diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 92bcd1fb2d..bbbc386ef5 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -136,8 +136,6 @@ module ActionDispatch # Add a constraint for wildcard route to make it non-greedy and match the # optional format part of the route by default. wildcard_options[node.name.to_sym] ||= /.+?/ - elsif node.cat? - alter_regex_for_custom_routes(node) end end @@ -211,24 +209,6 @@ module ActionDispatch private :request_method private - # Find all the symbol nodes that are adjacent to literal nodes and alter - # the regexp so that Journey will partition them into custom routes. - def alter_regex_for_custom_routes(node) - if node.left.literal? && node.right.symbol? - symbol = node.right - elsif node.left.literal? && node.right.cat? && node.right.left.symbol? - symbol = node.right.left - elsif node.left.symbol? && node.right.literal? - symbol = node.left - elsif node.left.symbol? && node.right.cat? && node.right.left.literal? - symbol = node.left - end - - if symbol - symbol.regexp = /(?:#{Regexp.union(symbol.regexp, '-')})+/ - end - end - def intern(object) object.is_a?(String) ? -object : object end diff --git a/actionpack/test/journey/nodes/symbol_test.rb b/actionpack/test/journey/nodes/symbol_test.rb index b0622ac71a..e69de29bb2 100644 --- a/actionpack/test/journey/nodes/symbol_test.rb +++ b/actionpack/test/journey/nodes/symbol_test.rb @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -require "abstract_unit" - -module ActionDispatch - module Journey - module Nodes - class TestSymbol < ActiveSupport::TestCase - def test_default_regexp? - sym = Symbol.new "foo" - assert_predicate sym, :default_regexp? - - sym.regexp = nil - assert_not_predicate sym, :default_regexp? - end - end - end - end -end