Fix typos [ci-skip]

This commit is contained in:
Jonathan Hefner 2022-02-13 15:42:34 -06:00
parent 8bbe91d2f4
commit 5fdbd217d1
45 changed files with 60 additions and 56 deletions

View File

@ -18,7 +18,7 @@ module ActionCable
end
end
# Delegates to the class' <tt>channel_name</tt>
# Delegates to the class's <tt>channel_name</tt>.
delegate :channel_name, to: :class
end
end

View File

@ -151,12 +151,12 @@ module AbstractController
process_action(action_name, *args)
end
# Delegates to the class' ::controller_path
# Delegates to the class's ::controller_path.
def controller_path
self.class.controller_path
end
# Delegates to the class' ::action_methods
# Delegates to the class's ::action_methods.
def action_methods
self.class.action_methods
end

View File

@ -137,7 +137,7 @@ module ActionController
false
end
# Delegates to the class' <tt>controller_name</tt>.
# Delegates to the class's <tt>controller_name</tt>.
def controller_name
self.class.controller_name
end

View File

@ -268,7 +268,7 @@ module ActionController
# expires_in 3.hours, public: true, stale_while_revalidate: 60.seconds, stale_if_error: 5.minutes
#
# HTTP Cache-Control Extensions other values: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
# Any additional key-value pairs are concatenated onto the `Cache-Control` header in the response:
# Any additional key-value pairs are concatenated onto the Cache-Control header in the response:
#
# expires_in 3.hours, public: true, "s-maxage": 3.hours, "no-transform": true
#

View File

@ -185,18 +185,18 @@ module ActionController
authenticate_with_http_digest(realm, &password_procedure) || request_http_digest_authentication(realm, message)
end
# Authenticate with HTTP Digest, returns true or false
# Authenticate with HTTP \Digest. Returns true or false.
def authenticate_with_http_digest(realm = "Application", &password_procedure)
HttpAuthentication::Digest.authenticate(request, realm, &password_procedure)
end
# Render output including the HTTP Digest authentication header
# Render output including the HTTP \Digest authentication header.
def request_http_digest_authentication(realm = "Application", message = nil)
HttpAuthentication::Digest.authentication_request(self, realm, message)
end
end
# Returns false on a valid response, true otherwise
# Returns false on a valid response, true otherwise.
def authenticate(request, realm, &password_procedure)
request.authorization && validate_digest_response(request, realm, &password_procedure)
end
@ -469,7 +469,7 @@ module ActionController
rewrite_param_values params_array_from raw_params auth
end
# Takes raw_params and turns it into an array of parameters
# Takes raw_params and turns it into an array of parameters.
def params_array_from(raw_params)
raw_params.map { |param| param.split %r/=(.+)?/ }
end

View File

@ -268,7 +268,7 @@ module ActionView
end
# Returns +text+ transformed into HTML using simple formatting rules.
# Two or more consecutive newlines(<tt>\n\n</tt> or <tt>\r\n\r\n</tt>) are
# Two or more consecutive newlines (<tt>\n\n</tt> or <tt>\r\n\r\n</tt>) are
# considered a paragraph and wrapped in <tt><p></tt> tags. One newline
# (<tt>\n</tt> or <tt>\r\n</tt>) is considered a linebreak and a
# <tt><br /></tt> tag is appended. This method does not remove the

View File

@ -183,7 +183,7 @@ module ActionView
# be rendered directly, without wrapping a layout around the rendered view.
#
# Both the <tt>:only</tt> and <tt>:except</tt> condition can accept an arbitrary number of method references, so
# #<tt>except: [ :rss, :text_only ]</tt> is valid, as is <tt>except: :rss</tt>.
# <tt>except: [ :rss, :text_only ]</tt> is valid, as is <tt>except: :rss</tt>.
#
# == Using a different layout in the action render call
#
@ -257,10 +257,13 @@ module ActionView
#
# Return value of +Proc+ and +Symbol+ arguments should be +String+, +false+, +true+ or +nil+
# with the same meaning as described above.
#
# ==== Parameters
#
# * <tt>layout</tt> - The layout to use.
#
# ==== Options (conditions)
#
# * :only - A list of actions to apply this layout to.
# * :except - Apply this layout to all actions but this one.
def layout(layout, conditions = {})

View File

@ -114,13 +114,13 @@ module ActiveModel
}
end
# Imports one error
# Imports one error.
# Imported errors are wrapped as a NestedError,
# providing access to original error object.
# If attribute or type needs to be overridden, use +override_options+.
#
# override_options - Hash
# @option override_options [Symbol] :attribute Override the attribute the error belongs to
# @option override_options [Symbol] :attribute Override the attribute the error belongs to.
# @option override_options [Symbol] :type Override type of the error.
def import(error, override_options = {})
[:attribute, :type].each do |key|

View File

@ -5,7 +5,7 @@ module ActiveModel
# A class that behaves like a boolean type, including rules for coercion of
# user input.
#
# - <tt>"false"</tt>, <tt>"f"</tt> , <tt>"0"</tt>, +0+ or any other value in
# - <tt>"false"</tt>, <tt>"f"</tt>, <tt>"0"</tt>, +0+ or any other value in
# +FALSE_VALUES+ will be coerced to +false+.
# - Empty strings are coerced to +nil+.
# - All other values will be coerced to +true+.

View File

@ -241,7 +241,7 @@ module ActiveModel
# class Person
# include ActiveModel::Validations
#
# attr_accessor :name , :age
# attr_accessor :name, :age
#
# validates_presence_of :name
# validates_inclusion_of :age, in: 0..99

View File

@ -24,7 +24,7 @@ module ActiveModel
#
# There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
# See <tt>ActiveModel::Validations#validates</tt> for more information
# See <tt>ActiveModel::Validations#validates</tt> for more information.
def validates_absence_of(*attr_names)
validates_with AbsenceValidator, _merge_attributes(attr_names)
end

View File

@ -112,7 +112,7 @@ module ActiveModel
end
private
# Overwrite run validations to include callbacks.
# Overwrite run_validations! to include callbacks.
def run_validations!
_run_validation_callbacks { super }
end

View File

@ -56,7 +56,7 @@ module ActiveModel
#
# There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+ .
# See <tt>ActiveModel::Validations#validates</tt> for more information
# See <tt>ActiveModel::Validations#validates</tt> for more information.
#
# The validator requires at least one of the following checks to be supplied.
# Each will accept a proc, value, or a symbol which corresponds to a method:

View File

@ -71,7 +71,7 @@ module ActiveModel
#
# There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
# See <tt>ActiveModel::Validations#validates</tt> for more information
# See <tt>ActiveModel::Validations#validates</tt> for more information.
def validates_confirmation_of(*attr_names)
validates_with ConfirmationValidator, _merge_attributes(attr_names)
end

View File

@ -40,7 +40,7 @@ module ActiveModel
#
# There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
# See <tt>ActiveModel::Validations#validates</tt> for more information
# See <tt>ActiveModel::Validations#validates</tt> for more information.
def validates_exclusion_of(*attr_names)
validates_with ExclusionValidator, _merge_attributes(attr_names)
end

View File

@ -104,7 +104,7 @@ module ActiveModel
#
# There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
# See <tt>ActiveModel::Validations#validates</tt> for more information
# See <tt>ActiveModel::Validations#validates</tt> for more information.
def validates_format_of(*attr_names)
validates_with FormatValidator, _merge_attributes(attr_names)
end

View File

@ -38,7 +38,7 @@ module ActiveModel
#
# There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
# See <tt>ActiveModel::Validations#validates</tt> for more information
# See <tt>ActiveModel::Validations#validates</tt> for more information.
def validates_inclusion_of(*attr_names)
validates_with InclusionValidator, _merge_attributes(attr_names)
end

View File

@ -118,7 +118,7 @@ module ActiveModel
#
# There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+ and +:strict+.
# See <tt>ActiveModel::Validations#validates</tt> for more information
# See <tt>ActiveModel::Validations#validates</tt> for more information.
def validates_length_of(*attr_names)
validates_with LengthValidator, _merge_attributes(attr_names)
end

View File

@ -190,7 +190,7 @@ module ActiveModel
#
# There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+ .
# See <tt>ActiveModel::Validations#validates</tt> for more information
# See <tt>ActiveModel::Validations#validates</tt> for more information.
#
# The following checks can also be supplied with a proc or a symbol which
# corresponds to a method:

View File

@ -30,7 +30,7 @@ module ActiveModel
#
# There is also a list of default options supported by every validator:
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
# See <tt>ActiveModel::Validations#validates</tt> for more information
# See <tt>ActiveModel::Validations#validates</tt> for more information.
def validates_presence_of(*attr_names)
validates_with PresenceValidator, _merge_attributes(attr_names)
end

View File

@ -180,7 +180,7 @@ module ActiveRecord
end
# Deletes the +records+ and removes them from this association calling
# +before_remove+ , +after_remove+ , +before_destroy+ and +after_destroy+ callbacks.
# +before_remove+, +after_remove+, +before_destroy+ and +after_destroy+ callbacks.
#
# Note that this method removes records from the database ignoring the
# +:dependent+ option.

View File

@ -475,7 +475,7 @@ module ActiveRecord
# Deletes the records of the collection directly from the database
# ignoring the +:dependent+ option. Records are instantiated and it
# invokes +before_remove+, +after_remove+ , +before_destroy+ and
# invokes +before_remove+, +after_remove+, +before_destroy+ and
# +after_destroy+ callbacks.
#
# class Person < ActiveRecord::Base

View File

@ -240,13 +240,13 @@ module ActiveRecord
@pool.connection_class
end
# The role (ie :writing) for the current connection. In a
# The role (e.g. +:writing+) for the current connection. In a
# non-multi role application, `:writing` is returned.
def role
@pool.role
end
# The shard (ie :default) for the current connection. In
# The shard (e.g. +:default+) for the current connection. In
# a non-sharded application, `:default` is returned.
def shard
@pool.shard

View File

@ -104,7 +104,7 @@ module ActiveRecord
##
# :singleton-method:
# PostgreSQL supports multiple types for DateTimes. By default if you use `datetime`
# PostgreSQL supports multiple types for DateTimes. By default, if you use `datetime`
# in migrations, Rails will translate this to a PostgreSQL "timestamp without time zone".
# Change this in an initializer to use another NATIVE_DATABASE_TYPES. For example, to
# store DateTimes as "timestamp with time zone":

View File

@ -108,7 +108,7 @@ module ActiveRecord
connections
end
# Connects to a role (ex writing, reading or a custom role) and/or
# Connects to a role (e.g. writing, reading or a custom role) and/or
# shard for the duration of the block. At the end of the block the
# connection will be returned to the original role / shard.
#

View File

@ -26,7 +26,7 @@ module ActiveRecord
#
# [:key_provider]
# Key provider to use for the encryption operation. It will default to
# +ActiveRecord::Encryption.key_provider+ when not provided
# +ActiveRecord::Encryption.key_provider+ when not provided.
#
# [:cipher_options]
# +Cipher+-specific options that will be passed to the Cipher configured in

View File

@ -4,9 +4,9 @@ module ActiveRecord
module Encryption
# Implements a simple envelope encryption approach where:
#
# * It generates a random data-encryption key for each encryption operation
# * It generates a random data-encryption key for each encryption operation.
# * It stores the generated key along with the encrypted payload. It encrypts this key
# with the master key provided in the credential +active_record.encryption.master key+
# with the master key provided in the credential +active_record.encryption.master key+.
#
# This provider can work with multiple master keys. It will use the last one for encrypting.
#

View File

@ -4,7 +4,7 @@ module ActiveRecord
module Encryption
# Automatically expand encrypted arguments to support querying both encrypted and unencrypted data
#
# Active Record Encryption supports querying the db using deterministic attributes. For example:
# Active Record \Encryption supports querying the db using deterministic attributes. For example:
#
# Contact.find_by(email_address: "jorge@hey.com")
#

View File

@ -583,7 +583,7 @@ module ActiveRecord
end
# This class is used to verify that all migrations have been run before
# loading a web page if <tt>config.active_record.migration_error</tt> is set to :page_load
# loading a web page if <tt>config.active_record.migration_error</tt> is set to :page_load.
class CheckPending
def initialize(app, file_watcher: ActiveSupport::FileUpdateChecker)
@app = app

View File

@ -617,7 +617,7 @@ module ActiveRecord
"#{full_table_name_prefix}#{contained}#{undecorated_table_name(model_name)}#{full_table_name_suffix}"
else
# STI subclasses always use their superclass' table.
# STI subclasses always use their superclass's table.
base_class.table_name
end
end

View File

@ -654,7 +654,7 @@ module ActiveRecord
# for queries to actually be executed concurrently. Otherwise it defaults to
# executing them in the foreground.
#
# +load_async+ will also fallback to executing in the foreground in the test environment when transactional
# +load_async+ will also fall back to executing in the foreground in the test environment when transactional
# fixtures are enabled.
#
# If the query was actually executed in the background, the Active Record logs will show

View File

@ -162,7 +162,7 @@ module ActiveRecord
#
# users = User.includes(:address, friends: [:address, :followers])
#
# === conditions
# === Conditions
#
# If you want to add string conditions to your included models, you'll have
# to explicitly reference them. For example:

View File

@ -600,7 +600,7 @@ module ActiveSupport
end
end
class CallbackChain # :nodoc:#
class CallbackChain # :nodoc:
include Enumerable
attr_reader :name, :config

View File

@ -78,7 +78,7 @@ class Date
# date.to_time(:utc) # => 2007-11-10 00:00:00 UTC
#
# NOTE: The :local timezone is Ruby's *process* timezone, i.e. ENV['TZ'].
# If the *application's* timezone is needed, then use +in_time_zone+ instead.
# If the <b>application's</b> timezone is needed, then use +in_time_zone+ instead.
def to_time(form = :local)
raise ArgumentError, "Expected :local or :utc, got #{form.inspect}." unless [:local, :utc].include?(form)
::Time.public_send(form, year, month, day)

View File

@ -201,7 +201,7 @@ module DateAndTime
end
end
# Short-hand for months_since(3)
# Short-hand for months_since(3).
def next_quarter
months_since(3)
end

View File

@ -10,7 +10,7 @@
# of the module.
#
# Note that it can also be scoped per-fiber if Rails.application.config.active_support.isolation_level
# is set to `:fiber`
# is set to `:fiber`.
class Module
# Defines a per-thread class attribute and creates class and instance reader methods.
# The underlying per-thread class variable is set to +nil+, if it is not previously defined.
@ -21,7 +21,7 @@ class Module
#
# Current.user = "DHH"
# Current.user # => "DHH"
# Thread.new { Current.user }.values # => nil
# Thread.new { Current.user }.value # => nil
#
# The attribute name must be a valid method name in Ruby.
#

View File

@ -29,7 +29,7 @@ module ActiveSupport
#
# Additionally a +severity+ can be passed along to communicate how important the error report is.
# +severity+ can be one of +:error+, +:warning+ or +:info+. Handled errors default to the +:warning+
# severity, and unhandled ones to +error+.
# severity, and unhandled ones to +:error+.
#
# Both +handle+ and +record+ pass through the return value from the block. In the case of +handle+
# rescuing an error, a fallback can be provided. The fallback must be a callable whose result will

View File

@ -8,8 +8,8 @@ require "active_support/fork_tracker"
module ActiveSupport
# Allows you to "listen" to changes in a file system.
# The evented file updater does not hit disk when checking for updates
# instead it uses platform specific file system events to trigger a change
# The evented file updater does not hit disk when checking for updates.
# Instead, it uses platform-specific file system events to trigger a change
# in state.
#
# The file checker takes an array of files to watch or a hash specifying directories

View File

@ -59,7 +59,7 @@ module ActiveSupport
# transliterate('Jürgen', locale: :de)
# # => "Juergen"
#
# Transliteration is restricted to UTF-8, US-ASCII and GB18030 strings
# Transliteration is restricted to UTF-8, US-ASCII and GB18030 strings.
# Other encodings will raise an ArgumentError.
def transliterate(string, replacement = "?", locale: nil)
string = string.dup if string.frozen?

View File

@ -27,7 +27,7 @@ module ActiveSupport
#
# All you need to do is to ensure that your log subscriber is added to
# Rails::Subscriber, as in the second line of the code above. The test
# helpers are responsible for setting up the queue, subscriptions and
# helpers are responsible for setting up the queue and subscriptions, and
# turning colors in logs off.
#
# The messages are available in the @logger instance, which is a logger with

View File

@ -22,6 +22,7 @@ module ActiveSupport
# crypt = ActiveSupport::MessageEncryptor.new(key) # => #<ActiveSupport::MessageEncryptor ...>
# encrypted_data = crypt.encrypt_and_sign('my secret data') # => "NlFBTTMwOUV5UlA1QlNEN2xkY2d6eThYWWh..."
# crypt.decrypt_and_verify(encrypted_data) # => "my secret data"
#
# The +decrypt_and_verify+ method will raise an
# <tt>ActiveSupport::MessageEncryptor::InvalidMessage</tt> exception if the data
# provided cannot be decrypted or verified.

View File

@ -4,7 +4,7 @@ require "active_support/notifications/instrumenter"
require "active_support/notifications/fanout"
module ActiveSupport
# = Notifications
# = \Notifications
#
# <tt>ActiveSupport::Notifications</tt> provides an instrumentation API for
# Ruby.

View File

@ -22,7 +22,7 @@ module Rails
# Rails::Application::Bootstrap) and finishing initializers, after all the others
# are executed (check Rails::Application::Finisher).
#
# == Configuration
# == \Configuration
#
# Besides providing the same configuration as Rails::Engine and Rails::Railtie,
# the application object has several specific configurations, for example
@ -53,7 +53,7 @@ module Rails
# 5) Load config/environments/ENV.rb
# 6) Run config.before_initialize callbacks
# 7) Run Railtie#initializer defined by railties, engines and application.
# One by one, each engine sets up its load paths, routes and runs its config/initializers/* files.
# One by one, each engine sets up its load paths and routes, and runs its config/initializers/* files.
# 8) Custom Railtie#initializers added by railties, engines and applications are executed
# 9) Build the middleware stack and run to_prepare callbacks
# 10) Run config.before_eager_load and eager_load! if eager_load is true

View File

@ -4,14 +4,14 @@ module Rails
module ConsoleMethods
# Gets the helper methods available to the controller.
#
# This method assumes an +ApplicationController+ exists, and it extends +ActionController::Base+
# This method assumes an +ApplicationController+ exists, and that it extends +ActionController::Base+.
def helper
ApplicationController.helpers
end
# Gets a new instance of a controller object.
#
# This method assumes an +ApplicationController+ exists, and it extends +ActionController::Base+
# This method assumes an +ApplicationController+ exists, and that it extends +ActionController::Base+.
def controller
@controller ||= ApplicationController.new
end

View File

@ -31,7 +31,7 @@ module Rails
# end
#
# Then ensure that this file is loaded at the top of your <tt>config/application.rb</tt>
# (or in your +Gemfile+) and it will automatically load models, controllers and helpers
# (or in your +Gemfile+), and it will automatically load models, controllers and helpers
# inside +app+, load routes at <tt>config/routes.rb</tt>, load locales at
# <tt>config/locales/**/*</tt>, and load tasks at <tt>lib/tasks/**/*</tt>.
#
@ -457,7 +457,7 @@ module Rails
self
end
# Load Rake, railties tasks and invoke the registered hooks.
# Load Rake and railties tasks, and invoke the registered hooks.
# Check <tt>Rails::Railtie.rake_tasks</tt> for more info.
def load_tasks(app = self)
require "rake"