diff --git a/Rakefile b/Rakefile index 3aedf2799b..7065d7b4ed 100644 --- a/Rakefile +++ b/Rakefile @@ -6,6 +6,7 @@ require 'bundler' SOURCE_DIR = 'src' INDEX_HTML = 'files/railties/RDOC_MAIN_rdoc.html' NEW_INDEX_HTML = 'files/railties/RDOC_MAIN_md.html' +MY_SDOC_BRANCH = 'main' desc 'Generate documentation for default Rails version and build Jekyll site' task build: :switch_default_rails do @@ -64,7 +65,7 @@ def generate_rails_rdoc # Replace sdoc gem with my forked one gemfile = File.read('Gemfile') - gemfile.gsub!(/"sdoc".*$/, '"sdoc", github: "toshimaru/sdoc", branch: "main"') + gemfile.gsub!(/"sdoc".*$/, %("sdoc", github: "toshimaru/sdoc", branch: "#{MY_SDOC_BRANCH}")) File.write('Gemfile', gemfile) sh 'bundle install && bundle update sdoc' diff --git a/src/classes/AbstractController/Base.html b/src/classes/AbstractController/Base.html index 8ee3c9a150..f57451fc63 100644 --- a/src/classes/AbstractController/Base.html +++ b/src/classes/AbstractController/Base.html @@ -183,7 +183,7 @@
# File actionpack/lib/abstract_controller/base.rb, line 57
@@ -191,7 +191,7 @@
@abstract = true
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/base.rb, line 96
@@ -234,12 +234,12 @@ Returns
methods = public_instance_methods(true) - internal_methods
# Be sure to include shadowed public instance methods of this class.
methods.concat(public_instance_methods(false))
- methods.map!(&:to_s)
+ methods.map!(&:to_s)
methods.to_set
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/base.rb, line 111
@@ -274,7 +274,7 @@
@action_methods = nil
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/base.rb, line 125
def controller_path
- @controller_path ||= name.delete_suffix("Controller").underscore unless anonymous?
+ @controller_path ||= name.delete_suffix("Controller").underscore unless anonymous?
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/base.rb, line 76
@@ -364,7 +364,7 @@
controller.public_instance_methods(true) - methods
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/base.rb, line 130
@@ -400,7 +400,7 @@
clear_action_methods!
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/base.rb, line 199
@@ -435,7 +435,7 @@
true
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/base.rb, line 170
@@ -474,7 +474,7 @@
self.class.action_methods
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/base.rb, line 42
attr_internal :action_name
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/base.rb, line 184
@@ -550,7 +550,7 @@ Parameters
_find_action_name(action_name)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/base.rb, line 165
@@ -585,7 +585,7 @@
self.class.controller_path
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/base.rb, line 46
attr_internal :formats
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/base.rb, line 191
@@ -654,7 +654,7 @@
response_body
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/base.rb, line 151
@@ -696,7 +696,7 @@ Returns
@_action_name = action.to_s
unless action_name = _find_action_name(@_action_name)
- raise ActionNotFound.new("The action '#{action}' could not be found for #{self.class.name}", self, action)
+ raise ActionNotFound.new("The action '#{action}' could not be found for #{self.class.name}", self, action)
end
@_response_body = nil
@@ -704,7 +704,7 @@ Returns
process_action(action_name, *args)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/base.rb, line 38
attr_internal :response_body
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/caching.rb, line 52
def view_cache_dependencies
- self.class._view_cache_dependencies.filter_map { |dep| instance_exec(&dep) }
+ self.class._view_cache_dependencies.filter_map { |dep| instance_exec(&dep) }
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/caching.rb, line 58
- def cache(key, options = {}, &block) # :doc:
+ def cache(key, options = {}, &block) # :doc:
if cache_configured?
- cache_store.fetch(ActiveSupport::Cache.expand_cache_key(key, :controller), options, &block)
+ cache_store.fetch(ActiveSupport::Cache.expand_cache_key(key, :controller), options, &block)
else
yield
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/caching.rb, line 47
- def view_cache_dependency(&dependency)
+ def view_cache_dependency(&dependency)
self._view_cache_dependencies += [dependency]
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/caching.rb, line 13
@@ -90,7 +90,7 @@
config.cache_store
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/caching.rb, line 17
@@ -125,7 +125,7 @@
config.cache_store = ActiveSupport::Cache.lookup_store(*store)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/caching/fragments.rb, line 70
def combined_fragment_cache_key(key)
- head = self.class.fragment_cache_keys.map { |k| instance_exec(&k) }
- tail = key.is_a?(Hash) ? url_for(key).split("://").last : key
+ head = self.class.fragment_cache_keys.map { |k| instance_exec(&k) }
+ tail = key.is_a?(Hash) ? url_for(key).split("://").last : key
- cache_key = [:views, ENV["RAILS_CACHE_ID"] || ENV["RAILS_APP_VERSION"], head, tail]
+ cache_key = [:views, ENV["RAILS_CACHE_ID"] || ENV["RAILS_APP_VERSION"], head, tail]
cache_key.flatten!(1)
cache_key.compact!
cache_key
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/caching/fragments.rb, line 134
@@ -189,7 +189,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/caching/fragments.rb, line 107
@@ -229,7 +229,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/caching/fragments.rb, line 95
@@ -270,7 +270,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/caching/fragments.rb, line 82
@@ -312,7 +312,7 @@
content
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/caching/fragments.rb, line 59
- def fragment_cache_key(value = nil, &key)
- self.fragment_cache_keys += [key || -> { value }]
+ def fragment_cache_key(value = nil, &key)
+ self.fragment_cache_keys += [key || -> { value }]
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/callbacks.rb, line 119
@@ -159,7 +159,7 @@ Block Parameters
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/callbacks.rb, line 94
@@ -214,7 +214,7 @@ Options
_normalize_callback_option(options, :except, :unless)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/collector.rb, line 7
def self.generate_method_for_mime(mime)
sym = mime.is_a?(Symbol) ? mime : mime.to_sym
- class_eval <<-RUBY, __FILE__, __LINE__ + 1
- def #{sym}(*args, &block)
- custom(Mime[:#{sym}], *args, &block)
+ class_eval <<-RUBY, __FILE__, __LINE__ + 1
+ def #{sym}(*args, &block)
+ custom(Mime[:#{sym}], *args, &block)
end
ruby2_keywords(:#{sym})
RUBY
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/rendering.rb, line 12
@@ -109,7 +104,7 @@
super(message || DEFAULT_MESSAGE)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/helpers.rb, line 44
@@ -120,7 +120,7 @@
self.class._helpers
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/helpers.rb, line 231
@@ -127,7 +127,7 @@
_helpers
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/helpers.rb, line 222
@@ -195,7 +195,7 @@
default_helper_module! unless anonymous?
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/helpers.rb, line 211
- def helper(*args, &block)
+ def helper(*args, &block)
modules_for_helpers(args).each do |mod|
next if _helpers.include?(mod)
_helpers_for_modification.include(mod)
end
- _helpers_for_modification.module_eval(&block) if block_given?
+ _helpers_for_modification.module_eval(&block) if block_given?
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/helpers.rb, line 140
@@ -346,19 +346,19 @@ Parameters
file, line = location.path, location.lineno
methods.each do |method|
- # def current_user(*args, &block)
- # controller.send(:'current_user', *args, &block)
+ # def current_user(*args, &block)
+ # controller.send(:'current_user', *args, &block)
# end
- _helpers_for_modification.class_eval <<~ruby_eval.lines.map(&:strip).join(";"), file, line
- def #{method}(*args, &block)
- controller.send(:'#{method}', *args, &block)
+ _helpers_for_modification.class_eval <<~ruby_eval.lines.map(&:strip).join(";"), file, line
+ def #{method}(*args, &block)
+ controller.send(:'#{method}', *args, &block)
end
- ruby2_keywords(:'#{method}')
+ ruby2_keywords(:'#{method}')
ruby_eval
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/helpers.rb, line 84
@@ -397,7 +397,7 @@
super
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/helpers.rb, line 28
def initialize(error, path)
@error = error
- @path = "helpers/#{path}.rb"
+ @path = "helpers/#{path}.rb"
set_backtrace error.backtrace
if /^#{path}(\.rb)?$/.match?(error.path)
- super("Missing helper file helpers/%s.rb" % path)
+ super("Missing helper file helpers/%s.rb" % path)
else
raise error
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/railties/routes_helpers.rb, line 8
@@ -95,7 +95,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/rendering.rb, line 25
- def render(*args, &block)
- options = _normalize_render(*args, &block)
+ def render(*args, &block)
+ options = _normalize_render(*args, &block)
rendered_body = render_to_body(options)
if options[:html]
_set_html_content_type
@@ -156,7 +151,7 @@
self.response_body = rendered_body
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/rendering.rb, line 49
def render_to_body(options = {})
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/rendering.rb, line 43
- def render_to_string(*args, &block)
- options = _normalize_render(*args, &block)
+ def render_to_string(*args, &block)
+ options = _normalize_render(*args, &block)
render_to_body(options)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/rendering.rb, line 53
@@ -263,7 +258,7 @@
Mime[:text]
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/rendering.rb, line 61
@@ -302,7 +297,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/rendering.rb, line 73
@@ -341,7 +336,7 @@
if action.permitted?
action
else
- raise ArgumentError, "render parameters are not permitted"
+ raise ArgumentError, "render parameters are not permitted"
end
elsif action.is_a?(Hash)
action
@@ -350,7 +345,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/rendering.rb, line 88
@@ -385,7 +380,7 @@
options
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/rendering.rb, line 93
@@ -420,7 +415,7 @@
options
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/translation.rb, line 29
@@ -127,7 +127,7 @@
I18n.localize(object, **options)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/translation.rb, line 15
def translate(key, **options)
- if key&.start_with?(".")
- path = controller_path.tr("/", ".")
- defaults = [:"#{path}#{key}"]
- defaults << options[:default] if options[:default]
+ if key&.start_with?(".")
+ path = controller_path.tr("/", ".")
+ defaults = [:"#{path}#{key}"]
+ defaults << options[:default] if options[:default]
options[:default] = defaults.flatten
- key = "#{path}.#{action_name}#{key}"
+ key = "#{path}.#{action_name}#{key}"
end
ActiveSupport::HtmlSafeTranslation.translate(key, **options)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/url_for.rb, line 16
def _routes
- raise "In order to use #url_for, you must include routing helpers explicitly. " \
- "For instance, `include Rails.application.routes.url_helpers`."
+ raise "In order to use #url_for, you must include routing helpers explicitly. " \
+ "For instance, `include Rails.application.routes.url_helpers`."
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/url_for.rb, line 22
@@ -90,7 +90,7 @@
nil
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/abstract_controller/url_for.rb, line 26
@@ -129,7 +129,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/gem_version.rb, line 5
@@ -274,7 +269,7 @@
Gem::Version.new VERSION::STRING
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/version.rb, line 7
@@ -309,7 +304,7 @@
gem_version
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable.rb, line 71
@@ -348,7 +343,7 @@
@server ||= ActionCable::Server::Base.new
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 120
@@ -314,12 +314,12 @@ Returns
# Except for public instance methods of Base and its ancestors
ActionCable::Channel::Base.public_instance_methods(true) +
# Be sure to include shadowed public instance methods of this class
- public_instance_methods(false)).uniq.map(&:to_s)
+ public_instance_methods(false)).uniq.map(&:to_s)
methods.to_set
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 147
@@ -358,7 +358,7 @@
# When a channel is streaming via pubsub, we want to delay the confirmation
# transmission until pubsub subscription is confirmed.
#
- # The counter starts at 1 because it's awaiting a call to #subscribe_to_channel
+ # The counter starts at 1 because it's awaiting a call to #subscribe_to_channel
@defer_subscription_confirmation_counter = Concurrent::AtomicFixnum.new(1)
@reject_subscription = nil
@@ -367,7 +367,7 @@
delegate_connection_identifiers
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 136
@@ -405,7 +405,7 @@
@action_methods = nil
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 141
@@ -441,7 +441,7 @@
clear_action_methods!
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 167
@@ -481,15 +481,15 @@
if processable_action?(action)
payload = { channel_class: self.class.name, action: action, data: data }
- ActiveSupport::Notifications.instrument("perform_action.action_cable", payload) do
+ ActiveSupport::Notifications.instrument("perform_action.action_cable", payload) do
dispatch_action(action, data)
end
else
- logger.error "Unable to process #{action_signature(action, data)}"
+ logger.error "Unable to process #{action_signature(action, data)}"
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 182
@@ -529,7 +529,7 @@
ensure_confirmation_sent
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 233
@@ -567,7 +567,7 @@
@defer_subscription_confirmation_counter.increment
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 237
def defer_subscription_confirmation? # :doc:
- @defer_subscription_confirmation_counter.value > 0
+ @defer_subscription_confirmation_counter.value > 0
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 227
@@ -639,7 +639,7 @@
transmit_subscription_confirmation unless defer_subscription_confirmation?
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 245
@@ -674,7 +674,7 @@
@reject_subscription = true
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 202
@@ -709,7 +709,7 @@
# Override in subclasses
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 241
@@ -744,7 +744,7 @@
@subscription_confirmation_sent
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 249
@@ -779,7 +779,7 @@
@reject_subscription
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 214
def transmit(data, via: nil) # :doc:
logger.debug do
- status = "#{self.class.name} transmitting #{data.inspect.truncate(300)}"
- status += " (via #{via})" if via
+ status = "#{self.class.name} transmitting #{data.inspect.truncate(300)}"
+ status += " (via #{via})" if via
status
end
payload = { channel_class: self.class.name, data: data, via: via }
- ActiveSupport::Notifications.instrument("transmit.action_cable", payload) do
+ ActiveSupport::Notifications.instrument("transmit.action_cable", payload) do
connection.transmit identifier: @identifier, message: data
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/base.rb, line 208
@@ -858,7 +858,7 @@
# Override in subclasses
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/broadcasting.rb, line 16
@@ -90,7 +90,7 @@
ActionCable.server.broadcast(broadcasting_for(model), message)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/broadcasting.rb, line 26
@@ -130,7 +130,7 @@
serialize_broadcasting([ channel_name, model ])
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/callbacks.rb, line 37
- def after_subscribe(*methods, &block)
- set_callback(:subscribe, :after, *methods, &block)
+ def after_subscribe(*methods, &block)
+ set_callback(:subscribe, :after, *methods, &block)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/callbacks.rb, line 46
- def after_unsubscribe(*methods, &block)
- set_callback(:unsubscribe, :after, *methods, &block)
+ def after_unsubscribe(*methods, &block)
+ set_callback(:unsubscribe, :after, *methods, &block)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/callbacks.rb, line 33
- def before_subscribe(*methods, &block)
- set_callback(:subscribe, :before, *methods, &block)
+ def before_subscribe(*methods, &block)
+ set_callback(:subscribe, :before, *methods, &block)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/callbacks.rb, line 42
- def before_unsubscribe(*methods, &block)
- set_callback(:unsubscribe, :before, *methods, &block)
+ def before_unsubscribe(*methods, &block)
+ set_callback(:unsubscribe, :before, *methods, &block)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 24
@@ -118,7 +118,7 @@
subscription_confirmation_sent?
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 28
@@ -153,7 +153,7 @@
subscription_rejected?
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 45
def start_periodic_timers; end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 36
@@ -225,7 +225,7 @@
@_streams = []
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 32
def stream_from(broadcasting, *)
- streams << broadcasting
+ streams << broadcasting
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 40
@@ -320,7 +320,7 @@
@_streams ||= []
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 54
@@ -154,7 +154,7 @@
@logger = ActiveSupport::TaggedLogging.new ActiveSupport::Logger.new(StringIO.new)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 71
@@ -193,7 +193,7 @@
@connection_identifier ||= connection_gid(identifiers.filter_map { |id| send(id.to_sym) if id })
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 67
def transmit(cable_message)
- transmissions << cable_message.with_indifferent_access
+ transmissions << cable_message.with_indifferent_access
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/naming.rb, line 16
def channel_name
- @channel_name ||= name.delete_suffix("Channel").gsub("::", ":").underscore
+ @channel_name ||= name.delete_suffix("Channel").gsub("::", ":").underscore
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 11
def initialize(name)
- super "Unable to determine the channel to test from #{name}. " +
- "You'll need to specify it using `tests YourChannel` in your " +
- "test case definition."
+ super "Unable to determine the channel to test from #{name}. " +
+ "You'll need to specify it using `tests YourChannel` in your " +
+ "test case definition."
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/periodic_timers.rb, line 31
- def periodically(callback_or_method_name = nil, every:, &block)
+ def periodically(callback_or_method_name = nil, every:, &block)
callback =
if block_given?
- raise ArgumentError, "Pass a block or provide a callback arg, not both" if callback_or_method_name
+ raise ArgumentError, "Pass a block or provide a callback arg, not both" if callback_or_method_name
block
else
case callback_or_method_name
when Proc
callback_or_method_name
when Symbol
- -> { __send__ callback_or_method_name }
+ -> { __send__ callback_or_method_name }
else
- raise ArgumentError, "Expected a Symbol method name or a Proc, got #{callback_or_method_name.inspect}"
+ raise ArgumentError, "Expected a Symbol method name or a Proc, got #{callback_or_method_name.inspect}"
end
end
- unless every.kind_of?(Numeric) && every > 0
- raise ArgumentError, "Expected every: to be a positive number of seconds, got #{every.inspect}"
+ unless every.kind_of?(Numeric) && every > 0
+ raise ArgumentError, "Expected every: to be a positive number of seconds, got #{every.inspect}"
end
self.periodic_timers += [[ callback, every: every ]]
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/streams.rb, line 122
def stop_all_streams
streams.each do |broadcasting, callback|
pubsub.unsubscribe broadcasting, callback
- logger.info "#{self.class.name} stopped streaming from #{broadcasting}"
+ logger.info "#{self.class.name} stopped streaming from #{broadcasting}"
end.clear
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/streams.rb, line 117
@@ -209,7 +209,7 @@
stop_stream_from(broadcasting_for(model))
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/streams.rb, line 108
@@ -244,11 +244,11 @@
callback = streams.delete(broadcasting)
if callback
pubsub.unsubscribe(broadcasting, callback)
- logger.info "#{self.class.name} stopped streaming from #{broadcasting}"
+ logger.info "#{self.class.name} stopped streaming from #{broadcasting}"
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/streams.rb, line 103
- def stream_for(model, callback = nil, coder: nil, &block)
+ def stream_for(model, callback = nil, coder: nil, &block)
stream_from(broadcasting_for(model), callback || block, coder: coder)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/streams.rb, line 78
- def stream_from(broadcasting, callback = nil, coder: nil, &block)
+ def stream_from(broadcasting, callback = nil, coder: nil, &block)
broadcasting = String(broadcasting)
- # Don't send the confirmation until pubsub#subscribe is successful
+ # Don't send the confirmation until pubsub#subscribe is successful
defer_subscription_confirmation!
# Build a stream handler by wrapping the user-provided callback with
@@ -330,12 +330,12 @@
connection.server.event_loop.post do
pubsub.subscribe(broadcasting, handler, lambda do
ensure_confirmation_sent
- logger.info "#{self.class.name} is streaming from #{broadcasting}"
+ logger.info "#{self.class.name} is streaming from #{broadcasting}"
end)
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/streams.rb, line 131
@@ -374,7 +374,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 278
@@ -197,7 +192,7 @@
super(broadcasting_for(stream_or_object), *args)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 274
@@ -232,7 +227,7 @@
super(broadcasting_for(stream_or_object), *args)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 300
def assert_has_stream(stream)
- assert subscription.streams.include?(stream), "Stream #{stream} has not been started"
+ assert subscription.streams.include?(stream), "Stream #{stream} has not been started"
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 311
@@ -314,7 +309,7 @@
assert_has_stream(broadcasting_for(object))
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 289
def assert_no_streams
- assert subscription.streams.empty?, "No streams started was expected, but #{subscription.streams.count} found"
+ assert subscription.streams.empty?, "No streams started was expected, but #{subscription.streams.count} found"
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 261
def perform(action, data = {})
check_subscribed!
- subscription.perform_action(data.stringify_keys.merge("action" => action.to_s))
+ subscription.perform_action(data.stringify_keys.merge("action" => action.to_s))
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 239
@@ -435,7 +430,7 @@
@connection = ConnectionStub.new(identifiers)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 244
@@ -474,7 +469,7 @@
@subscription
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 267
def transmissions
# Return only directly sent message (via #transmit)
- connection.transmissions.filter_map { |data| data["message"] }
+ connection.transmissions.filter_map { |data| data["message"] }
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 253
@@ -546,7 +541,7 @@
subscription.unsubscribe_from_channel
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 215
@@ -98,7 +98,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 223
def determine_default_channel(name)
channel = determine_constant_from_test_name(name) do |constant|
- Class === constant && constant < ActionCable::Channel::Base
+ Class === constant && constant < ActionCable::Channel::Base
end
raise NonInferrableChannelError.new(name) if channel.nil?
channel
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/channel/test_case.rb, line 204
@@ -179,7 +179,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/test_case.rb, line 25
- def assert_reject_connection(&block)
- assert_raises(Authorization::UnauthorizedError, "Expected to reject connection but no rejection was made", &block)
+ def assert_reject_connection(&block)
+ assert_raises(Authorization::UnauthorizedError, "Expected to reject connection but no rejection was made", &block)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/authorization.rb, line 9
def reject_unauthorized_connection
- logger.error "An unauthorized connection attempt was rejected"
+ logger.error "An unauthorized connection attempt was rejected"
raise UnauthorizedError
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/base.rb, line 58
@@ -269,7 +269,7 @@
@started_at = Time.now
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/base.rb, line 134
@@ -308,7 +308,7 @@
transmit type: ActionCable::INTERNAL[:message_types][:ping], message: Time.now.to_i
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/base.rb, line 109
@@ -348,7 +348,7 @@
websocket.close
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/base.rb, line 98
@@ -385,7 +385,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/base.rb, line 119
@@ -420,7 +420,7 @@
worker_pool.async_invoke(self, method, *arguments)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/base.rb, line 125
@@ -456,11 +456,11 @@
identifier: connection_identifier,
started_at: @started_at,
subscriptions: subscriptions.identifiers,
- request_id: @env["action_dispatch.request_id"]
+ request_id: @env["action_dispatch.request_id"]
}
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/base.rb, line 172
@@ -498,7 +498,7 @@
request.cookie_jar
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/base.rb, line 164
def request # :doc:
@request ||= begin
- environment = Rails.application.env_config.merge(env) if defined?(Rails.application) && Rails.application
+ environment = Rails.application.env_config.merge(env) if defined?(Rails.application) && Rails.application
ActionDispatch::Request.new(environment || env)
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/callbacks.rb, line 41
- def after_command(*methods, &block)
- set_callback(:command, :after, *methods, &block)
+ def after_command(*methods, &block)
+ set_callback(:command, :after, *methods, &block)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/callbacks.rb, line 45
- def around_command(*methods, &block)
- set_callback(:command, :around, *methods, &block)
+ def around_command(*methods, &block)
+ set_callback(:command, :around, *methods, &block)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/callbacks.rb, line 37
- def before_command(*methods, &block)
- set_callback(:command, :before, *methods, &block)
+ def before_command(*methods, &block)
+ set_callback(:command, :before, *methods, &block)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/identification.rb, line 27
def connection_identifier
unless defined? @connection_identifier
- @connection_identifier = connection_gid identifiers.filter_map { |id| instance_variable_get("@#{id}") }
+ @connection_identifier = connection_gid identifiers.filter_map { |id| instance_variable_get("@#{id}") }
end
@connection_identifier
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/identification.rb, line 20
@@ -89,7 +89,7 @@
self.identifiers += identifiers
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/test_case.rb, line 13
def initialize(name)
- super "Unable to determine the connection to test from #{name}. " +
- "You'll need to specify it using `tests YourConnection` in your " +
- "test case definition."
+ super "Unable to determine the connection to test from #{name}. " +
+ "You'll need to specify it using `tests YourConnection` in your " +
+ "test case definition."
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/stream_event_loop.rb, line 8
@@ -120,7 +120,7 @@
@spawn_mutex = Mutex.new
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/stream_event_loop.rb, line 28
def attach(io, stream)
- @todo << lambda do
+ @todo << lambda do
@map[io] = @nio.register(io, :r)
@map[io].value = stream
end
wakeup
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/stream_event_loop.rb, line 36
def detach(io, stream)
- @todo << lambda do
+ @todo << lambda do
@nio.deregister io
@map.delete io
io.close
@@ -203,7 +203,7 @@
wakeup
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/stream_event_loop.rb, line 21
- def post(task = nil, &block)
+ def post(task = nil, &block)
task ||= block
spawn
- @executor << task
+ @executor << task
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/stream_event_loop.rb, line 54
@@ -277,7 +277,7 @@
wakeup if @nio
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/stream_event_loop.rb, line 17
- def timer(interval, &block)
- Concurrent::TimerTask.new(execution_interval: interval, &block).tap(&:execute)
+ def timer(interval, &block)
+ Concurrent::TimerTask.new(execution_interval: interval, &block).tap(&:execute)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/stream_event_loop.rb, line 45
def writes_pending(io)
- @todo << lambda do
+ @todo << lambda do
if monitor = @map[io]
monitor.interests = :rw
end
@@ -352,7 +352,7 @@
wakeup
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/tagged_logger_proxy.rb, line 13
@@ -126,7 +126,7 @@
@tags = tags.flatten
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/tagged_logger_proxy.rb, line 18
@@ -166,7 +166,7 @@
@tags = @tags.uniq
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/tagged_logger_proxy.rb, line 23
- def tag(logger, &block)
+ def tag(logger, &block)
if logger.respond_to?(:tagged)
current_tags = tags - logger.formatter.current_tags
- logger.tagged(*current_tags, &block)
+ logger.tagged(*current_tags, &block)
else
yield
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/tagged_logger_proxy.rb, line 39
- def log(type, message, &block) # :doc:
- tag(@logger) { @logger.send type, message, &block }
+ def log(type, message, &block) # :doc:
+ tag(@logger) { @logger.send type, message, &block }
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/test_case.rb, line 185
@@ -180,7 +175,7 @@
@connection = connection
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/test_case.rb, line 205
@@ -215,7 +210,7 @@
@cookie_jar ||= TestCookieJar.new
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/test_case.rb, line 198
def disconnect
- raise "Must be connected!" if connection.nil?
+ raise "Must be connected!" if connection.nil?
connection.disconnect if connection.respond_to?(:disconnect)
@connection = nil
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/test_case.rb, line 160
@@ -98,7 +98,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/test_case.rb, line 168
def determine_default_connection(name)
connection = determine_constant_from_test_name(name) do |constant|
- Class === constant && constant < ActionCable::Connection::Base
+ Class === constant && constant < ActionCable::Connection::Base
end
raise NonInferrableConnectionError.new(name) if connection.nil?
connection
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/test_case.rb, line 149
@@ -179,7 +179,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/test_case.rb, line 50
@@ -111,7 +111,7 @@
@env = request.env
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/test_case.rb, line 38
@@ -102,7 +102,7 @@
self[:encrypted] ||= {}.with_indifferent_access
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/connection/test_case.rb, line 34
@@ -137,7 +137,7 @@
self[:signed] ||= {}.with_indifferent_access
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/helpers/action_cable_helper.rb, line 34
def action_cable_meta_tag
- tag "meta", name: "action-cable-url", content: (
+ tag "meta", name: "action-cable-url", content: (
ActionCable.server.config.url ||
ActionCable.server.config.mount_path ||
- raise("No Action Cable URL configured -- please configure this at config.action_cable.url")
+ raise("No Action Cable URL configured -- please configure this at config.action_cable.url")
)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/remote_connections.rb, line 32
@@ -147,7 +147,7 @@
@server = server
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/remote_connections.rb, line 36
@@ -186,7 +186,7 @@
RemoteConnection.new(server, identifier)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/remote_connections.rb, line 50
@@ -131,7 +131,7 @@
set_identifier_instance_vars(ids)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/remote_connections.rb, line 56
def disconnect(reconnect: true)
- server.broadcast internal_channel, { type: "disconnect", reconnect: reconnect }
+ server.broadcast internal_channel, { type: "disconnect", reconnect: reconnect }
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/base.rb, line 21
def self.logger; config.logger; end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/base.rb, line 26
@@ -208,7 +208,7 @@
@remote_connections = @event_loop = @worker_pool = @pubsub = nil
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/base.rb, line 33
def call(env)
- return config.health_check_application.call(env) if env["PATH_INFO"] == config.health_check_path
+ return config.health_check_application.call(env) if env["PATH_INFO"] == config.health_check_path
setup_heartbeat_timer
config.connection_class.call.new(self, env).process
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/base.rb, line 90
@@ -284,7 +284,7 @@
config.connection_class.call.identifiers
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/base.rb, line 40
@@ -319,7 +319,7 @@
remote_connections.where(identifiers).disconnect
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/base.rb, line 65
@@ -354,7 +354,7 @@
@event_loop || @mutex.synchronize { @event_loop ||= ActionCable::Connection::StreamEventLoop.new }
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/base.rb, line 85
@@ -389,7 +389,7 @@
@pubsub || @mutex.synchronize { @pubsub ||= config.pubsub_adapter.new(self) }
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/base.rb, line 61
@@ -424,7 +424,7 @@
@remote_connections || @mutex.synchronize { @remote_connections ||= RemoteConnections.new(self) }
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/base.rb, line 44
@@ -471,7 +471,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/base.rb, line 80
@@ -510,7 +510,7 @@
@worker_pool || @mutex.synchronize { @worker_pool ||= ActionCable::Server::Worker.new(max_size: config.worker_pool_size) }
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/broadcasting.rb, line 26
@@ -127,7 +127,7 @@
broadcaster_for(broadcasting, coder: coder).broadcast(message)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/broadcasting.rb, line 32
@@ -162,7 +162,7 @@
Broadcaster.new(self, String(broadcasting), coder: coder)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/broadcasting.rb, line 40
@@ -125,7 +125,7 @@
@server, @broadcasting, @coder = server, broadcasting, coder
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/broadcasting.rb, line 44
def broadcast(message)
- server.logger.debug { "[ActionCable] Broadcasting to #{broadcasting}: #{message.inspect.truncate(300)}" }
+ server.logger.debug { "[ActionCable] Broadcasting to #{broadcasting}: #{message.inspect.truncate(300)}" }
payload = { broadcasting: broadcasting, message: message, coder: coder }
- ActiveSupport::Notifications.instrument("broadcast.action_cable", payload) do
+ ActiveSupport::Notifications.instrument("broadcast.action_cable", payload) do
encoded = coder ? coder.encode(message) : message
server.pubsub.broadcast broadcasting, encoded
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/configuration.rb, line 19
def initialize
@log_tags = []
- @connection_class = -> { ActionCable::Connection::Base }
+ @connection_class = -> { ActionCable::Connection::Base }
@worker_pool_size = 4
@disable_request_forgery_protection = false
@allow_same_origin_as_host = true
@filter_parameters = []
- @health_check_application = ->(env) {
- [200, { Rack::CONTENT_TYPE => "text/html", "date" => Time.now.httpdate }, []]
+ @health_check_application = ->(env) {
+ [200, { Rack::CONTENT_TYPE => "text/html", "date" => Time.now.httpdate }, []]
}
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/configuration.rb, line 37
def pubsub_adapter
- adapter = (cable.fetch("adapter") { "redis" })
+ adapter = (cable.fetch("adapter") { "redis" })
# Require the adapter itself and give useful feedback about
# 1. Missing adapter gems and
- # 2. Adapter gems' missing dependencies.
- path_to_adapter = "action_cable/subscription_adapter/#{adapter}"
+ # 2. Adapter gems' missing dependencies.
+ path_to_adapter = "action_cable/subscription_adapter/#{adapter}"
begin
require path_to_adapter
- rescue LoadError => e
- # We couldn't require the adapter itself. Raise an exception that
+ rescue LoadError => e
+ # We couldn't require the adapter itself. Raise an exception that
# points out config typos and missing gems.
if e.path == path_to_adapter
- # We can assume that a non-builtin adapter was specified, so it's
+ # We can assume that a non-builtin adapter was specified, so it's
# either misspelled or missing from Gemfile.
- raise e.class, "Could not load the '#{adapter}' Action Cable pubsub adapter. Ensure that the adapter is spelled correctly in config/cable.yml and that you've added the necessary adapter gem to your Gemfile.", e.backtrace
+ raise e.class, "Could not load the '#{adapter}' Action Cable pubsub adapter. Ensure that the adapter is spelled correctly in config/cable.yml and that you've added the necessary adapter gem to your Gemfile.", e.backtrace
# Bubbled up from the adapter require. Prefix the exception message
# with some guidance about how to address it and reraise.
else
- raise e.class, "Error loading the '#{adapter}' Action Cable pubsub adapter. Missing a gem it depends on? #{e.message}", e.backtrace
+ raise e.class, "Error loading the '#{adapter}' Action Cable pubsub adapter. Missing a gem it depends on? #{e.message}", e.backtrace
end
end
adapter = adapter.camelize
- adapter = "PostgreSQL" if adapter == "Postgresql"
- "ActionCable::SubscriptionAdapter::#{adapter}".constantize
+ adapter = "PostgreSQL" if adapter == "Postgresql"
+ "ActionCable::SubscriptionAdapter::#{adapter}".constantize
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/server/worker/active_record_connection_management.rb, line 15
- def with_database_connections(&block)
- connection.logger.tag(ActiveRecord::Base.logger, &block)
+ def with_database_connections(&block)
+ connection.logger.tag(ActiveRecord::Base.logger, &block)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/async.rb, line 12
@@ -100,7 +100,7 @@
super()
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/async.rb, line 17
@@ -139,7 +139,7 @@
@event_loop.post { super }
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/async.rb, line 21
@@ -174,7 +174,7 @@
@event_loop.post { super }
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/base.rb, line 8
@@ -134,7 +134,7 @@
@logger = @server.logger
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/base.rb, line 13
@@ -173,7 +173,7 @@
raise NotImplementedError
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/base.rb, line 29
def identifier
- @server.config.cable[:id] ||= "ActionCable-PID-#{$$}"
+ @server.config.cable[:id] ||= "ActionCable-PID-#{$$}"
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/base.rb, line 25
@@ -243,7 +243,7 @@
raise NotImplementedError
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/base.rb, line 17
@@ -278,7 +278,7 @@
raise NotImplementedError
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/base.rb, line 21
@@ -313,7 +313,7 @@
raise NotImplementedError
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/postgresql.rb, line 74
@@ -120,7 +120,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/postgresql.rb, line 118
@@ -159,7 +159,7 @@
@queue.push([:listen, channel, on_success])
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/postgresql.rb, line 126
@@ -194,7 +194,7 @@
@event_loop.post { super }
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/postgresql.rb, line 87
@@ -234,10 +234,10 @@
case action
when :listen
- pg_conn.exec("LISTEN #{pg_conn.escape_identifier channel}")
- @event_loop.post(&callback) if callback
+ pg_conn.exec("LISTEN #{pg_conn.escape_identifier channel}")
+ @event_loop.post(&callback) if callback
when :unlisten
- pg_conn.exec("UNLISTEN #{pg_conn.escape_identifier channel}")
+ pg_conn.exec("UNLISTEN #{pg_conn.escape_identifier channel}")
when :shutdown
throw :shutdown
end
@@ -251,7 +251,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/postgresql.rb, line 122
@@ -286,7 +286,7 @@
@queue.push([:unlisten, channel])
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/postgresql.rb, line 113
@@ -322,7 +322,7 @@
Thread.pass while @thread.alive?
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/redis.rb, line 65
@@ -159,7 +154,7 @@
@thread = nil
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/redis.rb, line 138
def add_channel(channel, on_success)
@subscription_lock.synchronize do
ensure_listener_running
- @subscribe_callbacks[channel] << on_success
+ @subscribe_callbacks[channel] << on_success
when_connected { @subscribed_client.subscribe(channel) }
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/redis.rb, line 152
@@ -237,7 +232,7 @@
@event_loop.post { super }
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/redis.rb, line 86
@@ -272,7 +267,7 @@
conn.without_reconnect do
original_client = extract_subscribed_client(conn)
- conn.subscribe("_action_cable_internal") do |on|
+ conn.subscribe("_action_cable_internal") do |on|
on.subscribe do |chan, count|
@subscription_lock.synchronize do
if count == 1
@@ -286,7 +281,7 @@
if callbacks = @subscribe_callbacks[chan]
next_callback = callbacks.shift
- @event_loop.post(&next_callback) if next_callback
+ @event_loop.post(&next_callback) if next_callback
@subscribe_callbacks.delete(chan) if callbacks.empty?
end
end
@@ -307,7 +302,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/redis.rb, line 146
@@ -344,7 +339,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/redis.rb, line 125
@@ -388,7 +383,7 @@
Thread.pass while @thread.alive?
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/redis.rb, line 213
@@ -99,7 +99,7 @@
@raw_client = raw_client
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/redis.rb, line 217
def subscribe(*channel)
- send_command("subscribe", *channel)
+ send_command("subscribe", *channel)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/redis.rb, line 221
def unsubscribe(*channel)
- send_command("unsubscribe", *channel)
+ send_command("unsubscribe", *channel)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/subscriber_map.rb, line 6
@@ -116,7 +116,7 @@
@sync = Mutex.new
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/subscriber_map.rb, line 47
@@ -155,7 +155,7 @@
on_success.call if on_success
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/subscriber_map.rb, line 11
@@ -190,7 +190,7 @@
@sync.synchronize do
new_channel = !@subscribers.key?(channel)
- @subscribers[channel] << subscriber
+ @subscribers[channel] << subscriber
if new_channel
add_channel channel, on_success
@@ -200,7 +200,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/subscriber_map.rb, line 36
@@ -242,7 +242,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/subscriber_map.rb, line 54
@@ -277,7 +277,7 @@
callback.call message
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/subscriber_map.rb, line 51
def remove_channel(channel)
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/subscriber_map.rb, line 25
@@ -353,7 +353,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/test.rb, line 15
def broadcast(channel, payload)
- broadcasts(channel) << payload
+ broadcasts(channel) << payload
super
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/test.rb, line 20
@@ -152,7 +152,7 @@
channels_data[channel] ||= []
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/test.rb, line 28
@@ -187,7 +187,7 @@
@channels_data = nil
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/subscription_adapter/test.rb, line 24
@@ -222,7 +222,7 @@
channels_data[channel] = []
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/test_helper.rb, line 116
- def assert_broadcast_on(stream, data, &block)
+ def assert_broadcast_on(stream, data, &block)
# Encode to JSON and back–we want to use this value to compare
# with decoded JSON.
- # Comparing JSON strings doesn't work due to the order if the keys.
+ # Comparing JSON strings doesn't work due to the order if the keys.
serialized_msg =
ActiveSupport::JSON.decode(ActiveSupport::JSON.encode(data))
new_messages = broadcasts(stream)
if block_given?
- new_messages = new_broadcasts_from(new_messages, stream, "assert_broadcast_on", &block)
+ new_messages = new_broadcasts_from(new_messages, stream, "assert_broadcast_on", &block)
end
message = new_messages.find { |msg| ActiveSupport::JSON.decode(msg) == serialized_msg }
- error_message = "No messages sent with #{data} to #{stream}"
+ error_message = "No messages sent with #{data} to #{stream}"
if new_messages.any?
- error_message = new_messages.inject("#{error_message}\nMessage(s) found:\n") do |error_message, new_message|
- error_message + "#{ActiveSupport::JSON.decode(new_message)}\n"
+ error_message = new_messages.inject("#{error_message}\nMessage(s) found:\n") do |error_message, new_message|
+ error_message + "#{ActiveSupport::JSON.decode(new_message)}\n"
end
else
- error_message = "#{error_message}\nNo message found for #{stream}"
+ error_message = "#{error_message}\nNo message found for #{stream}"
end
assert message, error_message
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/test_helper.rb, line 49
- def assert_broadcasts(stream, number, &block)
+ def assert_broadcasts(stream, number, &block)
if block_given?
- new_messages = new_broadcasts_from(broadcasts(stream), stream, "assert_broadcasts", &block)
+ new_messages = new_broadcasts_from(broadcasts(stream), stream, "assert_broadcasts", &block)
actual_count = new_messages.size
- assert_equal number, actual_count, "#{number} broadcasts to #{stream} expected, but #{actual_count} were sent"
+ assert_equal number, actual_count, "#{number} broadcasts to #{stream} expected, but #{actual_count} were sent"
else
actual_count = broadcasts(stream).size
- assert_equal number, actual_count, "#{number} broadcasts to #{stream} expected, but #{actual_count} were sent"
+ assert_equal number, actual_count, "#{number} broadcasts to #{stream} expected, but #{actual_count} were sent"
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/test_helper.rb, line 81
- def assert_no_broadcasts(stream, &block)
- assert_broadcasts stream, 0, &block
+ def assert_no_broadcasts(stream, &block)
+ assert_broadcasts stream, 0, &block
end
- See on GitHub
+ 🔎 See on GitHub
# File actioncable/lib/action_cable/test_helper.rb, line 97
- def capture_broadcasts(stream, &block)
- new_broadcasts_from(broadcasts(stream), stream, "capture_broadcasts", &block).map { |m| ActiveSupport::JSON.decode(m) }
+ def capture_broadcasts(stream, &block)
+ new_broadcasts_from(broadcasts(stream), stream, "capture_broadcasts", &block).map { |m| ActiveSupport::JSON.decode(m) }
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/renderers.rb, line 7
- def self.add_renderer(key, &block)
- Renderers.add(key, &block)
+ def self.add_renderer(key, &block)
+ Renderers.add(key, &block)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/renderers.rb, line 12
@@ -354,7 +354,7 @@
Renderers.remove(key)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/api.rb, line 106
@@ -217,7 +212,7 @@
MODULES - modules
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/api/api_rendering.rb, line 11
@@ -101,7 +101,7 @@
super
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/base.rb, line 184
@@ -331,7 +326,7 @@
MODULES - modules
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/conditional_get.rb, line 274
@@ -180,11 +180,11 @@ Examples
)
options.delete(:private)
- response.cache_control[:extras] = options.map { |k, v| "#{k}=#{v}" }
+ response.cache_control[:extras] = options.map { |k, v| "#{k}=#{v}" }
response.date = Time.now unless response.date?
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/conditional_get.rb, line 292
@@ -219,7 +219,7 @@
response.cache_control.replace(no_cache: true)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/conditional_get.rb, line 128
@@ -343,7 +343,7 @@ Examples
head :not_modified if request.fresh?(response)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/conditional_get.rb, line 304
@@ -387,7 +387,7 @@
public: public)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/conditional_get.rb, line 314
@@ -422,7 +422,7 @@
response.cache_control.replace(no_store: true)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/conditional_get.rb, line 227
@@ -531,7 +531,7 @@ Examples
!request.fresh?(response)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/conditional_get.rb, line 31
- def etag(&etagger)
+ def etag(&etagger)
self.etaggers += [etagger]
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/content_security_policy.rb, line 39
- def content_security_policy(enabled = true, **options, &block)
+ def content_security_policy(enabled = true, **options, &block)
before_action(options) do
if block_given?
policy = current_content_security_policy
- instance_exec(policy, &block)
+ instance_exec(policy, &block)
request.content_security_policy = policy
end
@@ -123,7 +123,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/content_security_policy.rb, line 65
@@ -172,7 +172,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/cookies.rb, line 14
@@ -86,7 +86,7 @@
request.cookie_jar
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/data_streaming.rb, line 111
@@ -141,7 +141,7 @@
render options.slice(:status, :content_type).merge(body: data)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/data_streaming.rb, line 71
def send_file(path, options = {}) # :doc:
- raise MissingFile, "Cannot read file #{path}" unless File.file?(path) && File.readable?(path)
+ raise MissingFile, "Cannot read file #{path}" unless File.file?(path) && File.readable?(path)
options[:filename] ||= File.basename(path) unless options[:url_based_filename]
send_file_headers! options
@@ -219,7 +219,7 @@
response.send_file path
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/default_headers.rb, line 12
@@ -88,7 +88,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/flash.rb, line 51
@@ -109,7 +109,7 @@
super(options, response_options_and_flash)
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/metal/flash.rb, line 32
@@ -109,7 +109,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/form_builder.rb, line 48
@@ -129,7 +129,7 @@
self.class._default_form_builder
end
- See on GitHub
+ 🔎 See on GitHub
# File actionpack/lib/action_controller/form_builder.rb, line 42
@@ -91,7 +91,7 @@ See on GitHub
+ 🔎 See on GitHub
diff --git a/src/classes/ActionController/Head.html b/src/classes/ActionController/Head.html
index 76e0a0e488..65d068a154 100644
--- a/src/classes/ActionController/Head.html
+++ b/src/classes/ActionController/Head.html
@@ -92,13 +92,13 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/head.rb, line 21
def head(status, options = nil)
if status.is_a?(Hash)
- raise ArgumentError, "#{status.inspect} is not a valid value for `status`."
+ raise ArgumentError, "#{status.inspect} is not a valid value for `status`."
end
status ||= :ok
@@ -108,7 +108,7 @@
content_type = options.delete(:content_type)
options.each do |key, value|
- headers[key.to_s.split(/[-_]/).each { |v| v[0] = v[0].upcase }.join("-")] = value.to_s
+ headers[key.to_s.split(/[-_]/).each { |v| v[0] = v[0].upcase }.join("-")] = value.to_s
end
end
@@ -117,18 +117,18 @@
if include_content?(response_code)
unless self.media_type
- self.content_type = content_type || ((f = formats) && Mime[f.first]) || Mime[:html]
+ self.content_type = content_type || ((f = formats) && Mime[f.first]) || Mime[:html]
end
response.charset = false
end
- self.response_body = ""
+ self.response_body = ""
true
end
- See on GitHub
+ 🔎 See on GitHub
diff --git a/src/classes/ActionController/Helpers.html b/src/classes/ActionController/Helpers.html
index 076e60dfd7..aadebaaa5c 100644
--- a/src/classes/ActionController/Helpers.html
+++ b/src/classes/ActionController/Helpers.html
@@ -173,7 +173,7 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/helpers.rb, line 117
@@ -181,7 +181,7 @@
@_helper_proxy ||= view_context
end
- See on GitHub
+ 🔎 See on GitHub
diff --git a/src/classes/ActionController/Helpers/ClassMethods.html b/src/classes/ActionController/Helpers/ClassMethods.html
index d3c0201311..8cfd95f6d0 100644
--- a/src/classes/ActionController/Helpers/ClassMethods.html
+++ b/src/classes/ActionController/Helpers/ClassMethods.html
@@ -95,15 +95,15 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/helpers.rb, line 78
def helper_attr(*attrs)
- attrs.flatten.each { |attr| helper_method(attr, "#{attr}=") }
+ attrs.flatten.each { |attr| helper_method(attr, "#{attr}=") }
end
- See on GitHub
+ 🔎 See on GitHub
@@ -132,7 +132,7 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/helpers.rb, line 88
@@ -144,7 +144,7 @@
end
end
- See on GitHub
+ 🔎 See on GitHub
@@ -181,7 +181,7 @@ Returns
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/helpers.rb, line 104
@@ -190,7 +190,7 @@ Returns
super(args)
end
- See on GitHub
+ 🔎 See on GitHub
diff --git a/src/classes/ActionController/HttpAuthentication/Basic.html b/src/classes/ActionController/HttpAuthentication/Basic.html
index 107bae4bf1..4cd5ce5f63 100644
--- a/src/classes/ActionController/HttpAuthentication/Basic.html
+++ b/src/classes/ActionController/HttpAuthentication/Basic.html
@@ -182,15 +182,15 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 127
def auth_param(request)
- request.authorization.to_s.split(" ", 2).second
+ request.authorization.to_s.split(" ", 2).second
end
- See on GitHub
+ 🔎 See on GitHub
@@ -217,15 +217,15 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 123
def auth_scheme(request)
- request.authorization.to_s.split(" ", 2).first
+ request.authorization.to_s.split(" ", 2).first
end
- See on GitHub
+ 🔎 See on GitHub
@@ -252,17 +252,17 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 105
- def authenticate(request, &login_procedure)
+ def authenticate(request, &login_procedure)
if has_basic_credentials?(request)
login_procedure.call(*user_name_and_password(request))
end
end
- See on GitHub
+ 🔎 See on GitHub
@@ -289,18 +289,18 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 135
def authentication_request(controller, realm, message)
- message ||= "HTTP Basic: Access denied.\n"
- controller.headers["WWW-Authenticate"] = %(Basic realm="#{realm.tr('"', "")}")
+ message ||= "HTTP Basic: Access denied.\n"
+ controller.headers["WWW-Authenticate"] = %(Basic realm="#{realm.tr('"', "")}")
controller.status = 401
controller.response_body = message
end
- See on GitHub
+ 🔎 See on GitHub
@@ -327,15 +327,15 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 119
def decode_credentials(request)
- ::Base64.decode64(auth_param(request) || "")
+ ::Base64.decode64(auth_param(request) || "")
end
- See on GitHub
+ 🔎 See on GitHub
@@ -362,15 +362,15 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 131
def encode_credentials(user_name, password)
- "Basic #{::Base64.strict_encode64("#{user_name}:#{password}")}"
+ "Basic #{::Base64.strict_encode64("#{user_name}:#{password}")}"
end
- See on GitHub
+ 🔎 See on GitHub
@@ -397,15 +397,15 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 111
def has_basic_credentials?(request)
- request.authorization.present? && (auth_scheme(request).downcase == "basic")
+ request.authorization.present? && (auth_scheme(request).downcase == "basic")
end
- See on GitHub
+ 🔎 See on GitHub
@@ -432,15 +432,15 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 115
def user_name_and_password(request)
- decode_credentials(request).split(":", 2)
+ decode_credentials(request).split(":", 2)
end
- See on GitHub
+ 🔎 See on GitHub
diff --git a/src/classes/ActionController/HttpAuthentication/Basic/ControllerMethods.html b/src/classes/ActionController/HttpAuthentication/Basic/ControllerMethods.html
index b458e4360a..81a8eb3417 100644
--- a/src/classes/ActionController/HttpAuthentication/Basic/ControllerMethods.html
+++ b/src/classes/ActionController/HttpAuthentication/Basic/ControllerMethods.html
@@ -103,15 +103,15 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 92
- def authenticate_or_request_with_http_basic(realm = nil, message = nil, &login_procedure)
- authenticate_with_http_basic(&login_procedure) || request_http_basic_authentication(realm || "Application", message)
+ def authenticate_or_request_with_http_basic(realm = nil, message = nil, &login_procedure)
+ authenticate_with_http_basic(&login_procedure) || request_http_basic_authentication(realm || "Application", message)
end
- See on GitHub
+ 🔎 See on GitHub
@@ -138,15 +138,15 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 96
- def authenticate_with_http_basic(&login_procedure)
- HttpAuthentication::Basic.authenticate(request, &login_procedure)
+ def authenticate_with_http_basic(&login_procedure)
+ HttpAuthentication::Basic.authenticate(request, &login_procedure)
end
- See on GitHub
+ 🔎 See on GitHub
@@ -173,20 +173,20 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 83
def http_basic_authenticate_or_request_with(name:, password:, realm: nil, message: nil)
authenticate_or_request_with_http_basic(realm, message) do |given_name, given_password|
- # This comparison uses & so that it doesn't short circuit and
- # uses `secure_compare` so that length information isn't leaked.
- ActiveSupport::SecurityUtils.secure_compare(given_name.to_s, name) &
+ # This comparison uses & so that it doesn't short circuit and
+ # uses `secure_compare` so that length information isn't leaked.
+ ActiveSupport::SecurityUtils.secure_compare(given_name.to_s, name) &
ActiveSupport::SecurityUtils.secure_compare(given_password.to_s, password)
end
end
- See on GitHub
+ 🔎 See on GitHub
@@ -213,15 +213,15 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 100
- def request_http_basic_authentication(realm = "Application", message = nil)
+ def request_http_basic_authentication(realm = "Application", message = nil)
HttpAuthentication::Basic.authentication_request(self, realm, message)
end
- See on GitHub
+ 🔎 See on GitHub
diff --git a/src/classes/ActionController/HttpAuthentication/Basic/ControllerMethods/ClassMethods.html b/src/classes/ActionController/HttpAuthentication/Basic/ControllerMethods/ClassMethods.html
index 1496ff2303..55d3958518 100644
--- a/src/classes/ActionController/HttpAuthentication/Basic/ControllerMethods/ClassMethods.html
+++ b/src/classes/ActionController/HttpAuthentication/Basic/ControllerMethods/ClassMethods.html
@@ -80,17 +80,17 @@
- Source code
+ 📝 Source code
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 76
def http_basic_authenticate_with(name:, password:, realm: nil, **options)
- raise ArgumentError, "Expected name: to be a String, got #{name.class}" unless name.is_a?(String)
- raise ArgumentError, "Expected password: to be a String, got #{password.class}" unless password.is_a?(String)
+ raise ArgumentError, "Expected name: to be a String, got #{name.class}" unless name.is_a?(String)
+ raise ArgumentError, "Expected password: to be a String, got #{password.class}" unless password.is_a?(String)
before_action(options) { http_basic_authenticate_or_request_with name: name, password: password, realm: realm }
end
- See on GitHub
+ 🔎 See on GitHub
diff --git a/src/classes/ActionController/HttpAuthentication/Digest.html b/src/classes/ActionController/HttpAuthentication/Digest.html
index a3c39384e9..1b17095500 100644
--- a/src/classes/ActionController/HttpAuthentication/Digest.html
+++ b/src/classes/ActionController/HttpAuthentication/Digest.html
@@ -180,15 +180,15 @@
-