提交 4a62724c 编写于 作者: S Sean Griffin

`RouteSet` should not be listed in the public API [ci skip]

The use of `# :startdoc:` inside of the class was overriding the
outer-most `# :nodoc:`, causing it to be listed in the documented API.
上级 2f904a55
...@@ -12,14 +12,15 @@ ...@@ -12,14 +12,15 @@
module ActionDispatch module ActionDispatch
module Routing module Routing
class RouteSet #:nodoc: # :stopdoc:
class RouteSet
# Since the router holds references to many parts of the system # Since the router holds references to many parts of the system
# like engines, controllers and the application itself, inspecting # like engines, controllers and the application itself, inspecting
# the route set can actually be really slow, therefore we default # the route set can actually be really slow, therefore we default
# alias inspect to to_s. # alias inspect to to_s.
alias inspect to_s alias inspect to_s
class Dispatcher < Routing::Endpoint #:nodoc: class Dispatcher < Routing::Endpoint
def initialize(defaults) def initialize(defaults)
@defaults = defaults @defaults = defaults
@controller_class_names = ThreadSafe::Cache.new @controller_class_names = ThreadSafe::Cache.new
...@@ -84,7 +85,7 @@ def merge_default_action!(params) ...@@ -84,7 +85,7 @@ def merge_default_action!(params)
# A NamedRouteCollection instance is a collection of named routes, and also # A NamedRouteCollection instance is a collection of named routes, and also
# maintains an anonymous module that can be used to install helpers for the # maintains an anonymous module that can be used to install helpers for the
# named routes. # named routes.
class NamedRouteCollection #:nodoc: class NamedRouteCollection
include Enumerable include Enumerable
attr_reader :routes, :url_helpers_module, :path_helpers_module attr_reader :routes, :url_helpers_module, :path_helpers_module
...@@ -161,7 +162,7 @@ def length ...@@ -161,7 +162,7 @@ def length
routes.length routes.length
end end
class UrlHelper # :nodoc: class UrlHelper
def self.create(route, options, route_name, url_strategy) def self.create(route, options, route_name, url_strategy)
if optimize_helper?(route) if optimize_helper?(route)
OptimizedUrlHelper.new(route, options, route_name, url_strategy) OptimizedUrlHelper.new(route, options, route_name, url_strategy)
...@@ -176,7 +177,7 @@ def self.optimize_helper?(route) ...@@ -176,7 +177,7 @@ def self.optimize_helper?(route)
attr_reader :url_strategy, :route_name attr_reader :url_strategy, :route_name
class OptimizedUrlHelper < UrlHelper # :nodoc: class OptimizedUrlHelper < UrlHelper
attr_reader :arg_size attr_reader :arg_size
def initialize(route, options, route_name, url_strategy) def initialize(route, options, route_name, url_strategy)
...@@ -300,11 +301,9 @@ def define_url_helper(mod, route, name, opts, route_key, url_strategy) ...@@ -300,11 +301,9 @@ def define_url_helper(mod, route, name, opts, route_key, url_strategy)
end end
end end
# :stopdoc:
# strategy for building urls to send to the client # strategy for building urls to send to the client
PATH = ->(options) { ActionDispatch::Http::URL.path_for(options) } PATH = ->(options) { ActionDispatch::Http::URL.path_for(options) }
UNKNOWN = ->(options) { ActionDispatch::Http::URL.url_for(options) } UNKNOWN = ->(options) { ActionDispatch::Http::URL.url_for(options) }
# :startdoc:
attr_accessor :formatter, :set, :named_routes, :default_scope, :router attr_accessor :formatter, :set, :named_routes, :default_scope, :router
attr_accessor :disable_clear_and_finalize, :resources_path_names attr_accessor :disable_clear_and_finalize, :resources_path_names
...@@ -379,7 +378,7 @@ def dispatcher(defaults) ...@@ -379,7 +378,7 @@ def dispatcher(defaults)
Routing::RouteSet::Dispatcher.new(defaults) Routing::RouteSet::Dispatcher.new(defaults)
end end
module MountedHelpers #:nodoc: module MountedHelpers
extend ActiveSupport::Concern extend ActiveSupport::Concern
include UrlFor include UrlFor
end end
...@@ -551,7 +550,7 @@ def build_conditions(current_conditions, path_values) ...@@ -551,7 +550,7 @@ def build_conditions(current_conditions, path_values)
end end
private :build_conditions private :build_conditions
class Generator #:nodoc: class Generator
PARAMETERIZE = lambda do |name, value| PARAMETERIZE = lambda do |name, value|
if name == :controller if name == :controller
value value
...@@ -703,7 +702,7 @@ def find_script_name(options) ...@@ -703,7 +702,7 @@ def find_script_name(options)
options.delete(:script_name) || '' options.delete(:script_name) || ''
end end
def path_for(options, route_name = nil) # :nodoc: def path_for(options, route_name = nil)
url_for(options, route_name, PATH) url_for(options, route_name, PATH)
end end
...@@ -789,5 +788,6 @@ def recognize_path(path, environment = {}) ...@@ -789,5 +788,6 @@ def recognize_path(path, environment = {})
raise ActionController::RoutingError, "No route matches #{path.inspect}" raise ActionController::RoutingError, "No route matches #{path.inspect}"
end end
end end
# :startdoc:
end end
end end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册