Skip to content

Commit

Permalink
Merge pull request #44509 from jonathanhefner/apidocs-cross-link-docs
Browse files Browse the repository at this point in the history
Cross-link API docs [ci-skip]
  • Loading branch information
jonathanhefner committed Feb 23, 2022
2 parents 840ecf1 + a199aae commit 497ab71
Show file tree
Hide file tree
Showing 74 changed files with 156 additions and 160 deletions.
2 changes: 1 addition & 1 deletion actioncable/lib/action_cable/channel/naming.rb
Expand Up @@ -18,7 +18,7 @@ def channel_name
end
end

# Delegates to the class's <tt>channel_name</tt>.
# Delegates to the class's ::channel_name.
delegate :channel_name, to: :class
end
end
Expand Down
Expand Up @@ -3,7 +3,7 @@
module ActionCable
module Connection
# Allows the use of per-connection tags against the server logger. This wouldn't work using the traditional
# <tt>ActiveSupport::TaggedLogging</tt> enhanced Rails.logger, as that logger will reset the tags between requests.
# ActiveSupport::TaggedLogging enhanced Rails.logger, as that logger will reset the tags between requests.
# The connection is long-lived, so it needs its own set of tags for its independent duration.
class TaggedLoggerProxy
attr_reader :tags
Expand Down
2 changes: 1 addition & 1 deletion actioncable/lib/action_cable/subscription_adapter/test.rb
Expand Up @@ -7,7 +7,7 @@ module SubscriptionAdapter
# == Test adapter for Action Cable
#
# The test adapter should be used only in testing. Along with
# <tt>ActionCable::TestHelper</tt> it makes a great tool to test your Rails application.
# ActionCable::TestHelper it makes a great tool to test your Rails application.
#
# To use the test adapter set +adapter+ value to +test+ in your +config/cable.yml+ file.
#
Expand Down
6 changes: 3 additions & 3 deletions actionmailbox/lib/action_mailbox/base.rb
Expand Up @@ -27,15 +27,15 @@ module ActionMailbox
# routing :all => :backstop
# end
#
# Application mailboxes need to override the +#process+ method, which is invoked by the framework after
# Application mailboxes need to override the #process method, which is invoked by the framework after
# callbacks have been run. The callbacks available are: +before_processing+, +after_processing+, and
# +around_processing+. The primary use case is ensure certain preconditions to processing are fulfilled
# using +before_processing+ callbacks.
#
# If a precondition fails to be met, you can halt the processing using the +#bounced!+ method,
# which will silently prevent any further processing, but not actually send out any bounce notice. You
# can also pair this behavior with the invocation of an Action Mailer class responsible for sending out
# an actual bounce email. This is done using the +#bounce_with+ method, which takes the mail object returned
# an actual bounce email. This is done using the #bounce_with method, which takes the mail object returned
# by an Action Mailer method, like so:
#
# class ForwardsMailbox < ApplicationMailbox
Expand All @@ -51,7 +51,7 @@ module ActionMailbox
#
# During the processing of the inbound email, the status will be tracked. Before processing begins,
# the email will normally have the +pending+ status. Once processing begins, just before callbacks
# and the +#process+ method is called, the status is changed to +processing+. If processing is allowed to
# and the #process method is called, the status is changed to +processing+. If processing is allowed to
# complete, the status is changed to +delivered+. If a bounce is triggered, then +bounced+. If an unhandled
# exception is bubbled up, then +failed+.
#
Expand Down
2 changes: 1 addition & 1 deletion actionmailbox/lib/action_mailbox/router/route.rb
Expand Up @@ -2,7 +2,7 @@

module ActionMailbox
# Encapsulates a route, which can then be matched against an inbound_email and provide a lookup of the matching
# mailbox class. See examples for the different route addresses and how to use them in the +ActionMailbox::Base+
# mailbox class. See examples for the different route addresses and how to use them in the ActionMailbox::Base
# documentation.
class Router::Route
attr_reader :address, :mailbox_name
Expand Down
2 changes: 1 addition & 1 deletion actionmailbox/lib/action_mailbox/routing.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module ActionMailbox
# See +ActionMailbox::Base+ for how to specify routing.
# See ActionMailbox::Base for how to specify routing.
module Routing
extend ActiveSupport::Concern

Expand Down
19 changes: 9 additions & 10 deletions actionmailbox/lib/action_mailbox/test_helper.rb
Expand Up @@ -4,18 +4,18 @@

module ActionMailbox
module TestHelper
# Create an +InboundEmail+ record using an eml fixture in the format of message/rfc822
# Create an InboundEmail record using an eml fixture in the format of message/rfc822
# referenced with +fixture_name+ located in +test/fixtures/files/fixture_name+.
def create_inbound_email_from_fixture(fixture_name, status: :processing)
create_inbound_email_from_source file_fixture(fixture_name).read, status: status
end

# Creates an +InboundEmail+ by specifying through options or a block.
# Creates an InboundEmail by specifying through options or a block.
#
# ==== Options
#
# * <tt>:status</tt> - The +status+ to set for the created +InboundEmail+.
# For possible statuses, see {its documentation}[rdoc-ref:ActionMailbox::InboundEmail].
# * <tt>:status</tt> - The +status+ to set for the created InboundEmail.
# For possible statuses, see its documentation.
#
# ==== Creating a simple email
#
Expand Down Expand Up @@ -68,26 +68,25 @@ def create_inbound_email_from_mail(status: :processing, **mail_options, &block)
create_inbound_email_from_source mail.to_s, status: status
end

# Create an +InboundEmail+ using the raw rfc822 +source+ as text.
# Create an InboundEmail using the raw rfc822 +source+ as text.
def create_inbound_email_from_source(source, status: :processing)
ActionMailbox::InboundEmail.create_and_extract_message_id! source, status: status
end


# Create an +InboundEmail+ from fixture using the same arguments as +create_inbound_email_from_fixture+
# Create an InboundEmail from fixture using the same arguments as create_inbound_email_from_fixture
# and immediately route it to processing.
def receive_inbound_email_from_fixture(*args)
create_inbound_email_from_fixture(*args).tap(&:route)
end

# Create an +InboundEmail+ using the same options or block as
# {create_inbound_email_from_mail}[rdoc-ref:#create_inbound_email_from_mail],
# then immediately route it for processing.
# Create an InboundEmail using the same options or block as
# create_inbound_email_from_mail, then immediately route it for processing.
def receive_inbound_email_from_mail(**kwargs, &block)
create_inbound_email_from_mail(**kwargs, &block).tap(&:route)
end

# Create an +InboundEmail+ using the same arguments as +create_inbound_email_from_source+ and immediately route it
# Create an InboundEmail using the same arguments as create_inbound_email_from_source and immediately route it
# to processing.
def receive_inbound_email_from_source(*args)
create_inbound_email_from_source(*args).tap(&:route)
Expand Down
8 changes: 4 additions & 4 deletions actionmailer/lib/action_mailer/base.rb
Expand Up @@ -149,9 +149,9 @@ module ActionMailer
# mail = NotifierMailer.welcome(User.first) # => an ActionMailer::MessageDelivery object
# mail.deliver_now # generates and sends the email now
#
# The <tt>ActionMailer::MessageDelivery</tt> class is a wrapper around a delegate that will call
# The ActionMailer::MessageDelivery class is a wrapper around a delegate that will call
# your method to generate the mail. If you want direct access to the delegator, or <tt>Mail::Message</tt>,
# you can call the <tt>message</tt> method on the <tt>ActionMailer::MessageDelivery</tt> object.
# you can call the <tt>message</tt> method on the ActionMailer::MessageDelivery object.
#
# NotifierMailer.welcome(User.first).message # => a Mail::Message object
#
Expand Down Expand Up @@ -334,9 +334,9 @@ module ActionMailer
# end
#
# Callbacks in Action Mailer are implemented using
# <tt>AbstractController::Callbacks</tt>, so you can define and configure
# AbstractController::Callbacks, so you can define and configure
# callbacks in the same manner that you would use callbacks in classes that
# inherit from <tt>ActionController::Base</tt>.
# inherit from ActionController::Base.
#
# Note that unless you have a specific reason to do so, you should prefer
# using <tt>before_action</tt> rather than <tt>after_action</tt> in your
Expand Down
4 changes: 2 additions & 2 deletions actionmailer/lib/action_mailer/message_delivery.rb
Expand Up @@ -63,7 +63,7 @@ def processed?
# * <tt>:priority</tt> - Enqueues the email with the specified priority
#
# By default, the email will be enqueued using <tt>ActionMailer::MailDeliveryJob</tt>. Each
# <tt>ActionMailer::Base</tt> class can specify the job to use by setting the class variable
# ActionMailer::Base class can specify the job to use by setting the class variable
# +delivery_job+.
#
# class AccountRegistrationMailer < ApplicationMailer
Expand All @@ -89,7 +89,7 @@ def deliver_later!(options = {})
# * <tt>:priority</tt> - Enqueues the email with the specified priority
#
# By default, the email will be enqueued using <tt>ActionMailer::MailDeliveryJob</tt>. Each
# <tt>ActionMailer::Base</tt> class can specify the job to use by setting the class variable
# ActionMailer::Base class can specify the job to use by setting the class variable
# +delivery_job+.
#
# class AccountRegistrationMailer < ApplicationMailer
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/abstract_controller/base.rb
Expand Up @@ -177,7 +177,7 @@ def available_action?(action_name)

# Tests if a response body is set. Used to determine if the
# +process_action+ callback needs to be terminated in
# +AbstractController::Callbacks+.
# AbstractController::Callbacks.
def performed?
response_body
end
Expand Down
10 changes: 5 additions & 5 deletions actionpack/lib/action_controller/api.rb
Expand Up @@ -5,7 +5,7 @@
require "action_controller/log_subscriber"

module ActionController
# API Controller is a lightweight version of <tt>ActionController::Base</tt>,
# API Controller is a lightweight version of ActionController::Base,
# created for applications that don't require all functionalities that a complete
# \Rails controller provides, allowing you to create controllers with just the
# features that you need for API only applications.
Expand All @@ -32,7 +32,7 @@ module ActionController
# end
#
# Request, response, and parameters objects all work the exact same way as
# <tt>ActionController::Base</tt>.
# ActionController::Base.
#
# == Renders
#
Expand All @@ -51,7 +51,7 @@ module ActionController
#
# Redirects are used to move from one action to another. You can use the
# <tt>redirect_to</tt> method in your controllers in the same way as in
# <tt>ActionController::Base</tt>. For example:
# ActionController::Base. For example:
#
# def create
# redirect_to root_url and return if not_authorized?
Expand All @@ -61,7 +61,7 @@ module ActionController
# == Adding New Behavior
#
# In some scenarios you may want to add back some functionality provided by
# <tt>ActionController::Base</tt> that is not present by default in
# ActionController::Base that is not present by default in
# <tt>ActionController::API</tt>, for instance <tt>MimeResponds</tt>. This
# module gives you the <tt>respond_to</tt> method. Adding it is quite simple,
# you just need to include the module in a specific controller or in
Expand All @@ -83,7 +83,7 @@ module ActionController
# end
# end
#
# Make sure to check the modules included in <tt>ActionController::Base</tt>
# Make sure to check the modules included in ActionController::Base
# if you want to use any other functionality that is not provided
# by <tt>ActionController::API</tt> out of the box.
class API < Metal
Expand Down
4 changes: 2 additions & 2 deletions actionpack/lib/action_controller/form_builder.rb
Expand Up @@ -3,7 +3,7 @@
module ActionController
# Override the default form builder for all views rendered by this
# controller and any of its descendants. Accepts a subclass of
# +ActionView::Helpers::FormBuilder+.
# ActionView::Helpers::FormBuilder.
#
# For example, given a form builder:
#
Expand Down Expand Up @@ -36,7 +36,7 @@ module ClassMethods
# in the views rendered by this controller and its subclasses.
#
# ==== Parameters
# * <tt>builder</tt> - Default form builder, an instance of +ActionView::Helpers::FormBuilder+
# * <tt>builder</tt> - Default form builder, an instance of ActionView::Helpers::FormBuilder
def default_form_builder(builder)
self._default_form_builder = builder
end
Expand Down
6 changes: 3 additions & 3 deletions actionpack/lib/action_controller/metal.rb
Expand Up @@ -60,7 +60,7 @@ def build_middleware(klass, args, block)

# <tt>ActionController::Metal</tt> is the simplest possible controller, providing a
# valid Rack interface without the additional niceties provided by
# <tt>ActionController::Base</tt>.
# ActionController::Base.
#
# A sample metal controller might look like this:
#
Expand Down Expand Up @@ -111,7 +111,7 @@ def build_middleware(klass, args, block)
#
# == Other Helpers
#
# You can refer to the modules included in <tt>ActionController::Base</tt> to see
# You can refer to the modules included in ActionController::Base to see
# other features you can bring into your metal controller.
#
class Metal < AbstractController::Base
Expand All @@ -137,7 +137,7 @@ def self.action_encoding_template(action) # :nodoc:
false
end

# Delegates to the class's <tt>controller_name</tt>.
# Delegates to the class's ::controller_name.
def controller_name
self.class.controller_name
end
Expand Down
21 changes: 10 additions & 11 deletions actionpack/lib/action_controller/metal/renderers.rb
Expand Up @@ -31,8 +31,7 @@ module Renderers
class_attribute :_renderers, default: Set.new.freeze
end

# Used in <tt>ActionController::Base</tt>
# and <tt>ActionController::API</tt> to include all
# Used in ActionController::Base and ActionController::API to include all
# renderers by default.
module All
extend ActiveSupport::Concern
Expand All @@ -45,7 +44,7 @@ module All

# Adds a new renderer to call within controller actions.
# A renderer is invoked by passing its name as an option to
# <tt>AbstractController::Rendering#render</tt>. To create a renderer
# AbstractController::Rendering#render. To create a renderer
# pass it a name and a block. The block takes two arguments, the first
# is the value paired with its key and the second is the remaining
# hash of options passed to +render+.
Expand Down Expand Up @@ -96,18 +95,18 @@ module ClassMethods
# Adds, by name, a renderer or renderers to the +_renderers+ available
# to call within controller actions.
#
# It is useful when rendering from an <tt>ActionController::Metal</tt> controller or
# It is useful when rendering from an ActionController::Metal controller or
# otherwise to add an available renderer proc to a specific controller.
#
# Both <tt>ActionController::Base</tt> and <tt>ActionController::API</tt>
# include <tt>ActionController::Renderers::All</tt>, making all renderers
# Both ActionController::Base and ActionController::API
# include ActionController::Renderers::All, making all renderers
# available in the controller. See <tt>Renderers::RENDERERS</tt> and <tt>Renderers.add</tt>.
#
# Since <tt>ActionController::Metal</tt> controllers cannot render, the controller
# must include <tt>AbstractController::Rendering</tt>, <tt>ActionController::Rendering</tt>,
# and <tt>ActionController::Renderers</tt>, and have at least one renderer.
# Since ActionController::Metal controllers cannot render, the controller
# must include AbstractController::Rendering, ActionController::Rendering,
# and ActionController::Renderers, and have at least one renderer.
#
# Rather than including <tt>ActionController::Renderers::All</tt> and including all renderers,
# Rather than including ActionController::Renderers::All and including all renderers,
# you may specify which renderers to include by passing the renderer name or names to
# +use_renderers+. For example, a controller that includes only the <tt>:json</tt> renderer
# (+_render_with_renderer_json+) might look like:
Expand All @@ -133,7 +132,7 @@ def use_renderers(*args)
alias use_renderer use_renderers
end

# Called by +render+ in <tt>AbstractController::Rendering</tt>
# Called by +render+ in AbstractController::Rendering
# which sets the return value as the +response_body+.
#
# If no renderer is found, +super+ returns control to
Expand Down
Expand Up @@ -32,7 +32,7 @@ class InvalidCrossOriginRequest < ActionControllerError # :nodoc:
# response may be extracted. To prevent this, only XmlHttpRequest (known as XHR or
# Ajax) requests are allowed to make requests for JavaScript responses.
#
# Subclasses of <tt>ActionController::Base</tt> are protected by default with the
# Subclasses of ActionController::Base are protected by default with the
# <tt>:exception</tt> strategy, which raises an
# <tt>ActionController::InvalidAuthenticityToken</tt> error on unverified requests.
#
Expand Down
Expand Up @@ -778,7 +778,7 @@ def deep_transform_keys!(&block)

# Deletes a key-value pair from +Parameters+ and returns the value. If
# +key+ is not found, returns +nil+ (or, with optional code block, yields
# +key+ and returns the result). Cf. +#extract!+, which returns the
# +key+ and returns the result). Cf. #extract!, which returns the
# corresponding +ActionController::Parameters+ object.
def delete(key, &block)
convert_value_to_parameters(@parameters.delete(key, &block))
Expand Down
4 changes: 2 additions & 2 deletions actionpack/lib/action_controller/metal/url_for.rb
Expand Up @@ -4,10 +4,10 @@ module ActionController
# Includes +url_for+ into the host class. The class has to provide a +RouteSet+ by implementing
# the <tt>_routes</tt> method. Otherwise, an exception will be raised.
#
# In addition to <tt>AbstractController::UrlFor</tt>, this module accesses the HTTP layer to define
# In addition to AbstractController::UrlFor, this module accesses the HTTP layer to define
# URL options like the +host+. In order to do so, this module requires the host class
# to implement +env+ which needs to be Rack-compatible and +request+
# which is either an instance of +ActionDispatch::Request+ or an object
# which is either an instance of ActionDispatch::Request or an object
# that responds to the +host+, +optional_port+, +protocol+, and
# +symbolized_path_parameter+ methods.
#
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_controller/renderer.rb
Expand Up @@ -71,7 +71,7 @@ def initialize(controller, env, defaults)
# Render templates with any options from ActionController::Base#render_to_string.
#
# The primary options are:
# * <tt>:partial</tt> - See <tt>ActionView::PartialRenderer</tt> for details.
# * <tt>:partial</tt> - See ActionView::PartialRenderer for details.
# * <tt>:file</tt> - Renders an explicit template file. Add <tt>:locals</tt> to pass in, if so desired.
# It shouldn’t be used directly with unsanitized user input due to lack of validation.
# * <tt>:inline</tt> - Renders an ERB template string.
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/middleware/request_id.rb
Expand Up @@ -5,7 +5,7 @@

module ActionDispatch
# Makes a unique request id available to the +action_dispatch.request_id+ env variable (which is then accessible
# through <tt>ActionDispatch::Request#request_id</tt> or the alias <tt>ActionDispatch::Request#uuid</tt>) and sends
# through ActionDispatch::Request#request_id or the alias ActionDispatch::Request#uuid) and sends
# the same id to the client via the X-Request-Id header.
#
# The unique request id is either based on the X-Request-Id header in the request, which would typically be generated
Expand Down
5 changes: 2 additions & 3 deletions actionpack/lib/action_dispatch/routing.rb
Expand Up @@ -65,9 +65,8 @@ module ActionDispatch
# resources :posts, :comments
# end
#
# For more, see <tt>Routing::Mapper::Resources#resources</tt>,
# <tt>Routing::Mapper::Scoping#namespace</tt>, and
# <tt>Routing::Mapper::Scoping#scope</tt>.
# For more, see Routing::Mapper::Resources#resources,
# Routing::Mapper::Scoping#namespace, and Routing::Mapper::Scoping#scope.
#
# == Non-resourceful routes
#
Expand Down
2 changes: 1 addition & 1 deletion actiontext/lib/action_text/fixture_set.rb
Expand Up @@ -25,7 +25,7 @@ module ActionText
# first:
# title: An Article
#
# Then declare the <tt>ActionText::RichText</tt> fixture data in
# Then declare the ActionText::RichText fixture data in
# <tt>test/fixtures/action_text/rich_texts.yml</tt>, making sure to declare
# each entry's <tt>record:</tt> key as a polymorphic relationship:
#
Expand Down

0 comments on commit 497ab71

Please sign in to comment.