Standardize nodoc comments
This commit is contained in:
parent
1bf3ce896c
commit
18707ab17f
|
@ -25,7 +25,7 @@ module ActionCable
|
||||||
serialize_broadcasting([ channel_name, model ])
|
serialize_broadcasting([ channel_name, model ])
|
||||||
end
|
end
|
||||||
|
|
||||||
def serialize_broadcasting(object) #:nodoc:
|
def serialize_broadcasting(object) # :nodoc:
|
||||||
case
|
case
|
||||||
when object.is_a?(Array)
|
when object.is_a?(Array)
|
||||||
object.map { |m| serialize_broadcasting(m) }.join(":")
|
object.map { |m| serialize_broadcasting(m) }.join(":")
|
||||||
|
|
|
@ -68,7 +68,7 @@ module ActionCable
|
||||||
|
|
||||||
# Called by the server when a new WebSocket connection is established. This configures the callbacks intended for overwriting by the user.
|
# Called by the server when a new WebSocket connection is established. This configures the callbacks intended for overwriting by the user.
|
||||||
# This method should not be called directly -- instead rely upon on the #connect (and #disconnect) callbacks.
|
# This method should not be called directly -- instead rely upon on the #connect (and #disconnect) callbacks.
|
||||||
def process #:nodoc:
|
def process # :nodoc:
|
||||||
logger.info started_request_message
|
logger.info started_request_message
|
||||||
|
|
||||||
if websocket.possible? && allow_request_origin?
|
if websocket.possible? && allow_request_origin?
|
||||||
|
@ -80,11 +80,11 @@ module ActionCable
|
||||||
|
|
||||||
# Decodes WebSocket messages and dispatches them to subscribed channels.
|
# Decodes WebSocket messages and dispatches them to subscribed channels.
|
||||||
# WebSocket message transfer encoding is always JSON.
|
# WebSocket message transfer encoding is always JSON.
|
||||||
def receive(websocket_message) #:nodoc:
|
def receive(websocket_message) # :nodoc:
|
||||||
send_async :dispatch_websocket_message, websocket_message
|
send_async :dispatch_websocket_message, websocket_message
|
||||||
end
|
end
|
||||||
|
|
||||||
def dispatch_websocket_message(websocket_message) #:nodoc:
|
def dispatch_websocket_message(websocket_message) # :nodoc:
|
||||||
if websocket.alive?
|
if websocket.alive?
|
||||||
subscriptions.execute_command decode(websocket_message)
|
subscriptions.execute_command decode(websocket_message)
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionMailbox
|
module ActionMailbox
|
||||||
class Record < ActiveRecord::Base #:nodoc:
|
class Record < ActiveRecord::Base # :nodoc:
|
||||||
self.abstract_class = true
|
self.abstract_class = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -77,7 +77,7 @@ module ActionMailbox
|
||||||
@inbound_email = inbound_email
|
@inbound_email = inbound_email
|
||||||
end
|
end
|
||||||
|
|
||||||
def perform_processing #:nodoc:
|
def perform_processing # :nodoc:
|
||||||
track_status_of_inbound_email do
|
track_status_of_inbound_email do
|
||||||
run_callbacks :process do
|
run_callbacks :process do
|
||||||
process
|
process
|
||||||
|
@ -92,7 +92,7 @@ module ActionMailbox
|
||||||
# Overwrite in subclasses
|
# Overwrite in subclasses
|
||||||
end
|
end
|
||||||
|
|
||||||
def finished_processing? #:nodoc:
|
def finished_processing? # :nodoc:
|
||||||
inbound_email.delivered? || inbound_email.bounced?
|
inbound_email.delivered? || inbound_email.bounced?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -555,7 +555,7 @@ module ActionMailer
|
||||||
# through a callback when you call <tt>:deliver</tt> on the <tt>Mail::Message</tt>,
|
# through a callback when you call <tt>:deliver</tt> on the <tt>Mail::Message</tt>,
|
||||||
# calling +deliver_mail+ directly and passing a <tt>Mail::Message</tt> will do
|
# calling +deliver_mail+ directly and passing a <tt>Mail::Message</tt> will do
|
||||||
# nothing except tell the logger you sent the email.
|
# nothing except tell the logger you sent the email.
|
||||||
def deliver_mail(mail) #:nodoc:
|
def deliver_mail(mail) # :nodoc:
|
||||||
ActiveSupport::Notifications.instrument("deliver.action_mailer") do |payload|
|
ActiveSupport::Notifications.instrument("deliver.action_mailer") do |payload|
|
||||||
set_payload_for_mail(payload, mail)
|
set_payload_for_mail(payload, mail)
|
||||||
yield # Let Mail do the delivery actions
|
yield # Let Mail do the delivery actions
|
||||||
|
@ -606,7 +606,7 @@ module ActionMailer
|
||||||
@_message = Mail.new
|
@_message = Mail.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def process(method_name, *args) #:nodoc:
|
def process(method_name, *args) # :nodoc:
|
||||||
payload = {
|
payload = {
|
||||||
mailer: self.class.name,
|
mailer: self.class.name,
|
||||||
action: method_name,
|
action: method_name,
|
||||||
|
@ -619,7 +619,7 @@ module ActionMailer
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class NullMail #:nodoc:
|
class NullMail # :nodoc:
|
||||||
def body; "" end
|
def body; "" end
|
||||||
def header; {} end
|
def header; {} end
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ module ActionMailer
|
||||||
MSG
|
MSG
|
||||||
end
|
end
|
||||||
|
|
||||||
def perform(mailer, mail_method, delivery_method, *args) #:nodoc:
|
def perform(mailer, mail_method, delivery_method, *args) # :nodoc:
|
||||||
mailer.constantize.public_send(mail_method, *args).send(delivery_method)
|
mailer.constantize.public_send(mail_method, *args).send(delivery_method)
|
||||||
end
|
end
|
||||||
ruby2_keywords(:perform)
|
ruby2_keywords(:perform)
|
||||||
|
|
|
@ -17,15 +17,15 @@ module ActionMailer
|
||||||
|
|
||||||
include Base64
|
include Base64
|
||||||
|
|
||||||
def self.previewing_email(message) #:nodoc:
|
def self.previewing_email(message) # :nodoc:
|
||||||
new(message).transform!
|
new(message).transform!
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(message) #:nodoc:
|
def initialize(message) # :nodoc:
|
||||||
@message = message
|
@message = message
|
||||||
end
|
end
|
||||||
|
|
||||||
def transform! #:nodoc:
|
def transform! # :nodoc:
|
||||||
return message if html_part.blank?
|
return message if html_part.blank?
|
||||||
|
|
||||||
html_part.body = html_part.decoded.gsub(PATTERN) do |match|
|
html_part.body = html_part.decoded.gsub(PATTERN) do |match|
|
||||||
|
|
|
@ -15,7 +15,7 @@ module ActionMailer
|
||||||
# Notifier.welcome(User.first).deliver_later # enqueue email delivery as a job through Active Job
|
# Notifier.welcome(User.first).deliver_later # enqueue email delivery as a job through Active Job
|
||||||
# Notifier.welcome(User.first).message # a Mail::Message object
|
# Notifier.welcome(User.first).message # a Mail::Message object
|
||||||
class MessageDelivery < Delegator
|
class MessageDelivery < Delegator
|
||||||
def initialize(mailer_class, action, *args) #:nodoc:
|
def initialize(mailer_class, action, *args) # :nodoc:
|
||||||
@mailer_class, @action, @args = mailer_class, action, args
|
@mailer_class, @action, @args = mailer_class, action, args
|
||||||
|
|
||||||
# The mail is only processed if we try to call any methods on it.
|
# The mail is only processed if we try to call any methods on it.
|
||||||
|
@ -26,12 +26,12 @@ module ActionMailer
|
||||||
ruby2_keywords(:initialize)
|
ruby2_keywords(:initialize)
|
||||||
|
|
||||||
# Method calls are delegated to the Mail::Message that's ready to deliver.
|
# Method calls are delegated to the Mail::Message that's ready to deliver.
|
||||||
def __getobj__ #:nodoc:
|
def __getobj__ # :nodoc:
|
||||||
@mail_message ||= processed_mailer.message
|
@mail_message ||= processed_mailer.message
|
||||||
end
|
end
|
||||||
|
|
||||||
# Unused except for delegator internals (dup, marshalling).
|
# Unused except for delegator internals (dup, marshalling).
|
||||||
def __setobj__(mail_message) #:nodoc:
|
def __setobj__(mail_message) # :nodoc:
|
||||||
@mail_message = mail_message
|
@mail_message = mail_message
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require "active_support/descendants_tracker"
|
require "active_support/descendants_tracker"
|
||||||
|
|
||||||
module ActionMailer
|
module ActionMailer
|
||||||
module Previews #:nodoc:
|
module Previews # :nodoc:
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
included do
|
included do
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionMailer #:nodoc:
|
module ActionMailer # :nodoc:
|
||||||
# Provides +rescue_from+ for mailers. Wraps mailer action processing,
|
# Provides +rescue_from+ for mailers. Wraps mailer action processing,
|
||||||
# mail job processing, and mail delivery.
|
# mail job processing, and mail delivery.
|
||||||
module Rescuable
|
module Rescuable
|
||||||
|
@ -8,12 +8,12 @@ module ActionMailer #:nodoc:
|
||||||
include ActiveSupport::Rescuable
|
include ActiveSupport::Rescuable
|
||||||
|
|
||||||
class_methods do
|
class_methods do
|
||||||
def handle_exception(exception) #:nodoc:
|
def handle_exception(exception) # :nodoc:
|
||||||
rescue_with_handler(exception) || raise(exception)
|
rescue_with_handler(exception) || raise(exception)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def handle_exceptions #:nodoc:
|
def handle_exceptions # :nodoc:
|
||||||
yield
|
yield
|
||||||
rescue => exception
|
rescue => exception
|
||||||
rescue_with_handler(exception) || raise
|
rescue_with_handler(exception) || raise
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module AbstractController
|
module AbstractController
|
||||||
module AssetPaths #:nodoc:
|
module AssetPaths # :nodoc:
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
included do
|
included do
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module AbstractController
|
module AbstractController
|
||||||
class Error < StandardError #:nodoc:
|
class Error < StandardError # :nodoc:
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require "active_support/benchmarkable"
|
require "active_support/benchmarkable"
|
||||||
|
|
||||||
module AbstractController
|
module AbstractController
|
||||||
module Logger #:nodoc:
|
module Logger # :nodoc:
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
included do
|
included do
|
||||||
|
|
|
@ -11,8 +11,8 @@ module ActionController
|
||||||
# use AuthenticationMiddleware, except: [:index, :show]
|
# use AuthenticationMiddleware, except: [:index, :show]
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
class MiddlewareStack < ActionDispatch::MiddlewareStack #:nodoc:
|
class MiddlewareStack < ActionDispatch::MiddlewareStack # :nodoc:
|
||||||
class Middleware < ActionDispatch::MiddlewareStack::Middleware #:nodoc:
|
class Middleware < ActionDispatch::MiddlewareStack::Middleware # :nodoc:
|
||||||
def initialize(klass, args, actions, strategy, block)
|
def initialize(klass, args, actions, strategy, block)
|
||||||
@actions = actions
|
@actions = actions
|
||||||
@strategy = strategy
|
@strategy = strategy
|
||||||
|
@ -182,7 +182,7 @@ module ActionController
|
||||||
response_body || response.committed?
|
response_body || response.committed?
|
||||||
end
|
end
|
||||||
|
|
||||||
def dispatch(name, request, response) #:nodoc:
|
def dispatch(name, request, response) # :nodoc:
|
||||||
set_request!(request)
|
set_request!(request)
|
||||||
set_response!(response)
|
set_response!(response)
|
||||||
process(name)
|
process(name)
|
||||||
|
@ -194,12 +194,12 @@ module ActionController
|
||||||
@_response = response
|
@_response = response
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_request!(request) #:nodoc:
|
def set_request!(request) # :nodoc:
|
||||||
@_request = request
|
@_request = request
|
||||||
@_request.controller_instance = self
|
@_request.controller_instance = self
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_a #:nodoc:
|
def to_a # :nodoc:
|
||||||
response.to_a
|
response.to_a
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionController #:nodoc:
|
module ActionController # :nodoc:
|
||||||
module ContentSecurityPolicy
|
module ContentSecurityPolicy
|
||||||
# TODO: Documentation
|
# TODO: Documentation
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionController #:nodoc:
|
module ActionController # :nodoc:
|
||||||
module Cookies
|
module Cookies
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require "action_controller/metal/exceptions"
|
require "action_controller/metal/exceptions"
|
||||||
require "action_dispatch/http/content_disposition"
|
require "action_dispatch/http/content_disposition"
|
||||||
|
|
||||||
module ActionController #:nodoc:
|
module ActionController # :nodoc:
|
||||||
# Methods for sending arbitrary data and for streaming files to the browser,
|
# Methods for sending arbitrary data and for streaming files to the browser,
|
||||||
# instead of rendering.
|
# instead of rendering.
|
||||||
module DataStreaming
|
module DataStreaming
|
||||||
|
@ -11,8 +11,8 @@ module ActionController #:nodoc:
|
||||||
|
|
||||||
include ActionController::Rendering
|
include ActionController::Rendering
|
||||||
|
|
||||||
DEFAULT_SEND_FILE_TYPE = "application/octet-stream" #:nodoc:
|
DEFAULT_SEND_FILE_TYPE = "application/octet-stream" # :nodoc:
|
||||||
DEFAULT_SEND_FILE_DISPOSITION = "attachment" #:nodoc:
|
DEFAULT_SEND_FILE_DISPOSITION = "attachment" # :nodoc:
|
||||||
|
|
||||||
private
|
private
|
||||||
# Sends the file. This uses a server-appropriate method (such as X-Sendfile)
|
# Sends the file. This uses a server-appropriate method (such as X-Sendfile)
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionController
|
module ActionController
|
||||||
class ActionControllerError < StandardError #:nodoc:
|
class ActionControllerError < StandardError # :nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
class BadRequest < ActionControllerError #:nodoc:
|
class BadRequest < ActionControllerError # :nodoc:
|
||||||
def initialize(msg = nil)
|
def initialize(msg = nil)
|
||||||
super(msg)
|
super(msg)
|
||||||
set_backtrace $!.backtrace if $!
|
set_backtrace $!.backtrace if $!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class RenderError < ActionControllerError #:nodoc:
|
class RenderError < ActionControllerError # :nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
class RoutingError < ActionControllerError #:nodoc:
|
class RoutingError < ActionControllerError # :nodoc:
|
||||||
attr_reader :failures
|
attr_reader :failures
|
||||||
def initialize(message, failures = [])
|
def initialize(message, failures = [])
|
||||||
super(message)
|
super(message)
|
||||||
|
@ -22,7 +22,7 @@ module ActionController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class UrlGenerationError < ActionControllerError #:nodoc:
|
class UrlGenerationError < ActionControllerError # :nodoc:
|
||||||
attr_reader :routes, :route_name, :method_name
|
attr_reader :routes, :route_name, :method_name
|
||||||
|
|
||||||
def initialize(message, routes = nil, route_name = nil, method_name = nil)
|
def initialize(message, routes = nil, route_name = nil, method_name = nil)
|
||||||
|
@ -47,19 +47,19 @@ module ActionController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class MethodNotAllowed < ActionControllerError #:nodoc:
|
class MethodNotAllowed < ActionControllerError # :nodoc:
|
||||||
def initialize(*allowed_methods)
|
def initialize(*allowed_methods)
|
||||||
super("Only #{allowed_methods.to_sentence} requests are allowed.")
|
super("Only #{allowed_methods.to_sentence} requests are allowed.")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class NotImplemented < MethodNotAllowed #:nodoc:
|
class NotImplemented < MethodNotAllowed # :nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
class MissingFile < ActionControllerError #:nodoc:
|
class MissingFile < ActionControllerError # :nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
class SessionOverflowError < ActionControllerError #:nodoc:
|
class SessionOverflowError < ActionControllerError # :nodoc:
|
||||||
DEFAULT_MESSAGE = "Your session data is larger than the data column in which it is to be stored. You must increase the size of your data column if you intend to store large data."
|
DEFAULT_MESSAGE = "Your session data is larger than the data column in which it is to be stored. You must increase the size of your data column if you intend to store large data."
|
||||||
|
|
||||||
def initialize(message = nil)
|
def initialize(message = nil)
|
||||||
|
@ -67,10 +67,10 @@ module ActionController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class UnknownHttpMethod < ActionControllerError #:nodoc:
|
class UnknownHttpMethod < ActionControllerError # :nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
class UnknownFormat < ActionControllerError #:nodoc:
|
class UnknownFormat < ActionControllerError # :nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
# Raised when a nested respond_to is triggered and the content types of each
|
# Raised when a nested respond_to is triggered and the content types of each
|
||||||
|
@ -91,6 +91,6 @@ module ActionController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class MissingExactTemplate < UnknownFormat #:nodoc:
|
class MissingExactTemplate < UnknownFormat # :nodoc:
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionController #:nodoc:
|
module ActionController # :nodoc:
|
||||||
module Flash
|
module Flash
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ module ActionController #:nodoc:
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def action_methods #:nodoc:
|
def action_methods # :nodoc:
|
||||||
@action_methods ||= super - _flash_types.map(&:to_s).to_set
|
@action_methods ||= super - _flash_types.map(&:to_s).to_set
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -99,7 +99,7 @@ module ActionController
|
||||||
# A hook which allows other frameworks to log what happened during
|
# A hook which allows other frameworks to log what happened during
|
||||||
# controller process action. This method should return an array
|
# controller process action. This method should return an array
|
||||||
# with the messages to be added.
|
# with the messages to be added.
|
||||||
def log_process_action(payload) #:nodoc:
|
def log_process_action(payload) # :nodoc:
|
||||||
messages, view_runtime = [], payload[:view_runtime]
|
messages, view_runtime = [], payload[:view_runtime]
|
||||||
messages << ("Views: %.1fms" % view_runtime.to_f) if view_runtime
|
messages << ("Views: %.1fms" % view_runtime.to_f) if view_runtime
|
||||||
messages
|
messages
|
||||||
|
|
|
@ -124,7 +124,7 @@ module ActionController
|
||||||
class ClientDisconnected < RuntimeError
|
class ClientDisconnected < RuntimeError
|
||||||
end
|
end
|
||||||
|
|
||||||
class Buffer < ActionDispatch::Response::Buffer #:nodoc:
|
class Buffer < ActionDispatch::Response::Buffer # :nodoc:
|
||||||
include MonitorMixin
|
include MonitorMixin
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
@ -230,7 +230,7 @@ module ActionController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Response < ActionDispatch::Response #:nodoc: all
|
class Response < ActionDispatch::Response # :nodoc: all
|
||||||
private
|
private
|
||||||
def before_committed
|
def before_committed
|
||||||
super
|
super
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require "abstract_controller/collector"
|
require "abstract_controller/collector"
|
||||||
|
|
||||||
module ActionController #:nodoc:
|
module ActionController # :nodoc:
|
||||||
module MimeResponds
|
module MimeResponds
|
||||||
# Without web-service support, an action which collects the data for displaying a list of people
|
# Without web-service support, an action which collects the data for displaying a list of people
|
||||||
# might look something like this:
|
# might look something like this:
|
||||||
|
@ -289,7 +289,7 @@ module ActionController #:nodoc:
|
||||||
@format = request.negotiate_mime(@responses.keys)
|
@format = request.negotiate_mime(@responses.keys)
|
||||||
end
|
end
|
||||||
|
|
||||||
class VariantCollector #:nodoc:
|
class VariantCollector # :nodoc:
|
||||||
def initialize(variant = nil)
|
def initialize(variant = nil)
|
||||||
@variant = variant
|
@variant = variant
|
||||||
@variants = {}
|
@variants = {}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionController #:nodoc:
|
module ActionController # :nodoc:
|
||||||
# HTTP Permissions Policy is a web standard for defining a mechanism to
|
# HTTP Permissions Policy is a web standard for defining a mechanism to
|
||||||
# allow and deny the use of browser permissions in its own context, and
|
# allow and deny the use of browser permissions in its own context, and
|
||||||
# in content within any <iframe> elements in the document.
|
# in content within any <iframe> elements in the document.
|
||||||
|
|
|
@ -123,7 +123,7 @@ module ActionController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def _compute_redirect_to_location(request, options) #:nodoc:
|
def _compute_redirect_to_location(request, options) # :nodoc:
|
||||||
case options
|
case options
|
||||||
# The scheme name consist of a letter followed by any combination of
|
# The scheme name consist of a letter followed by any combination of
|
||||||
# letters, digits, and the plus ("+"), period ("."), or hyphen ("-")
|
# letters, digits, and the plus ("+"), period ("."), or hyphen ("-")
|
||||||
|
|
|
@ -25,7 +25,7 @@ module ActionController
|
||||||
end
|
end
|
||||||
|
|
||||||
# Check for double render errors and set the content_type after rendering.
|
# Check for double render errors and set the content_type after rendering.
|
||||||
def render(*args) #:nodoc:
|
def render(*args) # :nodoc:
|
||||||
raise ::AbstractController::DoubleRenderError if response_body
|
raise ::AbstractController::DoubleRenderError if response_body
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
@ -48,7 +48,7 @@ module ActionController
|
||||||
|
|
||||||
private
|
private
|
||||||
# Before processing, set the request formats in current controller formats.
|
# Before processing, set the request formats in current controller formats.
|
||||||
def process_action(*) #:nodoc:
|
def process_action(*) # :nodoc:
|
||||||
self.formats = request.formats.filter_map(&:ref)
|
self.formats = request.formats.filter_map(&:ref)
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,11 +4,11 @@ require "rack/session/abstract/id"
|
||||||
require "action_controller/metal/exceptions"
|
require "action_controller/metal/exceptions"
|
||||||
require "active_support/security_utils"
|
require "active_support/security_utils"
|
||||||
|
|
||||||
module ActionController #:nodoc:
|
module ActionController # :nodoc:
|
||||||
class InvalidAuthenticityToken < ActionControllerError #:nodoc:
|
class InvalidAuthenticityToken < ActionControllerError # :nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
class InvalidCrossOriginRequest < ActionControllerError #:nodoc:
|
class InvalidCrossOriginRequest < ActionControllerError # :nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
# Controller actions are protected from Cross-Site Request Forgery (CSRF) attacks
|
# Controller actions are protected from Cross-Site Request Forgery (CSRF) attacks
|
||||||
|
@ -186,7 +186,7 @@ module ActionController #:nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
class NullSessionHash < Rack::Session::Abstract::SessionHash #:nodoc:
|
class NullSessionHash < Rack::Session::Abstract::SessionHash # :nodoc:
|
||||||
def initialize(req)
|
def initialize(req)
|
||||||
super(nil, req)
|
super(nil, req)
|
||||||
@data = {}
|
@data = {}
|
||||||
|
@ -205,7 +205,7 @@ module ActionController #:nodoc:
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class NullCookieJar < ActionDispatch::Cookies::CookieJar #:nodoc:
|
class NullCookieJar < ActionDispatch::Cookies::CookieJar # :nodoc:
|
||||||
def write(*)
|
def write(*)
|
||||||
# nothing
|
# nothing
|
||||||
end
|
end
|
||||||
|
@ -266,7 +266,7 @@ module ActionController #:nodoc:
|
||||||
protection_strategy.handle_unverified_request
|
protection_strategy.handle_unverified_request
|
||||||
end
|
end
|
||||||
|
|
||||||
def unverified_request_warning_message #:nodoc:
|
def unverified_request_warning_message # :nodoc:
|
||||||
if valid_request_origin?
|
if valid_request_origin?
|
||||||
"Can't verify CSRF token authenticity."
|
"Can't verify CSRF token authenticity."
|
||||||
else
|
else
|
||||||
|
@ -274,7 +274,7 @@ module ActionController #:nodoc:
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#:nodoc:
|
# :nodoc:
|
||||||
CROSS_ORIGIN_JAVASCRIPT_WARNING = "Security warning: an embedded " \
|
CROSS_ORIGIN_JAVASCRIPT_WARNING = "Security warning: an embedded " \
|
||||||
"<script> tag on another site requested protected JavaScript. " \
|
"<script> tag on another site requested protected JavaScript. " \
|
||||||
"If you know what you're doing, go ahead and disable forgery " \
|
"If you know what you're doing, go ahead and disable forgery " \
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionController #:nodoc:
|
module ActionController # :nodoc:
|
||||||
# This module is responsible for providing +rescue_from+ helpers
|
# This module is responsible for providing +rescue_from+ helpers
|
||||||
# to controllers and configuring when detailed exceptions must be
|
# to controllers and configuring when detailed exceptions must be
|
||||||
# shown.
|
# shown.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require "rack/chunked"
|
require "rack/chunked"
|
||||||
|
|
||||||
module ActionController #:nodoc:
|
module ActionController # :nodoc:
|
||||||
# Allows views to be streamed back to the client as they are rendered.
|
# Allows views to be streamed back to the client as they are rendered.
|
||||||
#
|
#
|
||||||
# By default, Rails renders views by first rendering the template
|
# By default, Rails renders views by first rendering the template
|
||||||
|
|
|
@ -8,7 +8,7 @@ require "action_controller/railties/helpers"
|
||||||
require "action_view/railtie"
|
require "action_view/railtie"
|
||||||
|
|
||||||
module ActionController
|
module ActionController
|
||||||
class Railtie < Rails::Railtie #:nodoc:
|
class Railtie < Rails::Railtie # :nodoc:
|
||||||
config.action_controller = ActiveSupport::OrderedOptions.new
|
config.action_controller = ActiveSupport::OrderedOptions.new
|
||||||
config.action_controller.raise_on_open_redirects = false
|
config.action_controller.raise_on_open_redirects = false
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ module ActionController
|
||||||
|
|
||||||
# ActionController::TestCase will be deprecated and moved to a gem in the future.
|
# ActionController::TestCase will be deprecated and moved to a gem in the future.
|
||||||
# Please use ActionDispatch::IntegrationTest going forward.
|
# Please use ActionDispatch::IntegrationTest going forward.
|
||||||
class TestRequest < ActionDispatch::TestRequest #:nodoc:
|
class TestRequest < ActionDispatch::TestRequest # :nodoc:
|
||||||
DEFAULT_ENV = ActionDispatch::TestRequest::DEFAULT_ENV.dup
|
DEFAULT_ENV = ActionDispatch::TestRequest::DEFAULT_ENV.dup
|
||||||
DEFAULT_ENV.delete "PATH_INFO"
|
DEFAULT_ENV.delete "PATH_INFO"
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ module ActionController
|
||||||
|
|
||||||
# Methods #destroy and #load! are overridden to avoid calling methods on the
|
# Methods #destroy and #load! are overridden to avoid calling methods on the
|
||||||
# @store object, which does not exist for the TestSession class.
|
# @store object, which does not exist for the TestSession class.
|
||||||
class TestSession < Rack::Session::Abstract::PersistedSecure::SecureSessionHash #:nodoc:
|
class TestSession < Rack::Session::Abstract::PersistedSecure::SecureSessionHash # :nodoc:
|
||||||
DEFAULT_OPTIONS = Rack::Session::Abstract::Persisted::DEFAULT_OPTIONS
|
DEFAULT_OPTIONS = Rack::Session::Abstract::Persisted::DEFAULT_OPTIONS
|
||||||
|
|
||||||
def initialize(session = {})
|
def initialize(session = {})
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require "active_support/core_ext/object/deep_dup"
|
require "active_support/core_ext/object/deep_dup"
|
||||||
|
|
||||||
module ActionDispatch #:nodoc:
|
module ActionDispatch # :nodoc:
|
||||||
class ContentSecurityPolicy
|
class ContentSecurityPolicy
|
||||||
class Middleware
|
class Middleware
|
||||||
CONTENT_TYPE = "Content-Type"
|
CONTENT_TYPE = "Content-Type"
|
||||||
|
|
|
@ -67,7 +67,7 @@ module Mime
|
||||||
@register_callbacks = []
|
@register_callbacks = []
|
||||||
|
|
||||||
# A simple helper class used in parsing the accept header.
|
# A simple helper class used in parsing the accept header.
|
||||||
class AcceptItem #:nodoc:
|
class AcceptItem # :nodoc:
|
||||||
attr_accessor :index, :name, :q
|
attr_accessor :index, :name, :q
|
||||||
alias :to_s :name
|
alias :to_s :name
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ module Mime
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class AcceptList #:nodoc:
|
class AcceptList # :nodoc:
|
||||||
def self.sort!(list)
|
def self.sort!(list)
|
||||||
list.sort!
|
list.sort!
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ module ActionDispatch
|
||||||
end
|
end
|
||||||
alias :params :parameters
|
alias :params :parameters
|
||||||
|
|
||||||
def path_parameters=(parameters) #:nodoc:
|
def path_parameters=(parameters) # :nodoc:
|
||||||
delete_header("action_dispatch.request.parameters")
|
delete_header("action_dispatch.request.parameters")
|
||||||
|
|
||||||
parameters = Request::Utils.set_binary_encoding(self, parameters, parameters[:controller], parameters[:action])
|
parameters = Request::Utils.set_binary_encoding(self, parameters, parameters[:controller], parameters[:action])
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require "active_support/core_ext/object/deep_dup"
|
require "active_support/core_ext/object/deep_dup"
|
||||||
|
|
||||||
module ActionDispatch #:nodoc:
|
module ActionDispatch # :nodoc:
|
||||||
class PermissionsPolicy
|
class PermissionsPolicy
|
||||||
class Middleware
|
class Middleware
|
||||||
CONTENT_TYPE = "Content-Type"
|
CONTENT_TYPE = "Content-Type"
|
||||||
|
|
|
@ -162,7 +162,7 @@ module ActionDispatch
|
||||||
set_header(routes.env_key, name.dup)
|
set_header(routes.env_key, name.dup)
|
||||||
end
|
end
|
||||||
|
|
||||||
def request_method=(request_method) #:nodoc:
|
def request_method=(request_method) # :nodoc:
|
||||||
if check_method(request_method)
|
if check_method(request_method)
|
||||||
@request_method = set_header("REQUEST_METHOD", request_method)
|
@request_method = set_header("REQUEST_METHOD", request_method)
|
||||||
end
|
end
|
||||||
|
@ -352,7 +352,7 @@ module ActionDispatch
|
||||||
FORM_DATA_MEDIA_TYPES.include?(media_type)
|
FORM_DATA_MEDIA_TYPES.include?(media_type)
|
||||||
end
|
end
|
||||||
|
|
||||||
def body_stream #:nodoc:
|
def body_stream # :nodoc:
|
||||||
get_header("rack.input")
|
get_header("rack.input")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ module ActionDispatch
|
||||||
session.destroy
|
session.destroy
|
||||||
end
|
end
|
||||||
|
|
||||||
def session=(session) #:nodoc:
|
def session=(session) # :nodoc:
|
||||||
Session.set self, session
|
Session.set self, session
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -336,7 +336,7 @@ module ActionDispatch # :nodoc:
|
||||||
# Avoid having to pass an open file handle as the response body.
|
# Avoid having to pass an open file handle as the response body.
|
||||||
# Rack::Sendfile will usually intercept the response and uses
|
# Rack::Sendfile will usually intercept the response and uses
|
||||||
# the path directly, so there is no reason to open the file.
|
# the path directly, so there is no reason to open the file.
|
||||||
class FileBody #:nodoc:
|
class FileBody # :nodoc:
|
||||||
attr_reader :to_path
|
attr_reader :to_path
|
||||||
|
|
||||||
def initialize(path)
|
def initialize(path)
|
||||||
|
|
|
@ -284,7 +284,7 @@ module ActionDispatch
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class CookieJar #:nodoc:
|
class CookieJar # :nodoc:
|
||||||
include Enumerable, ChainedCookieJars
|
include Enumerable, ChainedCookieJars
|
||||||
|
|
||||||
# This regular expression is used to split the levels of a domain.
|
# This regular expression is used to split the levels of a domain.
|
||||||
|
|
|
@ -77,7 +77,7 @@ module ActionDispatch
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class FlashNow #:nodoc:
|
class FlashNow # :nodoc:
|
||||||
attr_accessor :flash
|
attr_accessor :flash
|
||||||
|
|
||||||
def initialize(flash)
|
def initialize(flash)
|
||||||
|
@ -109,7 +109,7 @@ module ActionDispatch
|
||||||
class FlashHash
|
class FlashHash
|
||||||
include Enumerable
|
include Enumerable
|
||||||
|
|
||||||
def self.from_session_value(value) #:nodoc:
|
def self.from_session_value(value) # :nodoc:
|
||||||
case value
|
case value
|
||||||
when FlashHash # Rails 3.1, 3.2
|
when FlashHash # Rails 3.1, 3.2
|
||||||
flashes = value.instance_variable_get(:@flashes)
|
flashes = value.instance_variable_get(:@flashes)
|
||||||
|
@ -130,13 +130,13 @@ module ActionDispatch
|
||||||
|
|
||||||
# Builds a hash containing the flashes to keep for the next request.
|
# Builds a hash containing the flashes to keep for the next request.
|
||||||
# If there are none to keep, returns +nil+.
|
# If there are none to keep, returns +nil+.
|
||||||
def to_session_value #:nodoc:
|
def to_session_value # :nodoc:
|
||||||
flashes_to_keep = @flashes.except(*@discard)
|
flashes_to_keep = @flashes.except(*@discard)
|
||||||
return nil if flashes_to_keep.empty?
|
return nil if flashes_to_keep.empty?
|
||||||
{ "discard" => [], "flashes" => flashes_to_keep }
|
{ "discard" => [], "flashes" => flashes_to_keep }
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(flashes = {}, discard = []) #:nodoc:
|
def initialize(flashes = {}, discard = []) # :nodoc:
|
||||||
@discard = Set.new(stringify_array(discard))
|
@discard = Set.new(stringify_array(discard))
|
||||||
@flashes = flashes.stringify_keys
|
@flashes = flashes.stringify_keys
|
||||||
@now = nil
|
@now = nil
|
||||||
|
@ -160,7 +160,7 @@ module ActionDispatch
|
||||||
@flashes[k.to_s]
|
@flashes[k.to_s]
|
||||||
end
|
end
|
||||||
|
|
||||||
def update(h) #:nodoc:
|
def update(h) # :nodoc:
|
||||||
@discard.subtract stringify_array(h.keys)
|
@discard.subtract stringify_array(h.keys)
|
||||||
@flashes.update h.stringify_keys
|
@flashes.update h.stringify_keys
|
||||||
self
|
self
|
||||||
|
@ -200,7 +200,7 @@ module ActionDispatch
|
||||||
|
|
||||||
alias :merge! :update
|
alias :merge! :update
|
||||||
|
|
||||||
def replace(h) #:nodoc:
|
def replace(h) # :nodoc:
|
||||||
@discard.clear
|
@discard.clear
|
||||||
@flashes.replace h.stringify_keys
|
@flashes.replace h.stringify_keys
|
||||||
self
|
self
|
||||||
|
@ -251,7 +251,7 @@ module ActionDispatch
|
||||||
# Mark for removal entries that were kept, and delete unkept ones.
|
# Mark for removal entries that were kept, and delete unkept ones.
|
||||||
#
|
#
|
||||||
# This method is called automatically by filters, so you generally don't need to care about it.
|
# This method is called automatically by filters, so you generally don't need to care about it.
|
||||||
def sweep #:nodoc:
|
def sweep # :nodoc:
|
||||||
@discard.each { |k| @flashes.delete k }
|
@discard.each { |k| @flashes.delete k }
|
||||||
@discard.replace @flashes.keys
|
@discard.replace @flashes.keys
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,7 +8,7 @@ require "action_dispatch/request/session"
|
||||||
|
|
||||||
module ActionDispatch
|
module ActionDispatch
|
||||||
module Session
|
module Session
|
||||||
class SessionRestoreError < StandardError #:nodoc:
|
class SessionRestoreError < StandardError # :nodoc:
|
||||||
def initialize
|
def initialize
|
||||||
super("Session contains objects whose class definition isn't available.\n" \
|
super("Session contains objects whose class definition isn't available.\n" \
|
||||||
"Remember to require the classes for all objects kept in the session.\n" \
|
"Remember to require the classes for all objects kept in the session.\n" \
|
||||||
|
|
|
@ -42,7 +42,7 @@ module ActionDispatch
|
||||||
req.delete_header ENV_SESSION_KEY
|
req.delete_header ENV_SESSION_KEY
|
||||||
end
|
end
|
||||||
|
|
||||||
class Options #:nodoc:
|
class Options # :nodoc:
|
||||||
def self.set(req, options)
|
def self.set(req, options)
|
||||||
req.set_header ENV_SESSION_OPTIONS_KEY, options
|
req.set_header ENV_SESSION_OPTIONS_KEY, options
|
||||||
end
|
end
|
||||||
|
|
|
@ -255,7 +255,7 @@ module ActionDispatch
|
||||||
autoload :UrlFor
|
autoload :UrlFor
|
||||||
autoload :PolymorphicRoutes
|
autoload :PolymorphicRoutes
|
||||||
|
|
||||||
SEPARATORS = %w( / . ? ) #:nodoc:
|
SEPARATORS = %w( / . ? ) # :nodoc:
|
||||||
HTTP_METHODS = [:get, :head, :post, :patch, :put, :delete, :options] #:nodoc:
|
HTTP_METHODS = [:get, :head, :post, :patch, :put, :delete, :options] # :nodoc:
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,7 +12,7 @@ module ActionDispatch
|
||||||
class Mapper
|
class Mapper
|
||||||
URL_OPTIONS = [:protocol, :subdomain, :domain, :host, :port]
|
URL_OPTIONS = [:protocol, :subdomain, :domain, :host, :port]
|
||||||
|
|
||||||
class Constraints < Routing::Endpoint #:nodoc:
|
class Constraints < Routing::Endpoint # :nodoc:
|
||||||
attr_reader :app, :constraints
|
attr_reader :app, :constraints
|
||||||
|
|
||||||
SERVE = ->(app, req) { app.serve req }
|
SERVE = ->(app, req) { app.serve req }
|
||||||
|
@ -66,7 +66,7 @@ module ActionDispatch
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Mapping #:nodoc:
|
class Mapping # :nodoc:
|
||||||
ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
|
ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
|
||||||
OPTIONAL_FORMAT_REGEX = %r{(?:\(\.:format\)+|\.:format|/)\Z}
|
OPTIONAL_FORMAT_REGEX = %r{(?:\(\.:format\)+|\.:format|/)\Z}
|
||||||
|
|
||||||
|
@ -1135,7 +1135,7 @@ module ActionDispatch
|
||||||
RESOURCE_OPTIONS = [:as, :controller, :path, :only, :except, :param, :concerns]
|
RESOURCE_OPTIONS = [:as, :controller, :path, :only, :except, :param, :concerns]
|
||||||
CANONICAL_ACTIONS = %w(index create new show update destroy)
|
CANONICAL_ACTIONS = %w(index create new show update destroy)
|
||||||
|
|
||||||
class Resource #:nodoc:
|
class Resource # :nodoc:
|
||||||
attr_reader :controller, :path, :param
|
attr_reader :controller, :path, :param
|
||||||
|
|
||||||
def initialize(entities, api_only, shallow, options = {})
|
def initialize(entities, api_only, shallow, options = {})
|
||||||
|
@ -1230,7 +1230,7 @@ module ActionDispatch
|
||||||
def singleton?; false; end
|
def singleton?; false; end
|
||||||
end
|
end
|
||||||
|
|
||||||
class SingletonResource < Resource #:nodoc:
|
class SingletonResource < Resource # :nodoc:
|
||||||
def initialize(entities, api_only, shallow, options)
|
def initialize(entities, api_only, shallow, options)
|
||||||
super
|
super
|
||||||
@as = nil
|
@as = nil
|
||||||
|
@ -2289,7 +2289,7 @@ module ActionDispatch
|
||||||
NULL = Scope.new(nil, nil)
|
NULL = Scope.new(nil, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(set) #:nodoc:
|
def initialize(set) # :nodoc:
|
||||||
@set = set
|
@set = set
|
||||||
@draw_paths = set.draw_paths
|
@draw_paths = set.draw_paths
|
||||||
@scope = Scope.new(path_names: @set.resources_path_names)
|
@scope = Scope.new(path_names: @set.resources_path_names)
|
||||||
|
|
|
@ -4,7 +4,7 @@ require "active_support/core_ext/array/extract_options"
|
||||||
|
|
||||||
module ActionDispatch
|
module ActionDispatch
|
||||||
module Routing
|
module Routing
|
||||||
class RoutesProxy #:nodoc:
|
class RoutesProxy # :nodoc:
|
||||||
include ActionDispatch::Routing::UrlFor
|
include ActionDispatch::Routing::UrlFor
|
||||||
|
|
||||||
attr_accessor :scope, :routes
|
attr_accessor :scope, :routes
|
||||||
|
|
|
@ -8,7 +8,7 @@ require "minitest"
|
||||||
require "action_dispatch/testing/request_encoder"
|
require "action_dispatch/testing/request_encoder"
|
||||||
|
|
||||||
module ActionDispatch
|
module ActionDispatch
|
||||||
module Integration #:nodoc:
|
module Integration # :nodoc:
|
||||||
module RequestHelpers
|
module RequestHelpers
|
||||||
# Performs a GET request with the given parameters. See ActionDispatch::Integration::Session#process
|
# Performs a GET request with the given parameters. See ActionDispatch::Integration::Session#process
|
||||||
# for more details.
|
# for more details.
|
||||||
|
@ -402,7 +402,7 @@ module ActionDispatch
|
||||||
|
|
||||||
# Copy the instance variables from the current session instance into the
|
# Copy the instance variables from the current session instance into the
|
||||||
# test instance.
|
# test instance.
|
||||||
def copy_session_variables! #:nodoc:
|
def copy_session_variables! # :nodoc:
|
||||||
@controller = @integration_session.controller
|
@controller = @integration_session.controller
|
||||||
@response = @integration_session.response
|
@response = @integration_session.response
|
||||||
@request = @integration_session.request
|
@request = @integration_session.request
|
||||||
|
|
|
@ -35,7 +35,7 @@ module ActionText
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_action_text_attachment(attachment, locals: {}) #:nodoc:
|
def render_action_text_attachment(attachment, locals: {}) # :nodoc:
|
||||||
options = { locals: locals, object: attachment, partial: attachment }
|
options = { locals: locals, object: attachment, partial: attachment }
|
||||||
|
|
||||||
if attachment.respond_to?(:to_attachable_partial_path)
|
if attachment.respond_to?(:to_attachable_partial_path)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionText
|
module ActionText
|
||||||
class Record < ActiveRecord::Base #:nodoc:
|
class Record < ActiveRecord::Base # :nodoc:
|
||||||
self.abstract_class = true
|
self.abstract_class = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,7 @@ require "active_support/concern"
|
||||||
require "active_support/core_ext/module/attribute_accessors_per_thread"
|
require "active_support/core_ext/module/attribute_accessors_per_thread"
|
||||||
|
|
||||||
module ActionText
|
module ActionText
|
||||||
module Rendering #:nodoc:
|
module Rendering # :nodoc:
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
included do
|
included do
|
||||||
|
|
|
@ -9,7 +9,7 @@ require "action_view/context"
|
||||||
require "action_view/template"
|
require "action_view/template"
|
||||||
require "action_view/lookup_context"
|
require "action_view/lookup_context"
|
||||||
|
|
||||||
module ActionView #:nodoc:
|
module ActionView # :nodoc:
|
||||||
# = Action View Base
|
# = Action View Base
|
||||||
#
|
#
|
||||||
# Action View templates can be written in several ways.
|
# Action View templates can be written in several ways.
|
||||||
|
@ -179,7 +179,7 @@ module ActionView #:nodoc:
|
||||||
ActionView::Resolver.caching = value
|
ActionView::Resolver.caching = value
|
||||||
end
|
end
|
||||||
|
|
||||||
def xss_safe? #:nodoc:
|
def xss_safe? # :nodoc:
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ module ActionView #:nodoc:
|
||||||
|
|
||||||
# :startdoc:
|
# :startdoc:
|
||||||
|
|
||||||
def initialize(lookup_context, assigns, controller) #:nodoc:
|
def initialize(lookup_context, assigns, controller) # :nodoc:
|
||||||
@_config = ActiveSupport::InheritableOptions.new
|
@_config = ActiveSupport::InheritableOptions.new
|
||||||
|
|
||||||
@lookup_context = lookup_context
|
@lookup_context = lookup_context
|
||||||
|
|
|
@ -18,7 +18,7 @@ module ActionView
|
||||||
# sbuf << 5
|
# sbuf << 5
|
||||||
# puts sbuf # => "hello\u0005"
|
# puts sbuf # => "hello\u0005"
|
||||||
#
|
#
|
||||||
class OutputBuffer < ActiveSupport::SafeBuffer #:nodoc:
|
class OutputBuffer < ActiveSupport::SafeBuffer # :nodoc:
|
||||||
def initialize(*)
|
def initialize(*)
|
||||||
super
|
super
|
||||||
encode!
|
encode!
|
||||||
|
@ -38,7 +38,7 @@ module ActionView
|
||||||
alias :safe_append= :safe_concat
|
alias :safe_append= :safe_concat
|
||||||
end
|
end
|
||||||
|
|
||||||
class StreamingBuffer #:nodoc:
|
class StreamingBuffer # :nodoc:
|
||||||
def initialize(block)
|
def initialize(block)
|
||||||
@block = block
|
@block = block
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require "active_support/core_ext/string/output_safety"
|
require "active_support/core_ext/string/output_safety"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
class OutputFlow #:nodoc:
|
class OutputFlow # :nodoc:
|
||||||
attr_reader :content
|
attr_reader :content
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
|
@ -27,7 +27,7 @@ module ActionView
|
||||||
alias_method :append!, :append
|
alias_method :append!, :append
|
||||||
end
|
end
|
||||||
|
|
||||||
class StreamingFlow < OutputFlow #:nodoc:
|
class StreamingFlow < OutputFlow # :nodoc:
|
||||||
def initialize(view, fiber)
|
def initialize(view, fiber)
|
||||||
@view = view
|
@view = view
|
||||||
@parent = nil
|
@parent = nil
|
||||||
|
|
|
@ -25,8 +25,8 @@ require "action_view/helpers/number_helper"
|
||||||
require "action_view/helpers/rendering_helper"
|
require "action_view/helpers/rendering_helper"
|
||||||
require "action_view/helpers/translation_helper"
|
require "action_view/helpers/translation_helper"
|
||||||
|
|
||||||
module ActionView #:nodoc:
|
module ActionView # :nodoc:
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
extend ActiveSupport::Autoload
|
extend ActiveSupport::Autoload
|
||||||
|
|
||||||
autoload :Tags
|
autoload :Tags
|
||||||
|
|
|
@ -5,7 +5,7 @@ require "active_support/core_ext/enumerable"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Active Model Helpers
|
# = Active Model Helpers
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
module ActiveModelHelper
|
module ActiveModelHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ require "action_view/helpers/tag_helper"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Asset Tag Helpers
|
# = Action View Asset Tag Helpers
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
# This module provides methods for generating HTML that links views to assets such
|
# This module provides methods for generating HTML that links views to assets such
|
||||||
# as images, JavaScripts, stylesheets, and feeds. These methods do not verify
|
# as images, JavaScripts, stylesheets, and feeds. These methods do not verify
|
||||||
# the assets exist before linking to them:
|
# the assets exist before linking to them:
|
||||||
|
|
|
@ -4,7 +4,7 @@ require "zlib"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Asset URL Helpers
|
# = Action View Asset URL Helpers
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
# This module provides methods for generating asset paths and
|
# This module provides methods for generating asset paths and
|
||||||
# URLs.
|
# URLs.
|
||||||
#
|
#
|
||||||
|
|
|
@ -4,7 +4,7 @@ require "set"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Atom Feed Helpers
|
# = Action View Atom Feed Helpers
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
module AtomFeedHelper
|
module AtomFeedHelper
|
||||||
# Adds easy defaults to writing Atom feeds with the Builder template engine (this does not work on ERB or any other
|
# Adds easy defaults to writing Atom feeds with the Builder template engine (this does not work on ERB or any other
|
||||||
# template languages).
|
# template languages).
|
||||||
|
@ -126,7 +126,7 @@ module ActionView
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class AtomBuilder #:nodoc:
|
class AtomBuilder # :nodoc:
|
||||||
XHTML_TAG_NAMES = %w(content rights title subtitle summary).to_set
|
XHTML_TAG_NAMES = %w(content rights title subtitle summary).to_set
|
||||||
|
|
||||||
def initialize(xml)
|
def initialize(xml)
|
||||||
|
@ -160,7 +160,7 @@ module ActionView
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class AtomFeedBuilder < AtomBuilder #:nodoc:
|
class AtomFeedBuilder < AtomBuilder # :nodoc:
|
||||||
def initialize(xml, view, feed_options = {})
|
def initialize(xml, view, feed_options = {})
|
||||||
@xml, @view, @feed_options = xml, view, feed_options
|
@xml, @view, @feed_options = xml, view, feed_options
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Cache Helper
|
# = Action View Cache Helper
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
module CacheHelper
|
module CacheHelper
|
||||||
# This helper exposes a method for caching fragments of a view
|
# This helper exposes a method for caching fragments of a view
|
||||||
# rather than an entire action or page. This technique is useful
|
# rather than an entire action or page. This technique is useful
|
||||||
|
|
|
@ -4,7 +4,7 @@ require "active_support/core_ext/string/output_safety"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Capture Helper
|
# = Action View Capture Helper
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
# CaptureHelper exposes methods to let you extract generated markup which
|
# CaptureHelper exposes methods to let you extract generated markup which
|
||||||
# can be used in other parts of a template or layout file.
|
# can be used in other parts of a template or layout file.
|
||||||
#
|
#
|
||||||
|
@ -198,7 +198,7 @@ module ActionView
|
||||||
|
|
||||||
# Use an alternate output buffer for the duration of the block.
|
# Use an alternate output buffer for the duration of the block.
|
||||||
# Defaults to a new empty string.
|
# Defaults to a new empty string.
|
||||||
def with_output_buffer(buf = nil) #:nodoc:
|
def with_output_buffer(buf = nil) # :nodoc:
|
||||||
unless buf
|
unless buf
|
||||||
buf = ActionView::OutputBuffer.new
|
buf = ActionView::OutputBuffer.new
|
||||||
if output_buffer && output_buffer.respond_to?(:encoding)
|
if output_buffer && output_buffer.respond_to?(:encoding)
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
require "active_support/core_ext/module/attr_internal"
|
require "active_support/core_ext/module/attr_internal"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
# This module keeps all methods and behavior in ActionView
|
# This module keeps all methods and behavior in ActionView
|
||||||
# that simply delegates to the controller.
|
# that simply delegates to the controller.
|
||||||
module ControllerHelper #:nodoc:
|
module ControllerHelper # :nodoc:
|
||||||
attr_internal :controller, :request
|
attr_internal :controller, :request
|
||||||
|
|
||||||
CONTROLLER_DELEGATES = [:request_forgery_protection_token, :params,
|
CONTROLLER_DELEGATES = [:request_forgery_protection_token, :params,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View CSP Helper
|
# = Action View CSP Helper
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
module CspHelper
|
module CspHelper
|
||||||
# Returns a meta tag "csp-nonce" with the per-session nonce value
|
# Returns a meta tag "csp-nonce" with the per-session nonce value
|
||||||
# for allowing inline <script> tags.
|
# for allowing inline <script> tags.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View CSRF Helper
|
# = Action View CSRF Helper
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
module CsrfHelper
|
module CsrfHelper
|
||||||
# Returns meta tags "csrf-param" and "csrf-token" with the name of the cross-site
|
# Returns meta tags "csrf-param" and "csrf-token" with the name of the cross-site
|
||||||
# request forgery protection parameter and token, respectively.
|
# request forgery protection parameter and token, respectively.
|
||||||
|
|
|
@ -9,7 +9,7 @@ require "active_support/core_ext/object/acts_like"
|
||||||
require "active_support/core_ext/object/with_options"
|
require "active_support/core_ext/object/with_options"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
# = Action View Date Helpers
|
# = Action View Date Helpers
|
||||||
#
|
#
|
||||||
# The Date Helper primarily creates select/option tags for different kinds of dates and times or date and time
|
# The Date Helper primarily creates select/option tags for different kinds of dates and times or date and time
|
||||||
|
@ -699,7 +699,7 @@ module ActionView
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class DateTimeSelector #:nodoc:
|
class DateTimeSelector # :nodoc:
|
||||||
include ActionView::Helpers::TagHelper
|
include ActionView::Helpers::TagHelper
|
||||||
|
|
||||||
DEFAULT_PREFIX = "date"
|
DEFAULT_PREFIX = "date"
|
||||||
|
|
|
@ -6,7 +6,7 @@ module ActionView
|
||||||
# = Action View Debug Helper
|
# = Action View Debug Helper
|
||||||
#
|
#
|
||||||
# Provides a set of methods for making it easier to debug Rails objects.
|
# Provides a set of methods for making it easier to debug Rails objects.
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
module DebugHelper
|
module DebugHelper
|
||||||
include TagHelper
|
include TagHelper
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ require "active_support/core_ext/string/inflections"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Form Helpers
|
# = Action View Form Helpers
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
# Form helpers are designed to make working with resources much easier
|
# Form helpers are designed to make working with resources much easier
|
||||||
# compared to using vanilla HTML.
|
# compared to using vanilla HTML.
|
||||||
#
|
#
|
||||||
|
@ -453,7 +453,7 @@ module ActionView
|
||||||
form_tag_with_body(html_options, output)
|
form_tag_with_body(html_options, output)
|
||||||
end
|
end
|
||||||
|
|
||||||
def apply_form_for_options!(record, object, options) #:nodoc:
|
def apply_form_for_options!(record, object, options) # :nodoc:
|
||||||
object = convert_to_model(object)
|
object = convert_to_model(object)
|
||||||
|
|
||||||
as = options[:as]
|
as = options[:as]
|
||||||
|
|
|
@ -9,7 +9,7 @@ require "action_view/helpers/text_helper"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Form Option Helpers
|
# = Action View Form Option Helpers
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
# Provides a number of methods for turning different kinds of containers into a set of option tags.
|
# Provides a number of methods for turning different kinds of containers into a set of option tags.
|
||||||
#
|
#
|
||||||
# The <tt>collection_select</tt>, <tt>select</tt> and <tt>time_zone_select</tt> methods take an <tt>options</tt> parameter, a hash:
|
# The <tt>collection_select</tt>, <tt>select</tt> and <tt>time_zone_select</tt> methods take an <tt>options</tt> parameter, a hash:
|
||||||
|
|
|
@ -8,7 +8,7 @@ require "active_support/core_ext/module/attribute_accessors"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Form Tag Helpers
|
# = Action View Form Tag Helpers
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
# Provides a number of methods for creating form tags that don't rely on an Active Record object assigned to the template like
|
# Provides a number of methods for creating form tags that don't rely on an Active Record object assigned to the template like
|
||||||
# FormHelper does. Instead, you provide the names and values manually.
|
# FormHelper does. Instead, you provide the names and values manually.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
module JavaScriptHelper
|
module JavaScriptHelper
|
||||||
JS_ESCAPE_MAP = {
|
JS_ESCAPE_MAP = {
|
||||||
"\\" => "\\\\",
|
"\\" => "\\\\",
|
||||||
|
@ -87,7 +87,7 @@ module ActionView
|
||||||
content_tag("script", javascript_cdata_section(content), html_options)
|
content_tag("script", javascript_cdata_section(content), html_options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def javascript_cdata_section(content) #:nodoc:
|
def javascript_cdata_section(content) # :nodoc:
|
||||||
"\n//#{cdata_section("\n#{content}\n//")}\n".html_safe
|
"\n//#{cdata_section("\n#{content}\n//")}\n".html_safe
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ require "active_support/number_helper"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Number Helpers
|
# = Action View Number Helpers
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
# Provides methods for converting numbers into formatted strings.
|
# Provides methods for converting numbers into formatted strings.
|
||||||
# Methods are provided for phone numbers, currency, percentage,
|
# Methods are provided for phone numbers, currency, percentage,
|
||||||
# precision, positional notation, file size and pretty printing.
|
# precision, positional notation, file size and pretty printing.
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
require "active_support/core_ext/string/output_safety"
|
require "active_support/core_ext/string/output_safety"
|
||||||
|
|
||||||
module ActionView #:nodoc:
|
module ActionView # :nodoc:
|
||||||
# = Action View Raw Output Helper
|
# = Action View Raw Output Helper
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
module OutputSafetyHelper
|
module OutputSafetyHelper
|
||||||
# This method outputs without escaping a string. Since escaping tags is
|
# This method outputs without escaping a string. Since escaping tags is
|
||||||
# now default, this can be used when you don't want Rails to automatically
|
# now default, this can be used when you don't want Rails to automatically
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
# = Action View Rendering
|
# = Action View Rendering
|
||||||
#
|
#
|
||||||
# Implements methods that allow rendering from a view context.
|
# Implements methods that allow rendering from a view context.
|
||||||
|
|
|
@ -4,7 +4,7 @@ require "rails-html-sanitizer"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Sanitize Helpers
|
# = Action View Sanitize Helpers
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
# The SanitizeHelper module provides a set of methods for scrubbing text of undesired HTML elements.
|
# The SanitizeHelper module provides a set of methods for scrubbing text of undesired HTML elements.
|
||||||
# These helper methods extend Action View making them callable within your template files.
|
# These helper methods extend Action View making them callable within your template files.
|
||||||
module SanitizeHelper
|
module SanitizeHelper
|
||||||
|
@ -121,7 +121,7 @@ module ActionView
|
||||||
self.class.link_sanitizer.sanitize(html)
|
self.class.link_sanitizer.sanitize(html)
|
||||||
end
|
end
|
||||||
|
|
||||||
module ClassMethods #:nodoc:
|
module ClassMethods # :nodoc:
|
||||||
attr_writer :full_sanitizer, :link_sanitizer, :safe_list_sanitizer
|
attr_writer :full_sanitizer, :link_sanitizer, :safe_list_sanitizer
|
||||||
|
|
||||||
def sanitizer_vendor
|
def sanitizer_vendor
|
||||||
|
|
|
@ -8,7 +8,7 @@ require "action_view/helpers/output_safety_helper"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Tag Helpers
|
# = Action View Tag Helpers
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
# Provides methods to generate HTML tags programmatically both as a modern
|
# Provides methods to generate HTML tags programmatically both as a modern
|
||||||
# HTML5 compliant builder style and legacy XHTML compliant tags.
|
# HTML5 compliant builder style and legacy XHTML compliant tags.
|
||||||
module TagHelper
|
module TagHelper
|
||||||
|
@ -41,7 +41,7 @@ module ActionView
|
||||||
PRE_CONTENT_STRINGS[:textarea] = "\n"
|
PRE_CONTENT_STRINGS[:textarea] = "\n"
|
||||||
PRE_CONTENT_STRINGS["textarea"] = "\n"
|
PRE_CONTENT_STRINGS["textarea"] = "\n"
|
||||||
|
|
||||||
class TagBuilder #:nodoc:
|
class TagBuilder # :nodoc:
|
||||||
include CaptureHelper
|
include CaptureHelper
|
||||||
include OutputSafetyHelper
|
include OutputSafetyHelper
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
module Tags #:nodoc:
|
module Tags # :nodoc:
|
||||||
extend ActiveSupport::Autoload
|
extend ActiveSupport::Autoload
|
||||||
|
|
||||||
eager_autoload do
|
eager_autoload do
|
||||||
|
|
|
@ -5,7 +5,7 @@ require "action_view/helpers/tags/checkable"
|
||||||
module ActionView
|
module ActionView
|
||||||
module Helpers
|
module Helpers
|
||||||
module Tags # :nodoc:
|
module Tags # :nodoc:
|
||||||
class CheckBox < Base #:nodoc:
|
class CheckBox < Base # :nodoc:
|
||||||
include Checkable
|
include Checkable
|
||||||
|
|
||||||
def initialize(object_name, method_name, template_object, checked_value, unchecked_value, options)
|
def initialize(object_name, method_name, template_object, checked_value, unchecked_value, options)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
module ActionView
|
module ActionView
|
||||||
module Helpers
|
module Helpers
|
||||||
module Tags # :nodoc:
|
module Tags # :nodoc:
|
||||||
class CollectionSelect < Base #:nodoc:
|
class CollectionSelect < Base # :nodoc:
|
||||||
def initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options)
|
def initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options)
|
||||||
@collection = collection
|
@collection = collection
|
||||||
@value_method = value_method
|
@value_method = value_method
|
||||||
|
|
|
@ -9,7 +9,7 @@ require "action_view/helpers/output_safety_helper"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Text Helpers
|
# = Action View Text Helpers
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
# The TextHelper module provides a set of methods for filtering, formatting
|
# The TextHelper module provides a set of methods for filtering, formatting
|
||||||
# and transforming strings, which can reduce the amount of inline Ruby code in
|
# and transforming strings, which can reduce the amount of inline Ruby code in
|
||||||
# your views. These helper methods extend Action View making them callable
|
# your views. These helper methods extend Action View making them callable
|
||||||
|
@ -407,7 +407,7 @@ module ActionView
|
||||||
cycle.reset if cycle
|
cycle.reset if cycle
|
||||||
end
|
end
|
||||||
|
|
||||||
class Cycle #:nodoc:
|
class Cycle # :nodoc:
|
||||||
attr_reader :values
|
attr_reader :values
|
||||||
|
|
||||||
def initialize(first_value, *values)
|
def initialize(first_value, *values)
|
||||||
|
|
|
@ -4,7 +4,7 @@ require "action_view/helpers/tag_helper"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Translation Helpers
|
# = Action View Translation Helpers
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
module TranslationHelper
|
module TranslationHelper
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ require "action_view/helpers/tag_helper"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View URL Helpers
|
# = Action View URL Helpers
|
||||||
module Helpers #:nodoc:
|
module Helpers # :nodoc:
|
||||||
# Provides a set of methods for making links and getting URLs that
|
# Provides a set of methods for making links and getting URLs that
|
||||||
# depend on the routing subsystem (see ActionDispatch::Routing).
|
# depend on the routing subsystem (see ActionDispatch::Routing).
|
||||||
# This allows you to use the same format for links in views
|
# This allows you to use the same format for links in views
|
||||||
|
|
|
@ -12,7 +12,7 @@ module ActionView
|
||||||
# <tt>LookupContext</tt> is also responsible for generating a key, given to
|
# <tt>LookupContext</tt> is also responsible for generating a key, given to
|
||||||
# view paths, used in the resolver cache lookup. Since this key is generated
|
# view paths, used in the resolver cache lookup. Since this key is generated
|
||||||
# only once during the request, it speeds up all cache accesses.
|
# only once during the request, it speeds up all cache accesses.
|
||||||
class LookupContext #:nodoc:
|
class LookupContext # :nodoc:
|
||||||
attr_accessor :prefixes, :rendered_format
|
attr_accessor :prefixes, :rendered_format
|
||||||
|
|
||||||
singleton_class.attr_accessor :registered_details
|
singleton_class.attr_accessor :registered_details
|
||||||
|
@ -36,7 +36,7 @@ module ActionView
|
||||||
end
|
end
|
||||||
|
|
||||||
# Holds accessors for the registered details.
|
# Holds accessors for the registered details.
|
||||||
module Accessors #:nodoc:
|
module Accessors # :nodoc:
|
||||||
DEFAULT_PROCS = {}
|
DEFAULT_PROCS = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ module ActionView
|
||||||
register_detail(:variants) { [] }
|
register_detail(:variants) { [] }
|
||||||
register_detail(:handlers) { Template::Handlers.extensions }
|
register_detail(:handlers) { Template::Handlers.extensions }
|
||||||
|
|
||||||
class DetailsKey #:nodoc:
|
class DetailsKey # :nodoc:
|
||||||
alias :eql? :equal?
|
alias :eql? :equal?
|
||||||
|
|
||||||
@details_keys = Concurrent::Map.new
|
@details_keys = Concurrent::Map.new
|
||||||
|
@ -96,7 +96,7 @@ module ActionView
|
||||||
|
|
||||||
# Calculate the details key. Remove the handlers from calculation to improve performance
|
# Calculate the details key. Remove the handlers from calculation to improve performance
|
||||||
# since the user cannot modify it explicitly.
|
# since the user cannot modify it explicitly.
|
||||||
def details_key #:nodoc:
|
def details_key # :nodoc:
|
||||||
@details_key ||= DetailsKey.details_cache_key(@details) if @cache
|
@details_key ||= DetailsKey.details_cache_key(@details) if @cache
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
module ModelNaming #:nodoc:
|
module ModelNaming # :nodoc:
|
||||||
# Converts the given object to an ActiveModel compliant one.
|
# Converts the given object to an ActiveModel compliant one.
|
||||||
def convert_to_model(object)
|
def convert_to_model(object)
|
||||||
object.respond_to?(:to_model) ? object.to_model : object
|
object.respond_to?(:to_model) ? object.to_model : object
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionView #:nodoc:
|
module ActionView # :nodoc:
|
||||||
# = Action View PathSet
|
# = Action View PathSet
|
||||||
#
|
#
|
||||||
# This class is used to store and access paths in Action View. A number of
|
# This class is used to store and access paths in Action View. A number of
|
||||||
|
@ -8,7 +8,7 @@ module ActionView #:nodoc:
|
||||||
# set and also perform operations on other +PathSet+ objects.
|
# set and also perform operations on other +PathSet+ objects.
|
||||||
#
|
#
|
||||||
# A +LookupContext+ will use a +PathSet+ to store the paths in its context.
|
# A +LookupContext+ will use a +PathSet+ to store the paths in its context.
|
||||||
class PathSet #:nodoc:
|
class PathSet # :nodoc:
|
||||||
include Enumerable
|
include Enumerable
|
||||||
|
|
||||||
attr_reader :paths
|
attr_reader :paths
|
||||||
|
|
|
@ -18,7 +18,7 @@ module ActionView
|
||||||
# renderer object of the correct type is created, and the +render+ method on
|
# renderer object of the correct type is created, and the +render+ method on
|
||||||
# that new object is called in turn. This abstracts the set up and rendering
|
# that new object is called in turn. This abstracts the set up and rendering
|
||||||
# into a separate classes for partials and templates.
|
# into a separate classes for partials and templates.
|
||||||
class AbstractRenderer #:nodoc:
|
class AbstractRenderer # :nodoc:
|
||||||
delegate :template_exists?, :any_templates?, :formats, to: :@lookup_context
|
delegate :template_exists?, :any_templates?, :formats, to: :@lookup_context
|
||||||
|
|
||||||
def initialize(lookup_context)
|
def initialize(lookup_context)
|
||||||
|
|
|
@ -44,12 +44,12 @@ module ActionView
|
||||||
end
|
end
|
||||||
|
|
||||||
# Direct access to template rendering.
|
# Direct access to template rendering.
|
||||||
def render_template(context, options) #:nodoc:
|
def render_template(context, options) # :nodoc:
|
||||||
render_template_to_object(context, options).body
|
render_template_to_object(context, options).body
|
||||||
end
|
end
|
||||||
|
|
||||||
# Direct access to partial rendering.
|
# Direct access to partial rendering.
|
||||||
def render_partial(context, options, &block) #:nodoc:
|
def render_partial(context, options, &block) # :nodoc:
|
||||||
render_partial_to_object(context, options, &block).body
|
render_partial_to_object(context, options, &block).body
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -57,11 +57,11 @@ module ActionView
|
||||||
@cache_hits ||= {}
|
@cache_hits ||= {}
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_template_to_object(context, options) #:nodoc:
|
def render_template_to_object(context, options) # :nodoc:
|
||||||
TemplateRenderer.new(@lookup_context).render(context, options)
|
TemplateRenderer.new(@lookup_context).render(context, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_partial_to_object(context, options, &block) #:nodoc:
|
def render_partial_to_object(context, options, &block) # :nodoc:
|
||||||
partial = options[:partial]
|
partial = options[:partial]
|
||||||
if String === partial
|
if String === partial
|
||||||
collection = collection_from_options(options)
|
collection = collection_from_options(options)
|
||||||
|
|
|
@ -7,11 +7,11 @@ module ActionView
|
||||||
#
|
#
|
||||||
# * Support streaming from child templates, partials and so on.
|
# * Support streaming from child templates, partials and so on.
|
||||||
# * Rack::Cache needs to support streaming bodies
|
# * Rack::Cache needs to support streaming bodies
|
||||||
class StreamingTemplateRenderer < TemplateRenderer #:nodoc:
|
class StreamingTemplateRenderer < TemplateRenderer # :nodoc:
|
||||||
# A valid Rack::Body (i.e. it responds to each).
|
# A valid Rack::Body (i.e. it responds to each).
|
||||||
# It is initialized with a block that, when called, starts
|
# It is initialized with a block that, when called, starts
|
||||||
# rendering the template.
|
# rendering the template.
|
||||||
class Body #:nodoc:
|
class Body # :nodoc:
|
||||||
def initialize(&start)
|
def initialize(&start)
|
||||||
@start = start
|
@start = start
|
||||||
end
|
end
|
||||||
|
@ -42,7 +42,7 @@ module ActionView
|
||||||
# For streaming, instead of rendering a given a template, we return a Body
|
# For streaming, instead of rendering a given a template, we return a Body
|
||||||
# object that responds to each. This object is initialized with a block
|
# object that responds to each. This object is initialized with a block
|
||||||
# that knows how to render the template.
|
# that knows how to render the template.
|
||||||
def render_template(view, template, layout_name = nil, locals = {}) #:nodoc:
|
def render_template(view, template, layout_name = nil, locals = {}) # :nodoc:
|
||||||
return [super.body] unless layout_name && template.supports_streaming?
|
return [super.body] unless layout_name && template.supports_streaming?
|
||||||
|
|
||||||
locals ||= {}
|
locals ||= {}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
class TemplateRenderer < AbstractRenderer #:nodoc:
|
class TemplateRenderer < AbstractRenderer # :nodoc:
|
||||||
def render(context, options)
|
def render(context, options)
|
||||||
@details = extract_details(options)
|
@details = extract_details(options)
|
||||||
template = determine_template(options)
|
template = determine_template(options)
|
||||||
|
|
|
@ -5,7 +5,7 @@ require "action_view/view_paths"
|
||||||
module ActionView
|
module ActionView
|
||||||
# This is a class to fix I18n global state. Whenever you provide I18n.locale during a request,
|
# This is a class to fix I18n global state. Whenever you provide I18n.locale during a request,
|
||||||
# it will trigger the lookup_context and consequently expire the cache.
|
# it will trigger the lookup_context and consequently expire the cache.
|
||||||
class I18nProxy < ::I18n::Config #:nodoc:
|
class I18nProxy < ::I18n::Config # :nodoc:
|
||||||
attr_reader :original_config, :lookup_context
|
attr_reader :original_config, :lookup_context
|
||||||
|
|
||||||
def initialize(original_config, lookup_context)
|
def initialize(original_config, lookup_context)
|
||||||
|
@ -34,7 +34,7 @@ module ActionView
|
||||||
end
|
end
|
||||||
|
|
||||||
# Overwrite process to set up I18n proxy.
|
# Overwrite process to set up I18n proxy.
|
||||||
def process(*) #:nodoc:
|
def process(*) # :nodoc:
|
||||||
old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
|
old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
|
||||||
super
|
super
|
||||||
ensure
|
ensure
|
||||||
|
|
|
@ -118,7 +118,7 @@ module ActionView
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def url_options #:nodoc:
|
def url_options # :nodoc:
|
||||||
return super unless controller.respond_to?(:url_options)
|
return super unless controller.respond_to?(:url_options)
|
||||||
controller.url_options
|
controller.url_options
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,13 +4,13 @@ require "active_support/core_ext/enumerable"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
# = Action View Errors
|
# = Action View Errors
|
||||||
class ActionViewError < StandardError #:nodoc:
|
class ActionViewError < StandardError # :nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
class EncodingError < StandardError #:nodoc:
|
class EncodingError < StandardError # :nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
class WrongEncodingError < EncodingError #:nodoc:
|
class WrongEncodingError < EncodingError # :nodoc:
|
||||||
def initialize(string, encoding)
|
def initialize(string, encoding)
|
||||||
@string, @encoding = string, encoding
|
@string, @encoding = string, encoding
|
||||||
end
|
end
|
||||||
|
@ -26,7 +26,7 @@ module ActionView
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class MissingTemplate < ActionViewError #:nodoc:
|
class MissingTemplate < ActionViewError # :nodoc:
|
||||||
attr_reader :path, :paths, :prefixes, :partial
|
attr_reader :path, :paths, :prefixes, :partial
|
||||||
|
|
||||||
def initialize(paths, path, prefixes, partial, details, *)
|
def initialize(paths, path, prefixes, partial, details, *)
|
||||||
|
@ -150,7 +150,7 @@ module ActionView
|
||||||
# The Template::Error exception is raised when the compilation or rendering of the template
|
# The Template::Error exception is raised when the compilation or rendering of the template
|
||||||
# fails. This exception then gathers a bunch of intimate details and uses it to report a
|
# fails. This exception then gathers a bunch of intimate details and uses it to report a
|
||||||
# precise exception message.
|
# precise exception message.
|
||||||
class Error < ActionViewError #:nodoc:
|
class Error < ActionViewError # :nodoc:
|
||||||
SOURCE_CODE_RADIUS = 3
|
SOURCE_CODE_RADIUS = 3
|
||||||
|
|
||||||
# Override to prevent #cause resetting during re-raise.
|
# Override to prevent #cause resetting during re-raise.
|
||||||
|
@ -229,7 +229,7 @@ module ActionView
|
||||||
|
|
||||||
TemplateError = Template::Error
|
TemplateError = Template::Error
|
||||||
|
|
||||||
class SyntaxErrorInTemplate < TemplateError #:nodoc:
|
class SyntaxErrorInTemplate < TemplateError # :nodoc:
|
||||||
def initialize(template, offending_code_string)
|
def initialize(template, offending_code_string)
|
||||||
@offending_code_string = offending_code_string
|
@offending_code_string = offending_code_string
|
||||||
super(template)
|
super(template)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionView #:nodoc:
|
module ActionView # :nodoc:
|
||||||
# = Action View Template Handlers
|
# = Action View Template Handlers
|
||||||
class Template #:nodoc:
|
class Template # :nodoc:
|
||||||
module Handlers #:nodoc:
|
module Handlers # :nodoc:
|
||||||
autoload :Raw, "action_view/template/handlers/raw"
|
autoload :Raw, "action_view/template/handlers/raw"
|
||||||
autoload :ERB, "action_view/template/handlers/erb"
|
autoload :ERB, "action_view/template/handlers/erb"
|
||||||
autoload :Html, "action_view/template/handlers/html"
|
autoload :Html, "action_view/template/handlers/html"
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionView #:nodoc:
|
module ActionView # :nodoc:
|
||||||
# = Action View HTML Template
|
# = Action View HTML Template
|
||||||
class Template #:nodoc:
|
class Template # :nodoc:
|
||||||
class HTML #:nodoc:
|
class HTML # :nodoc:
|
||||||
attr_reader :type
|
attr_reader :type
|
||||||
|
|
||||||
def initialize(string, type)
|
def initialize(string, type)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionView #:nodoc:
|
module ActionView # :nodoc:
|
||||||
class Template #:nodoc:
|
class Template # :nodoc:
|
||||||
class Inline < Template #:nodoc:
|
class Inline < Template # :nodoc:
|
||||||
# This finalizer is needed (and exactly with a proc inside another proc)
|
# This finalizer is needed (and exactly with a proc inside another proc)
|
||||||
# otherwise templates leak in development.
|
# otherwise templates leak in development.
|
||||||
Finalizer = proc do |method_name, mod| # :nodoc:
|
Finalizer = proc do |method_name, mod| # :nodoc:
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionView #:nodoc:
|
module ActionView # :nodoc:
|
||||||
# = Action View RawFile Template
|
# = Action View RawFile Template
|
||||||
class Template #:nodoc:
|
class Template # :nodoc:
|
||||||
class RawFile #:nodoc:
|
class RawFile # :nodoc:
|
||||||
attr_accessor :type, :format
|
attr_accessor :type, :format
|
||||||
|
|
||||||
def initialize(filename)
|
def initialize(filename)
|
||||||
|
|
|
@ -50,7 +50,7 @@ module ActionView
|
||||||
end
|
end
|
||||||
|
|
||||||
# Threadsafe template cache
|
# Threadsafe template cache
|
||||||
class Cache #:nodoc:
|
class Cache # :nodoc:
|
||||||
class SmallCache < Concurrent::Map
|
class SmallCache < Concurrent::Map
|
||||||
def initialize(options = {})
|
def initialize(options = {})
|
||||||
super(options.merge(initial_capacity: 2))
|
super(options.merge(initial_capacity: 2))
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActionView #:nodoc:
|
module ActionView # :nodoc:
|
||||||
# = Action View Text Template
|
# = Action View Text Template
|
||||||
class Template #:nodoc:
|
class Template # :nodoc:
|
||||||
class Text #:nodoc:
|
class Text # :nodoc:
|
||||||
attr_accessor :type
|
attr_accessor :type
|
||||||
|
|
||||||
def initialize(string)
|
def initialize(string)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require "active_support/core_ext/module/attribute_accessors"
|
require "active_support/core_ext/module/attribute_accessors"
|
||||||
|
|
||||||
module ActionView
|
module ActionView
|
||||||
class Template #:nodoc:
|
class Template # :nodoc:
|
||||||
module Types
|
module Types
|
||||||
class Type
|
class Type
|
||||||
SET = Struct.new(:symbols).new([ :html, :text, :js, :css, :xml, :json ])
|
SET = Struct.new(:symbols).new([ :html, :text, :js, :css, :xml, :json ])
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require "action_view/template/resolver"
|
require "action_view/template/resolver"
|
||||||
|
|
||||||
module ActionView #:nodoc:
|
module ActionView # :nodoc:
|
||||||
# Use FixtureResolver in your tests to simulate the presence of files on the
|
# Use FixtureResolver in your tests to simulate the presence of files on the
|
||||||
# file system. This is used internally by Rails' own test suite, and is
|
# file system. This is used internally by Rails' own test suite, and is
|
||||||
# useful for testing extensions that have no way of knowing what the file
|
# useful for testing extensions that have no way of knowing what the file
|
||||||
|
|
|
@ -7,7 +7,7 @@ module ActiveJob
|
||||||
#
|
#
|
||||||
# Wraps the original exception raised as +cause+.
|
# Wraps the original exception raised as +cause+.
|
||||||
class DeserializationError < StandardError
|
class DeserializationError < StandardError
|
||||||
def initialize #:nodoc:
|
def initialize # :nodoc:
|
||||||
super("Error while trying to deserialize arguments: #{$!.message}")
|
super("Error while trying to deserialize arguments: #{$!.message}")
|
||||||
set_backtrace $!.backtrace
|
set_backtrace $!.backtrace
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,7 +14,7 @@ require "active_job/instrumentation"
|
||||||
require "active_job/timezones"
|
require "active_job/timezones"
|
||||||
require "active_job/translation"
|
require "active_job/translation"
|
||||||
|
|
||||||
module ActiveJob #:nodoc:
|
module ActiveJob # :nodoc:
|
||||||
# = Active Job
|
# = Active Job
|
||||||
#
|
#
|
||||||
# Active Job objects can be configured to work with different backend
|
# Active Job objects can be configured to work with different backend
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActiveJob
|
module ActiveJob
|
||||||
class ConfiguredJob #:nodoc:
|
class ConfiguredJob # :nodoc:
|
||||||
def initialize(job_class, options = {})
|
def initialize(job_class, options = {})
|
||||||
@options = options
|
@options = options
|
||||||
@job_class = job_class
|
@job_class = job_class
|
||||||
|
|
|
@ -18,7 +18,7 @@ module ActiveJob
|
||||||
job_or_instantiate(...).perform_now
|
job_or_instantiate(...).perform_now
|
||||||
end
|
end
|
||||||
|
|
||||||
def execute(job_data) #:nodoc:
|
def execute(job_data) # :nodoc:
|
||||||
ActiveJob::Callbacks.run_callbacks(:execute) do
|
ActiveJob::Callbacks.run_callbacks(:execute) do
|
||||||
job = deserialize(job_data)
|
job = deserialize(job_data)
|
||||||
job.perform_now
|
job.perform_now
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ActiveJob
|
module ActiveJob
|
||||||
module Instrumentation #:nodoc:
|
module Instrumentation # :nodoc:
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
included do
|
included do
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue