From 68d685056a6a8a6fcb7f922c161d26a54c770213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=BCtke?= Date: Thu, 6 Sep 2007 14:28:32 +0000 Subject: Remove deprecated named routes [pixeltrix] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7415 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/routing.rb | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'actionpack/lib/action_controller/routing.rb') diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 2565a6dc3c..4cf9b010ba 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -247,7 +247,7 @@ module ActionController # end # module Routing - SEPARATORS = %w( / . ? ) + SEPARATORS = %w( / ; . , ? ) HTTP_METHODS = [:get, :head, :post, :put, :delete] @@ -548,7 +548,7 @@ module ActionController end class Segment #:nodoc: - RESERVED_PCHAR = ':@&=+$,;' + RESERVED_PCHAR = ':@&=+$' UNSAFE_PCHAR = Regexp.new("[^#{URI::REGEXP::PATTERN::UNRESERVED}#{RESERVED_PCHAR}]", false, 'N').freeze attr_accessor :is_optional @@ -561,7 +561,7 @@ module ActionController def extraction_code nil end - + # Continue generating string for the prior segments. def continue_string_structure(prior_segments) if prior_segments.empty? @@ -1020,11 +1020,6 @@ module ActionController @set.add_named_route(name, path, options) end - def deprecated_named_route(name, deprecated_name, path, options = {}) - named_route(name, path, options) - @set.add_deprecated_named_route(name, deprecated_name, path, options) unless deprecated_name == name - end - # Enables the use of resources in a module by setting the name_prefix, path_prefix, and namespace for the model. # Example: # @@ -1057,7 +1052,7 @@ module ActionController class NamedRouteCollection #:nodoc: include Enumerable - attr_reader :routes, :helpers, :deprecated_named_routes + attr_reader :routes, :helpers def initialize clear! @@ -1066,7 +1061,6 @@ module ActionController def clear! @routes = {} @helpers = [] - @deprecated_named_routes = {} @module ||= Module.new @module.instance_methods.each do |selector| @@ -1080,12 +1074,6 @@ module ActionController end def get(name) - if @deprecated_named_routes.has_key?(name.to_sym) - ActiveSupport::Deprecation.warn( - "The named route \"#{name}\" uses a format that has been deprecated. " + - "You should use \"#{@deprecated_named_routes[name]}\" instead", caller - ) - end routes[name.to_sym] end @@ -1259,11 +1247,6 @@ module ActionController named_routes[name.to_sym] = add_route(path, options) end - def add_deprecated_named_route(name, deprecated_name, path, options = {}) - add_named_route(deprecated_name, path, options) - named_routes.deprecated_named_routes[deprecated_name.to_sym] = name - end - def options_as_params(options) # If an explicit :controller was given, always make :action explicit # too, so that action expiry works as expected for things like -- cgit v1.2.3