diff --git a/.rubocop.yml b/.rubocop.yml index bd07b68..75c0c9f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,5 @@ +inherit_from: .rubocop_todo.yml + # The behavior of RuboCop can be controlled via the .rubocop.yml # configuration file. It makes it possible to enable/disable # certain cops (checks) and to alter their behavior if they accept @@ -8,6 +10,9 @@ # where the inspected file is and continue its way up to the root directory. # # See https://docs.rubocop.org/rubocop/configuration +plugins: + - rubocop-gusto + AllCops: SuggestExtensions: false NewCops: enable diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..a065a5e --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,51 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2026-03-05 18:26:56 UTC using RuboCop version 1.85.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 3 +Gusto/NoMetaprogramming: + Exclude: + - 'test/support/test_macro.rb' + +# Offense count: 1 +Gusto/ToplevelConstants: + Exclude: + - 'test/test_helper.rb' + +# Offense count: 1 +# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates. +# AllowedMethods: call +# WaywardPredicates: infinite?, nonzero? +Naming/PredicateMethod: + Exclude: + - 'lib/packwerk/privacy/checker.rb' + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +Performance/StringInclude: + Exclude: + - 'bin/rake' + - 'bin/rubocop' + - 'bin/tapioca' + +# Offense count: 19 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: SuggestedStrictness. +Sorbet/FalseSigil: + Enabled: false + +# Offense count: 45 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: SuggestedStrictness. +Sorbet/StrictSigil: + Enabled: false + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/FileNull: + Exclude: + - 'test/rails_test_helper.rb' diff --git a/Gemfile b/Gemfile index e8c4fe3..7f4f5e9 100644 --- a/Gemfile +++ b/Gemfile @@ -3,5 +3,3 @@ source 'https://rubygems.org' gemspec - -gem 'packwerk', git: 'https://github.com/Shopify/packwerk', branch: 'main' diff --git a/Gemfile.lock b/Gemfile.lock index 0853c43..085105f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,24 +1,8 @@ -GIT - remote: https://github.com/Shopify/packwerk - revision: 6e57928e1508afd0f651ab68682c06b3a361d399 - branch: main - specs: - packwerk (2.2.1) - activesupport (>= 6.0) - ast - better_html - bundler - constant_resolver (>= 0.2.0) - parallel - parser - sorbet-runtime (>= 0.5.9914) - zeitwerk (>= 2.6.1) - PATH remote: . specs: packwerk-extensions (0.3.0) - packwerk (>= 2.2.1) + packwerk (>= 3) railties (>= 6.0.0) sorbet-runtime zeitwerk @@ -26,147 +10,260 @@ PATH GEM remote: https://rubygems.org/ specs: - actionpack (7.0.4.2) - actionview (= 7.0.4.2) - activesupport (= 7.0.4.2) - rack (~> 2.0, >= 2.2.0) + actionpack (8.1.2) + actionview (= 8.1.2) + activesupport (= 8.1.2) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actionview (7.0.4.2) - activesupport (= 7.0.4.2) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actionview (8.1.2) + activesupport (= 8.1.2) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activesupport (7.0.4.2) - concurrent-ruby (~> 1.0, >= 1.0.2) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activesupport (8.1.2) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + json + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) - ast (2.4.2) - better_html (2.0.1) - actionview (>= 6.0) - activesupport (>= 6.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.9) + public_suffix (>= 2.0.2, < 8.0) + ast (2.4.3) + base64 (0.3.0) + benchmark (0.5.0) + better_html (2.2.0) + actionview (>= 7.0) + activesupport (>= 7.0) ast (~> 2.0) erubi (~> 1.4) parser (>= 2.4) smart_properties - builder (3.2.4) + bigdecimal (4.0.1) + builder (3.3.0) coderay (1.1.3) - concurrent-ruby (1.2.0) - constant_resolver (0.2.0) + concurrent-ruby (1.3.6) + connection_pool (3.0.2) + constant_resolver (0.3.0) crass (1.0.6) - diff-lcs (1.5.1) - erubi (1.12.0) - i18n (1.12.0) + date (3.5.1) + drb (2.2.3) + erb (6.0.2) + erubi (1.13.1) + i18n (1.14.8) concurrent-ruby (~> 1.0) - json (2.6.3) - loofah (2.19.1) + io-console (0.8.2) + irb (1.17.0) + pp (>= 0.6.0) + prism (>= 1.3.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + json (2.18.1) + json-schema (6.1.0) + addressable (~> 2.8) + bigdecimal (>= 3.1, < 5) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) + logger (1.7.0) + loofah (2.25.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - method_source (1.0.0) - minitest (5.17.0) - mocha (2.0.2) + nokogiri (>= 1.12.0) + mcp (0.8.0) + json-schema (>= 4.1) + method_source (1.1.0) + minitest (6.0.2) + drb (~> 2.0) + prism (~> 1.5) + mocha (3.0.2) ruby2_keywords (>= 0.0.5) - nokogiri (1.16.4-arm64-darwin) + netrc (0.11.0) + nokogiri (1.19.1-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.4-x86_64-darwin) + nokogiri (1.19.1-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.4-x86_64-linux) + nokogiri (1.19.1-x86_64-linux-gnu) racc (~> 1.4) - parallel (1.22.1) - parser (3.2.1.0) + packwerk (3.2.3) + activesupport (>= 6.0) + ast + better_html + bundler + constant_resolver (>= 0.3) + parallel + parser + prism (>= 0.25.0) + sorbet-runtime (>= 0.5.9914) + zeitwerk (>= 2.6.1) + parallel (1.27.0) + parser (3.3.10.2) ast (~> 2.4.1) - pry (0.14.2) + racc + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.9.0) + pry (0.16.0) coderay (~> 1.1) method_source (~> 1.0) - racc (1.6.2) - rack (2.2.6.2) - rack-test (2.0.2) + reline (>= 0.6.0) + psych (5.3.1) + date + stringio + public_suffix (7.0.5) + racc (1.8.1) + rack (3.2.5) + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) rack (>= 1.3) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rackup (2.3.1) + rack (>= 3) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) - railties (7.0.4.2) - actionpack (= 7.0.4.2) - activesupport (= 7.0.4.2) - method_source + rails-html-sanitizer (1.7.0) + loofah (~> 2.25) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.1.2) + actionpack (= 8.1.2) + activesupport (= 8.1.2) + irb (~> 1.13) + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.0.6) - rbi (0.0.17) - ast - parser (>= 3.0.0) - sorbet-runtime (>= 0.5.9204) - unparser (>= 0.5.6) - regexp_parser (2.7.0) - rexml (3.2.5) - rubocop (1.45.1) + rake (13.3.1) + rbi (0.3.9) + prism (~> 1.0) + rbs (>= 3.4.4) + rbs (4.0.0.dev.5) + logger + prism (>= 1.3.0) + tsort + rdoc (7.2.0) + erb + psych (>= 4.0.0) + tsort + regexp_parser (2.11.3) + reline (0.6.3) + io-console (~> 0.5) + require-hooks (0.2.3) + rexml (3.4.4) + rubocop (1.85.1) json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + mcp (~> 0.6) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.26.0) - parser (>= 3.2.1.0) - ruby-progressbar (1.11.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.49.0) + parser (>= 3.3.7.2) + prism (~> 1.7) + rubocop-gusto (10.6.0) + lint_roller + rubocop (>= 1.76) + rubocop-performance + rubocop-rake + rubocop-rspec + rubocop-sorbet + thor + rubocop-performance (1.26.1) + lint_roller (~> 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.47.1, < 2.0) + rubocop-rake (0.7.1) + lint_roller (~> 1.1) + rubocop (>= 1.72.1) + rubocop-rspec (3.9.0) + lint_roller (~> 1.1) + rubocop (~> 1.81) + rubocop-sorbet (0.12.0) + lint_roller + rubocop (>= 1.75.2) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) + securerandom (0.4.1) smart_properties (1.17.0) - sorbet (0.5.11353) - sorbet-static (= 0.5.11353) - sorbet-runtime (0.5.10672) - sorbet-static (0.5.11353-universal-darwin) - sorbet-static (0.5.11353-x86_64-linux) - spoom (1.1.16) - sorbet (>= 0.5.10187) - sorbet-runtime (>= 0.5.9204) + sorbet (0.6.12992) + sorbet-static (= 0.6.12992) + sorbet-runtime (0.6.12992) + sorbet-static (0.6.12992-universal-darwin) + sorbet-static (0.6.12992-x86_64-linux) + sorbet-static-and-runtime (0.6.12992) + sorbet (= 0.6.12992) + sorbet-runtime (= 0.6.12992) + spoom (1.7.11) + erubi (>= 1.10.0) + prism (>= 0.28.0) + rbi (>= 0.3.3) + rbs (>= 4.0.0.dev.4) + rexml (>= 3.2.6) + sorbet-static-and-runtime (>= 0.5.10187) thor (>= 0.19.2) - tapioca (0.7.3) - bundler (>= 1.17.3) - pry (>= 0.12.2) - rbi (~> 0.0.0, >= 0.0.14) - sorbet-runtime (>= 0.5.9204) - sorbet-static (>= 0.5.9204) - spoom (~> 1.1.0, >= 1.1.11) + stringio (3.2.0) + tapioca (0.17.10) + benchmark + bundler (>= 2.2.25) + netrc (>= 0.11.0) + parallel (>= 1.21.0) + rbi (>= 0.3.7) + require-hooks (>= 0.2.2) + sorbet-static-and-runtime (>= 0.5.11087) + spoom (>= 1.7.9) thor (>= 1.2.0) yard-sorbet - thor (1.2.1) + thor (1.5.0) + tsort (0.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) - unparser (0.6.8) - diff-lcs (~> 1.3) - parser (>= 3.2.0) - yard (0.9.36) - yard-sorbet (0.8.1) - sorbet-runtime (>= 0.5) - yard (>= 0.9) - zeitwerk (2.6.7) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) + uri (1.1.1) + useragent (0.16.11) + yard (0.9.38) + yard-sorbet (0.9.0) + sorbet-runtime + yard + zeitwerk (2.7.5) PLATFORMS + arm64-darwin universal-darwin x86_64-linux DEPENDENCIES minitest mocha - packwerk! packwerk-extensions! pry rake rubocop + rubocop-gusto sorbet sorbet-static tapioca BUNDLED WITH - 2.5.9 + 4.0.7 diff --git a/bin/rake b/bin/rake index b5db211..95f9b6f 100755 --- a/bin/rake +++ b/bin/rake @@ -9,17 +9,21 @@ # require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', - Pathname.new(__FILE__).realpath) +ENV['BUNDLE_GEMFILE'] ||= File.expand_path( +'../../Gemfile', + Pathname.new(__FILE__).realpath +) bundle_binstub = File.expand_path('bundle', __dir__) if File.file?(bundle_binstub) - if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 300)) load(bundle_binstub) else - abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. -Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + abort( +"Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again." +) end end diff --git a/bin/rubocop b/bin/rubocop index ff03802..3532e99 100755 --- a/bin/rubocop +++ b/bin/rubocop @@ -9,17 +9,21 @@ # require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', - Pathname.new(__FILE__).realpath) +ENV['BUNDLE_GEMFILE'] ||= File.expand_path( +'../../Gemfile', + Pathname.new(__FILE__).realpath +) bundle_binstub = File.expand_path('bundle', __dir__) if File.file?(bundle_binstub) - if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 300)) load(bundle_binstub) else - abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. -Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + abort( +"Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again." +) end end diff --git a/bin/tapioca b/bin/tapioca index ce95fac..aa23d47 100755 --- a/bin/tapioca +++ b/bin/tapioca @@ -9,17 +9,21 @@ # require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', - Pathname.new(__FILE__).realpath) +ENV['BUNDLE_GEMFILE'] ||= File.expand_path( +'../../Gemfile', + Pathname.new(__FILE__).realpath +) bundle_binstub = File.expand_path('bundle', __dir__) if File.file?(bundle_binstub) - if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 300)) load(bundle_binstub) else - abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. -Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + abort( +"Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again." +) end end diff --git a/lib/packwerk/folder_privacy/validator.rb b/lib/packwerk/folder_privacy/validator.rb index 3660a8c..93bb14a 100644 --- a/lib/packwerk/folder_privacy/validator.rb +++ b/lib/packwerk/folder_privacy/validator.rb @@ -29,7 +29,7 @@ def call(package_set, configuration) sig { override.returns(T::Array[String]) } def permitted_keys - %w[enforce_folder_privacy] + %w(enforce_folder_privacy) end end end diff --git a/lib/packwerk/privacy/validator.rb b/lib/packwerk/privacy/validator.rb index 19a2f2f..33d43f4 100644 --- a/lib/packwerk/privacy/validator.rb +++ b/lib/packwerk/privacy/validator.rb @@ -31,7 +31,7 @@ def call(package_set, configuration) sig { override.returns(T::Array[String]) } def permitted_keys - %w[public_path enforce_privacy private_constants ignored_private_constants strict_privacy_ignored_patterns] + %w(public_path enforce_privacy private_constants ignored_private_constants strict_privacy_ignored_patterns) end private @@ -65,10 +65,10 @@ def verify_private_constants_setting(package_set, configuration) constant_locations.each do |name, location| results << if location - check_private_constant_location(configuration, package_set, name, location, config_file_path) - else - private_constant_unresolvable(name, config_file_path) - end + check_private_constant_location(configuration, package_set, name, location, config_file_path) + else + private_constant_unresolvable(name, config_file_path) + end end end @@ -104,8 +104,10 @@ def check_enforce_privacy_setting(config_file_path, setting) end sig do - params(configuration: Configuration, package_set: PackageSet, name: T.untyped, location: T.untyped, - config_file_path: T.untyped).returns(Result) + params( +configuration: Configuration, package_set: PackageSet, name: T.untyped, location: T.untyped, +config_file_path: T.untyped +).returns(Result) end def check_private_constant_location(configuration, package_set, name, location, config_file_path) declared_package = package_set.package_from_path(relative_path(configuration, config_file_path)) diff --git a/lib/packwerk/visibility/validator.rb b/lib/packwerk/visibility/validator.rb index f739218..c12a1f4 100644 --- a/lib/packwerk/visibility/validator.rb +++ b/lib/packwerk/visibility/validator.rb @@ -52,7 +52,7 @@ def call(package_set, configuration) sig { override.returns(T::Array[String]) } def permitted_keys - %w[visible_to enforce_visibility] + %w(visible_to enforce_visibility) end end end diff --git a/packwerk-extensions.gemspec b/packwerk-extensions.gemspec index 2d289a3..52e5404 100644 --- a/packwerk-extensions.gemspec +++ b/packwerk-extensions.gemspec @@ -19,11 +19,11 @@ Gem::Specification.new do |spec| 'public gem pushes.' end - spec.required_ruby_version = Gem::Requirement.new('>= 2.7') + spec.required_ruby_version = Gem::Requirement.new('>= 3.2') # Specify which files should be added to the gem when it is released. spec.files = Dir['README.md', 'lib/**/*'] - spec.add_dependency 'packwerk', '>= 2.2.1' + spec.add_dependency 'packwerk', '>= 3' spec.add_dependency 'railties', '>= 6.0.0' spec.add_dependency 'sorbet-runtime' spec.add_dependency 'zeitwerk' @@ -33,6 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'pry' spec.add_development_dependency 'rake' spec.add_development_dependency 'rubocop' + spec.add_development_dependency 'rubocop-gusto' spec.add_development_dependency 'sorbet' spec.add_development_dependency 'sorbet-static' spec.add_development_dependency 'tapioca' diff --git a/sorbet/rbi/gems/.gitattributes b/sorbet/rbi/gems/.gitattributes new file mode 100644 index 0000000..d9bb82a --- /dev/null +++ b/sorbet/rbi/gems/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-generated=true diff --git a/sorbet/rbi/gems/actioncable@7.0.4.rbi b/sorbet/rbi/gems/actioncable@7.0.4.rbi deleted file mode 100644 index bb99ced..0000000 --- a/sorbet/rbi/gems/actioncable@7.0.4.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `actioncable` gem. -# Please instead update this file by running `bin/tapioca gem actioncable`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/actionmailbox@7.0.4.rbi b/sorbet/rbi/gems/actionmailbox@7.0.4.rbi deleted file mode 100644 index 2d8eb4f..0000000 --- a/sorbet/rbi/gems/actionmailbox@7.0.4.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `actionmailbox` gem. -# Please instead update this file by running `bin/tapioca gem actionmailbox`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/actionmailer@7.0.4.rbi b/sorbet/rbi/gems/actionmailer@7.0.4.rbi deleted file mode 100644 index 2246788..0000000 --- a/sorbet/rbi/gems/actionmailer@7.0.4.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `actionmailer` gem. -# Please instead update this file by running `bin/tapioca gem actionmailer`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/actionpack@7.0.4.rbi b/sorbet/rbi/gems/actionpack@7.0.4.rbi deleted file mode 100644 index 9abfef6..0000000 --- a/sorbet/rbi/gems/actionpack@7.0.4.rbi +++ /dev/null @@ -1,19445 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `actionpack` gem. -# Please instead update this file by running `bin/tapioca gem actionpack`. - -# source://actionpack//lib/abstract_controller.rb#8 -module AbstractController - extend ::ActiveSupport::Autoload - - class << self - # source://actionpack//lib/abstract_controller.rb#24 - def eager_load!; end - end -end - -# Raised when a non-existing controller action is triggered. -# -# source://actionpack//lib/abstract_controller/base.rb#11 -class AbstractController::ActionNotFound < ::StandardError - include ::DidYouMean::Correctable - - # @return [ActionNotFound] a new instance of ActionNotFound - # - # source://actionpack//lib/abstract_controller/base.rb#14 - def initialize(message = T.unsafe(nil), controller = T.unsafe(nil), action = T.unsafe(nil)); end - - # source://actionpack//lib/abstract_controller/base.rb#12 - def action; end - - # source://actionpack//lib/abstract_controller/base.rb#12 - def controller; end - - # source://actionpack//lib/abstract_controller/base.rb#23 - def corrections; end -end - -# source://actionpack//lib/abstract_controller/asset_paths.rb#4 -module AbstractController::AssetPaths - extend ::ActiveSupport::Concern -end - -# AbstractController::Base is a low-level API. Nobody should be -# using it directly, and subclasses (like ActionController::Base) are -# expected to provide their own +render+ method, since rendering means -# different things depending on the context. -# -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://actionpack//lib/abstract_controller/base.rb#33 -class AbstractController::Base - include ::ActiveSupport::Configurable - extend ::ActiveSupport::Configurable::ClassMethods - extend ::ActiveSupport::DescendantsTracker - - # Delegates to the class's ::action_methods. - # - # source://actionpack//lib/abstract_controller/base.rb#161 - def action_methods; end - - # Returns the name of the action this controller is processing. - # - # source://activesupport/7.0.4/lib/active_support/core_ext/module/attr_internal.rb#33 - def action_name; end - - # source://activesupport/7.0.4/lib/active_support/core_ext/module/attr_internal.rb#33 - def action_name=(_arg0); end - - # Returns true if a method for the action is available and - # can be dispatched, false otherwise. - # - # Notice that action_methods.include?("foo") may return - # false and available_action?("foo") returns true because - # this method considers actions that are also available - # through other means, for example, implicit render ones. - # - # ==== Parameters - # * action_name - The name of an action to be tested - # - # @return [Boolean] - # - # source://actionpack//lib/abstract_controller/base.rb#175 - def available_action?(action_name); end - - # Delegates to the class's ::controller_path. - # - # source://actionpack//lib/abstract_controller/base.rb#156 - def controller_path; end - - # Returns the formats that can be processed by the controller. - # - # source://activesupport/7.0.4/lib/active_support/core_ext/module/attr_internal.rb#33 - def formats; end - - # source://activesupport/7.0.4/lib/active_support/core_ext/module/attr_internal.rb#33 - def formats=(_arg0); end - - # source://actionpack//lib/abstract_controller/base.rb#194 - def inspect; end - - # Tests if a response body is set. Used to determine if the - # +process_action+ callback needs to be terminated in - # AbstractController::Callbacks. - # - # @return [Boolean] - # - # source://actionpack//lib/abstract_controller/base.rb#182 - def performed?; end - - # Calls the action going through the entire action dispatch stack. - # - # The actual method that is called is determined by calling - # #method_for_action. If no method can handle the action, then an - # AbstractController::ActionNotFound error is raised. - # - # ==== Returns - # * self - # - # source://actionpack//lib/abstract_controller/base.rb#142 - def process(action, *args); end - - # Returns the body of the HTTP response sent by the controller. - # - # source://activesupport/7.0.4/lib/active_support/core_ext/module/attr_internal.rb#33 - def response_body; end - - # source://activesupport/7.0.4/lib/active_support/core_ext/module/attr_internal.rb#33 - def response_body=(_arg0); end - - # Actually call the method associated with the action. Override - # this method if you wish to change how action methods are called, - # not to add additional behavior around it. For example, you would - # override #send_action if you want to inject arguments into the - # method. - def send_action(*_arg0); end - - private - - # Takes an action name and returns the name of the method that will - # handle the action. - # - # It checks if the action name is valid and returns false otherwise. - # - # See method_for_action for more information. - # - # ==== Parameters - # * action_name - An action name to find a method name for - # - # ==== Returns - # * string - The name of the method that handles the action - # * false - No valid method name could be found. - # Raise +AbstractController::ActionNotFound+. - # - # source://actionpack//lib/abstract_controller/base.rb#246 - def _find_action_name(action_name); end - - # If the action name was not found, but a method called "action_missing" - # was found, #method_for_action will return "_handle_action_missing". - # This method calls #action_missing with the current action name. - # - # source://actionpack//lib/abstract_controller/base.rb#228 - def _handle_action_missing(*args); end - - # Checks if the action name is valid and returns false otherwise. - # - # @return [Boolean] - # - # source://actionpack//lib/abstract_controller/base.rb#282 - def _valid_action_name?(action_name); end - - # Returns true if the name can be considered an action because - # it has a method defined in the controller. - # - # ==== Parameters - # * name - The name of an action to be tested - # - # @return [Boolean] - # - # source://actionpack//lib/abstract_controller/base.rb#204 - def action_method?(name); end - - # Takes an action name and returns the name of the method that will - # handle the action. In normal cases, this method returns the same - # name as it receives. By default, if #method_for_action receives - # a name that is not an action, it will look for an #action_missing - # method and return "_handle_action_missing" if one is found. - # - # Subclasses may override this method to add additional conditions - # that should be considered an action. For instance, an HTTP controller - # with a template matching the action name is considered to exist. - # - # If you override this method to handle additional cases, you may - # also provide a method (like +_handle_method_missing+) to handle - # the case. - # - # If none of these conditions are true, and +method_for_action+ - # returns +nil+, an +AbstractController::ActionNotFound+ exception will be raised. - # - # ==== Parameters - # * action_name - An action name to find a method name for - # - # ==== Returns - # * string - The name of the method that handles the action - # * nil - No method name could be found. - # - # source://actionpack//lib/abstract_controller/base.rb#273 - def method_for_action(action_name); end - - # Call the action. Override this in a subclass to modify the - # behavior around processing an action. This, and not #process, - # is the intended way to override action dispatching. - # - # Notice that the first argument is the method to be dispatched - # which is *not* necessarily the same as the action name. - # - # source://actionpack//lib/abstract_controller/base.rb#214 - def process_action(*_arg0, &_arg1); end - - class << self - # Returns the value of attribute abstract. - # - # source://actionpack//lib/abstract_controller/base.rb#50 - def abstract; end - - # Define a controller as abstract. See internal_methods for more - # details. - # - # source://actionpack//lib/abstract_controller/base.rb#55 - def abstract!; end - - # Returns the value of attribute abstract. - # - # source://actionpack//lib/abstract_controller/base.rb#50 - def abstract?; end - - # A list of method names that should be considered actions. This - # includes all public instance methods on a controller, less - # any internal methods (see internal_methods), adding back in - # any methods that are internal, but still exist on the class - # itself. - # - # ==== Returns - # * Set - A set of all methods that should be considered actions. - # - # source://actionpack//lib/abstract_controller/base.rb#89 - def action_methods; end - - # action_methods are cached and there is sometimes a need to refresh - # them. ::clear_action_methods! allows you to do that, so next time - # you run action_methods, they will be recalculated. - # - # source://actionpack//lib/abstract_controller/base.rb#107 - def clear_action_methods!; end - - # Returns the full controller name, underscored, without the ending Controller. - # - # class MyApp::MyPostsController < AbstractController::Base - # - # end - # - # MyApp::MyPostsController.controller_path # => "my_app/my_posts" - # - # ==== Returns - # * String - # - # source://actionpack//lib/abstract_controller/base.rb#121 - def controller_path; end - - # source://actionpack//lib/abstract_controller/base.rb#59 - def inherited(klass); end - - # A list of all internal methods for a controller. This finds the first - # abstract superclass of a controller, and gets a list of all public - # instance methods on that abstract class. Public instance methods of - # a controller would normally be considered action methods, so methods - # declared on abstract classes are being removed. - # (ActionController::Metal and ActionController::Base are defined as abstract) - # - # source://actionpack//lib/abstract_controller/base.rb#74 - def internal_methods; end - - # Refresh the cached action_methods when a new action_method is added. - # - # source://actionpack//lib/abstract_controller/base.rb#126 - def method_added(name); end - - # Returns true if the given controller is capable of rendering - # a path. A subclass of +AbstractController::Base+ - # may return false. An Email controller for example does not - # support paths, only full URLs. - # - # @return [Boolean] - # - # source://actionpack//lib/abstract_controller/base.rb#190 - def supports_path?; end - end -end - -# source://actionpack//lib/abstract_controller/caching.rb#4 -module AbstractController::Caching - include ::AbstractController::Caching::ConfigMethods - extend ::ActiveSupport::Concern - extend ::ActiveSupport::Autoload - include GeneratedInstanceMethods - include ::AbstractController::Caching::Fragments - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods - mixes_in_class_methods ::AbstractController::Caching::ClassMethods - mixes_in_class_methods ::AbstractController::Caching::ConfigMethods - - # source://actionpack//lib/abstract_controller/caching.rb#52 - def view_cache_dependencies; end - - private - - # Convenience accessor. - # - # source://actionpack//lib/abstract_controller/caching.rb#58 - def cache(key, options = T.unsafe(nil), &block); end - - module GeneratedClassMethods - def _view_cache_dependencies; end - def _view_cache_dependencies=(value); end - def _view_cache_dependencies?; end - def fragment_cache_keys; end - def fragment_cache_keys=(value); end - def fragment_cache_keys?; end - end - - module GeneratedInstanceMethods - def _view_cache_dependencies; end - def _view_cache_dependencies=(value); end - def _view_cache_dependencies?; end - def fragment_cache_keys; end - def fragment_cache_keys=(value); end - def fragment_cache_keys?; end - end -end - -# source://actionpack//lib/abstract_controller/caching.rb#46 -module AbstractController::Caching::ClassMethods - # source://actionpack//lib/abstract_controller/caching.rb#47 - def view_cache_dependency(&dependency); end -end - -# source://actionpack//lib/abstract_controller/caching.rb#12 -module AbstractController::Caching::ConfigMethods - # source://actionpack//lib/abstract_controller/caching.rb#13 - def cache_store; end - - # source://actionpack//lib/abstract_controller/caching.rb#17 - def cache_store=(store); end - - private - - # @return [Boolean] - # - # source://actionpack//lib/abstract_controller/caching.rb#22 - def cache_configured?; end -end - -# Fragment caching is used for caching various blocks within -# views without caching the entire action as a whole. This is -# useful when certain elements of an action change frequently or -# depend on complicated state while other parts rarely change or -# can be shared amongst multiple parties. The caching is done using -# the +cache+ helper available in the Action View. See -# ActionView::Helpers::CacheHelper for more information. -# -# While it's strongly recommended that you use key-based cache -# expiration (see links in CacheHelper for more information), -# it is also possible to manually expire caches. For example: -# -# expire_fragment('name_of_cache') -# -# source://actionpack//lib/abstract_controller/caching/fragments.rb#18 -module AbstractController::Caching::Fragments - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods - - # Given a key (as described in +expire_fragment+), returns - # a key array suitable for use in reading, writing, or expiring a - # cached fragment. All keys begin with :views, - # followed by ENV["RAILS_CACHE_ID"] or ENV["RAILS_APP_VERSION"] if set, - # followed by any controller-wide key prefix values, ending - # with the specified +key+ value. - # - # source://actionpack//lib/abstract_controller/caching/fragments.rb#68 - def combined_fragment_cache_key(key); end - - # Removes fragments from the cache. - # - # +key+ can take one of three forms: - # - # * String - This would normally take the form of a path, like - # pages/45/notes. - # * Hash - Treated as an implicit call to +url_for+, like - # { controller: 'pages', action: 'notes', id: 45} - # * Regexp - Will remove any fragment that matches, so - # %r{pages/\d*/notes} might remove all notes. Make sure you - # don't use anchors in the regex (^ or $) because - # the actual filename matched looks like - # ./cache/filename/path.cache. Note: Regexp expiration is - # only supported on caches that can iterate over all keys (unlike - # memcached). - # - # +options+ is passed through to the cache store's +delete+ - # method (or delete_matched, for Regexp keys). - # - # source://actionpack//lib/abstract_controller/caching/fragments.rb#132 - def expire_fragment(key, options = T.unsafe(nil)); end - - # Check if a cached fragment from the location signified by - # +key+ exists (see +expire_fragment+ for acceptable formats). - # - # @return [Boolean] - # - # source://actionpack//lib/abstract_controller/caching/fragments.rb#105 - def fragment_exist?(key, options = T.unsafe(nil)); end - - # source://actionpack//lib/abstract_controller/caching/fragments.rb#145 - def instrument_fragment_cache(name, key, &block); end - - # Reads a cached fragment from the location signified by +key+ - # (see +expire_fragment+ for acceptable formats). - # - # source://actionpack//lib/abstract_controller/caching/fragments.rb#93 - def read_fragment(key, options = T.unsafe(nil)); end - - # Writes +content+ to the location signified by - # +key+ (see +expire_fragment+ for acceptable formats). - # - # source://actionpack//lib/abstract_controller/caching/fragments.rb#80 - def write_fragment(key, content, options = T.unsafe(nil)); end - - module GeneratedClassMethods - def fragment_cache_keys; end - def fragment_cache_keys=(value); end - def fragment_cache_keys?; end - end - - module GeneratedInstanceMethods - def fragment_cache_keys; end - def fragment_cache_keys=(value); end - def fragment_cache_keys?; end - end -end - -# source://actionpack//lib/abstract_controller/caching/fragments.rb#35 -module AbstractController::Caching::Fragments::ClassMethods - # Allows you to specify controller-wide key prefixes for - # cache fragments. Pass either a constant +value+, or a block - # which computes a value each time a cache key is generated. - # - # For example, you may want to prefix all fragment cache keys - # with a global version identifier, so you can easily - # invalidate all caches. - # - # class ApplicationController - # fragment_cache_key "v1" - # end - # - # When it's time to invalidate all fragments, simply change - # the string constant. Or, progressively roll out the cache - # invalidation using a computed value: - # - # class ApplicationController - # fragment_cache_key do - # @account.id.odd? ? "v1" : "v2" - # end - # end - # - # source://actionpack//lib/abstract_controller/caching/fragments.rb#57 - def fragment_cache_key(value = T.unsafe(nil), &key); end -end - -# = Abstract Controller Callbacks -# -# Abstract Controller provides hooks during the life cycle of a controller action. -# Callbacks allow you to trigger logic during this cycle. Available callbacks are: -# -# * after_action -# * append_after_action -# * append_around_action -# * append_before_action -# * around_action -# * before_action -# * prepend_after_action -# * prepend_around_action -# * prepend_before_action -# * skip_after_action -# * skip_around_action -# * skip_before_action -# -# NOTE: Calling the same callback multiple times will overwrite previous callback definitions. -# -# source://actionpack//lib/abstract_controller/callbacks.rb#24 -module AbstractController::Callbacks - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - include ::ActiveSupport::Callbacks - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods - mixes_in_class_methods ::ActiveSupport::DescendantsTracker - mixes_in_class_methods ::AbstractController::Callbacks::ClassMethods - - private - - # Override AbstractController::Base#process_action to run the - # process_action callbacks around the normal behavior. - # - # source://actionpack//lib/abstract_controller/callbacks.rb#232 - def process_action(*_arg0, &_arg1); end - - module GeneratedClassMethods - def __callbacks; end - def __callbacks=(value); end - def __callbacks?; end - end - - module GeneratedInstanceMethods - def __callbacks; end - def __callbacks?; end - end -end - -# source://actionpack//lib/abstract_controller/callbacks.rb#38 -class AbstractController::Callbacks::ActionFilter - # @return [ActionFilter] a new instance of ActionFilter - # - # source://actionpack//lib/abstract_controller/callbacks.rb#39 - def initialize(actions); end - - # @return [Boolean] - # - # source://actionpack//lib/abstract_controller/callbacks.rb#43 - def after(controller); end - - # @return [Boolean] - # - # source://actionpack//lib/abstract_controller/callbacks.rb#43 - def around(controller); end - - # @return [Boolean] - # - # source://actionpack//lib/abstract_controller/callbacks.rb#43 - def before(controller); end - - # @return [Boolean] - # - # source://actionpack//lib/abstract_controller/callbacks.rb#43 - def match?(controller); end -end - -# source://actionpack//lib/abstract_controller/callbacks.rb#52 -module AbstractController::Callbacks::ClassMethods - # Take callback names and an optional callback proc, normalize them, - # then call the block with each callback. This allows us to abstract - # the normalization across several methods that use it. - # - # ==== Parameters - # * callbacks - An array of callbacks, with an optional - # options hash as the last parameter. - # * block - A proc that should be added to the callbacks. - # - # ==== Block Parameters - # * name - The callback to be added. - # * options - A hash of options to be used when adding the callback. - # - # source://actionpack//lib/abstract_controller/callbacks.rb#96 - def _insert_callbacks(callbacks, block = T.unsafe(nil)); end - - # source://actionpack//lib/abstract_controller/callbacks.rb#77 - def _normalize_callback_option(options, from, to); end - - # If +:only+ or +:except+ are used, convert the options into the - # +:if+ and +:unless+ options of ActiveSupport::Callbacks. - # - # The basic idea is that :only => :index gets converted to - # :if => proc {|c| c.action_name == "index" }. - # - # Note that :only has priority over :if in case they - # are used together. - # - # only: :index, if: -> { true } # the :if option will be ignored. - # - # Note that :if has priority over :except in case they - # are used together. - # - # except: :index, if: -> { true } # the :except option will be ignored. - # - # ==== Options - # * only - The callback should be run only for this action. - # * except - The callback should be run for all actions except this action. - # - # source://actionpack//lib/abstract_controller/callbacks.rb#72 - def _normalize_callback_options(options); end - - # source://actionpack//lib/abstract_controller/callbacks.rb#204 - def after_action(*names, &blk); end - - # source://actionpack//lib/abstract_controller/callbacks.rb#204 - def append_after_action(*names, &blk); end - - # source://actionpack//lib/abstract_controller/callbacks.rb#204 - def append_around_action(*names, &blk); end - - # source://actionpack//lib/abstract_controller/callbacks.rb#204 - def append_before_action(*names, &blk); end - - # source://actionpack//lib/abstract_controller/callbacks.rb#204 - def around_action(*names, &blk); end - - # source://actionpack//lib/abstract_controller/callbacks.rb#204 - def before_action(*names, &blk); end - - # source://actionpack//lib/abstract_controller/callbacks.rb#210 - def prepend_after_action(*names, &blk); end - - # source://actionpack//lib/abstract_controller/callbacks.rb#210 - def prepend_around_action(*names, &blk); end - - # source://actionpack//lib/abstract_controller/callbacks.rb#210 - def prepend_before_action(*names, &blk); end - - # source://actionpack//lib/abstract_controller/callbacks.rb#218 - def skip_after_action(*names); end - - # source://actionpack//lib/abstract_controller/callbacks.rb#218 - def skip_around_action(*names); end - - # source://actionpack//lib/abstract_controller/callbacks.rb#218 - def skip_before_action(*names); end -end - -# source://actionpack//lib/abstract_controller/collector.rb#6 -module AbstractController::Collector - # source://actionpack//lib/abstract_controller/collector.rb#10 - def atom(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def bmp(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def css(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def csv(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def gif(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def gzip(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def html(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def ics(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def jpeg(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def js(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def json(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def m4a(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def mp3(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def mp4(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def mpeg(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def multipart_form(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def ogg(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def otf(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def pdf(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def png(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def rss(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def svg(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def text(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def tiff(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def ttf(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def url_encoded_form(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def vcf(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def vtt(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def webm(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def woff(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def woff2(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def xml(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def yaml(*args, &block); end - - # source://actionpack//lib/abstract_controller/collector.rb#10 - def zip(*args, &block); end - - private - - # source://actionpack//lib/abstract_controller/collector.rb#26 - def method_missing(symbol, *args, &block); end - - class << self - # source://actionpack//lib/abstract_controller/collector.rb#7 - def generate_method_for_mime(mime); end - end -end - -# source://actionpack//lib/abstract_controller/rendering.rb#9 -class AbstractController::DoubleRenderError < ::AbstractController::Error - # @return [DoubleRenderError] a new instance of DoubleRenderError - # - # source://actionpack//lib/abstract_controller/rendering.rb#12 - def initialize(message = T.unsafe(nil)); end -end - -# source://actionpack//lib/abstract_controller/rendering.rb#10 -AbstractController::DoubleRenderError::DEFAULT_MESSAGE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/abstract_controller/error.rb#4 -class AbstractController::Error < ::StandardError; end - -# source://actionpack//lib/abstract_controller/helpers.rb#7 -module AbstractController::Helpers - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::AbstractController::Helpers::ClassMethods - - # source://actionpack//lib/abstract_controller/helpers.rb#40 - def _helpers; end - - module GeneratedClassMethods - def _helper_methods; end - def _helper_methods=(value); end - def _helper_methods?; end - end - - module GeneratedInstanceMethods - def _helper_methods; end - def _helper_methods=(value); end - def _helper_methods?; end - end -end - -# source://actionpack//lib/abstract_controller/helpers.rb#44 -module AbstractController::Helpers::ClassMethods - # Sets the attribute _helpers - # - # @param value the value to set the attribute _helpers to. - # - # source://actionpack//lib/abstract_controller/helpers.rb#56 - def _helpers=(_arg0); end - - # source://actionpack//lib/abstract_controller/helpers.rb#184 - def _helpers_for_modification; end - - # Clears up all existing helpers in this class, only keeping the helper - # with the same name as this class. - # - # source://actionpack//lib/abstract_controller/helpers.rb#158 - def clear_helpers; end - - # Includes the given modules in the template class. - # - # Modules can be specified in different ways. All of the following calls - # include +FooHelper+: - # - # # Module, recommended. - # helper FooHelper - # - # # String/symbol without the "helper" suffix, camel or snake case. - # helper "Foo" - # helper :Foo - # helper "foo" - # helper :foo - # - # The last two assume that "foo".camelize returns "Foo". - # - # When strings or symbols are passed, the method finds the actual module - # object using String#constantize. Therefore, if the module has not been - # yet loaded, it has to be autoloadable, which is normally the case. - # - # Namespaces are supported. The following calls include +Foo::BarHelper+: - # - # # Module, recommended. - # helper Foo::BarHelper - # - # # String/symbol without the "helper" suffix, camel or snake case. - # helper "Foo::Bar" - # helper :"Foo::Bar" - # helper "foo/bar" - # helper :"foo/bar" - # - # The last two assume that "foo/bar".camelize returns "Foo::Bar". - # - # The method accepts a block too. If present, the block is evaluated in - # the context of the controller helper module. This simple call makes the - # +wadus+ method available in templates of the enclosing controller: - # - # helper do - # def wadus - # "wadus" - # end - # end - # - # Furthermore, all the above styles can be mixed together: - # - # helper FooHelper, "woo", "bar/baz" do - # def wadus - # "wadus" - # end - # end - # - # source://actionpack//lib/abstract_controller/helpers.rb#147 - def helper(*args, &block); end - - # Declare a controller method as a helper. For example, the following - # makes the +current_user+ and +logged_in?+ controller methods available - # to the view: - # class ApplicationController < ActionController::Base - # helper_method :current_user, :logged_in? - # - # def current_user - # @current_user ||= User.find_by(id: session[:user]) - # end - # - # def logged_in? - # current_user != nil - # end - # end - # - # In a view: - # <% if logged_in? -%>Welcome, <%= current_user.name %><% end -%> - # - # ==== Parameters - # * method[, method] - A name or names of a method on the controller - # to be made available on the view. - # - # source://actionpack//lib/abstract_controller/helpers.rb#79 - def helper_method(*methods); end - - # When a class is inherited, wrap its helper module in a new module. - # This ensures that the parent class's module can be changed - # independently of the child class's. - # - # source://actionpack//lib/abstract_controller/helpers.rb#48 - def inherited(klass); end - - # Given an array of values like the ones accepted by +helper+, this method - # returns an array with the corresponding modules, in the same order. - # - # source://actionpack//lib/abstract_controller/helpers.rb#169 - def modules_for_helpers(modules_or_helper_prefixes); end - - private - - # source://actionpack//lib/abstract_controller/helpers.rb#203 - def default_helper_module!; end - - # source://actionpack//lib/abstract_controller/helpers.rb#192 - def define_helpers_module(klass, helpers = T.unsafe(nil)); end -end - -# source://actionpack//lib/abstract_controller/helpers.rb#26 -class AbstractController::Helpers::MissingHelperError < ::LoadError - # @return [MissingHelperError] a new instance of MissingHelperError - # - # source://actionpack//lib/abstract_controller/helpers.rb#27 - def initialize(error, path); end -end - -# source://actionpack//lib/abstract_controller/logger.rb#6 -module AbstractController::Logger - extend ::ActiveSupport::Concern - include ::ActiveSupport::Benchmarkable -end - -# source://actionpack//lib/abstract_controller/railties/routes_helpers.rb#6 -module AbstractController::Railties; end - -# source://actionpack//lib/abstract_controller/railties/routes_helpers.rb#7 -module AbstractController::Railties::RoutesHelpers - class << self - # source://actionpack//lib/abstract_controller/railties/routes_helpers.rb#8 - def with(routes, include_path_helpers = T.unsafe(nil)); end - end -end - -# source://actionpack//lib/abstract_controller/rendering.rb#17 -module AbstractController::Rendering - extend ::ActiveSupport::Concern - include ::ActionView::ViewPaths - - mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods - - # Normalizes arguments, options and then delegates render_to_body and - # sticks the result in self.response_body. - # - # source://actionpack//lib/abstract_controller/rendering.rb#23 - def render(*args, &block); end - - # Performs the actual template rendering. - # - # source://actionpack//lib/abstract_controller/rendering.rb#51 - def render_to_body(options = T.unsafe(nil)); end - - # Raw rendering of a template to a string. - # - # It is similar to render, except that it does not - # set the +response_body+ and it should be guaranteed - # to always return a string. - # - # If a component extends the semantics of +response_body+ - # (as ActionController extends it to be anything that - # responds to the method each), this method needs to be - # overridden in order to still return a string. - # - # source://actionpack//lib/abstract_controller/rendering.rb#45 - def render_to_string(*args, &block); end - - # Returns Content-Type of rendered content. - # - # source://actionpack//lib/abstract_controller/rendering.rb#55 - def rendered_format; end - - # This method should return a hash with assigns. - # You can overwrite this configuration per controller. - # - # source://actionpack//lib/abstract_controller/rendering.rb#63 - def view_assigns; end - - private - - # Normalize args by converting render "foo" to - # render :action => "foo" and render "foo/bar" to - # render :file => "foo/bar". - # - # source://actionpack//lib/abstract_controller/rendering.rb#75 - def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end - - # Normalize options. - # - # source://actionpack//lib/abstract_controller/rendering.rb#90 - def _normalize_options(options); end - - # Normalize args and options. - # - # source://actionpack//lib/abstract_controller/rendering.rb#116 - def _normalize_render(*args, &block); end - - # Process the rendered format. - # - # source://actionpack//lib/abstract_controller/rendering.rb#100 - def _process_format(format); end - - # Process extra options. - # - # source://actionpack//lib/abstract_controller/rendering.rb#95 - def _process_options(options); end - - # source://actionpack//lib/abstract_controller/rendering.rb#103 - def _process_variant(options); end - - # source://actionpack//lib/abstract_controller/rendering.rb#123 - def _protected_ivars; end - - # source://actionpack//lib/abstract_controller/rendering.rb#106 - def _set_html_content_type; end - - # source://actionpack//lib/abstract_controller/rendering.rb#112 - def _set_rendered_content_type(format); end - - # source://actionpack//lib/abstract_controller/rendering.rb#109 - def _set_vary_header; end -end - -# source://actionpack//lib/abstract_controller/rendering.rb#59 -AbstractController::Rendering::DEFAULT_PROTECTED_INSTANCE_VARIABLES = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/abstract_controller/translation.rb#6 -module AbstractController::Translation - # Delegates to I18n.localize. Also aliased as l. - # - # source://actionpack//lib/abstract_controller/translation.rb#33 - def l(object, **options); end - - # Delegates to I18n.localize. Also aliased as l. - # - # source://actionpack//lib/abstract_controller/translation.rb#33 - def localize(object, **options); end - - # source://actionpack//lib/abstract_controller/translation.rb#7 - def raise_on_missing_translations; end - - # source://actionpack//lib/abstract_controller/translation.rb#7 - def raise_on_missing_translations=(val); end - - # Delegates to I18n.translate. Also aliased as t. - # - # When the given key starts with a period, it will be scoped by the current - # controller and action. So if you call translate(".foo") from - # PeopleController#index, it will convert the call to - # I18n.translate("people.index.foo"). This makes it less repetitive - # to translate many keys within the same controller / action and gives you a - # simple framework for scoping them consistently. - # - # source://actionpack//lib/abstract_controller/translation.rb#17 - def t(key, **options); end - - # Delegates to I18n.translate. Also aliased as t. - # - # When the given key starts with a period, it will be scoped by the current - # controller and action. So if you call translate(".foo") from - # PeopleController#index, it will convert the call to - # I18n.translate("people.index.foo"). This makes it less repetitive - # to translate many keys within the same controller / action and gives you a - # simple framework for scoping them consistently. - # - # source://actionpack//lib/abstract_controller/translation.rb#17 - def translate(key, **options); end - - class << self - # source://actionpack//lib/abstract_controller/translation.rb#7 - def raise_on_missing_translations; end - - # source://actionpack//lib/abstract_controller/translation.rb#7 - def raise_on_missing_translations=(val); end - end -end - -# Includes +url_for+ into the host class (e.g. an abstract controller or mailer). The class -# has to provide a +RouteSet+ by implementing the _routes methods. Otherwise, an -# exception will be raised. -# -# Note that this module is completely decoupled from HTTP - the only requirement is a valid -# _routes implementation. -# -# source://actionpack//lib/abstract_controller/url_for.rb#10 -module AbstractController::UrlFor - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - include ::ActionDispatch::Routing::UrlFor - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods - - # source://actionpack//lib/abstract_controller/url_for.rb#14 - def _routes; end - - module GeneratedClassMethods - def default_url_options; end - def default_url_options=(value); end - def default_url_options?; end - end - - module GeneratedInstanceMethods - def default_url_options; end - def default_url_options=(value); end - def default_url_options?; end - end -end - -# source://actionpack//lib/abstract_controller/url_for.rb#19 -module AbstractController::UrlFor::ClassMethods - # source://actionpack//lib/abstract_controller/url_for.rb#20 - def _routes; end - - # source://actionpack//lib/abstract_controller/url_for.rb#24 - def action_methods; end -end - -# source://actionpack//lib/action_controller/metal/strong_parameters.rb#13 -module ActionController - extend ::ActiveSupport::Autoload - - class << self - # See Renderers.add - # - # source://actionpack//lib/action_controller/metal/renderers.rb#7 - def add_renderer(key, &block); end - - # See Renderers.remove - # - # source://actionpack//lib/action_controller/metal/renderers.rb#12 - def remove_renderer(key); end - end -end - -# API Controller is a lightweight version of ActionController::Base, -# created for applications that don't require all functionalities that a complete -# \Rails controller provides, allowing you to create controllers with just the -# features that you need for API only applications. -# -# An API Controller is different from a normal controller in the sense that -# by default it doesn't include a number of features that are usually required -# by browser access only: layouts and templates rendering, -# flash, assets, and so on. This makes the entire controller stack thinner, -# suitable for API applications. It doesn't mean you won't have such -# features if you need them: they're all available for you to include in -# your application, they're just not part of the default API controller stack. -# -# Normally, +ApplicationController+ is the only controller that inherits from -# ActionController::API. All other controllers in turn inherit from -# +ApplicationController+. -# -# A sample controller could look like this: -# -# class PostsController < ApplicationController -# def index -# posts = Post.all -# render json: posts -# end -# end -# -# Request, response, and parameters objects all work the exact same way as -# ActionController::Base. -# -# == Renders -# -# The default API Controller stack includes all renderers, which means you -# can use render :json and siblings freely in your controllers. Keep -# in mind that templates are not going to be rendered, so you need to ensure -# your controller is calling either render or redirect_to in -# all actions, otherwise it will return 204 No Content. -# -# def show -# post = Post.find(params[:id]) -# render json: post -# end -# -# == Redirects -# -# Redirects are used to move from one action to another. You can use the -# redirect_to method in your controllers in the same way as in -# ActionController::Base. For example: -# -# def create -# redirect_to root_url and return if not_authorized? -# # do stuff here -# end -# -# == Adding New Behavior -# -# In some scenarios you may want to add back some functionality provided by -# ActionController::Base that is not present by default in -# ActionController::API, for instance MimeResponds. This -# module gives you the respond_to method. Adding it is quite simple, -# you just need to include the module in a specific controller or in -# +ApplicationController+ in case you want it available in your entire -# application: -# -# class ApplicationController < ActionController::API -# include ActionController::MimeResponds -# end -# -# class PostsController < ApplicationController -# def index -# posts = Post.all -# -# respond_to do |format| -# format.json { render json: posts } -# format.xml { render xml: posts } -# end -# end -# end -# -# Make sure to check the modules included in ActionController::Base -# if you want to use any other functionality that is not provided -# by ActionController::API out of the box. -# -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://actionpack//lib/action_controller/api.rb#89 -class ActionController::API < ::ActionController::Metal - include ::ActionView::ViewPaths - include ::AbstractController::Rendering - include ::ActionDispatch::Routing::PolymorphicRoutes - include ::ActionDispatch::Routing::UrlFor - include ::AbstractController::UrlFor - include ::ActionController::UrlFor - include ::AbstractController::Logger - include ::ActiveSupport::Benchmarkable - include ::ActionController::Redirecting - include ::ActionController::ApiRendering - include ::ActionController::Rendering - include ::ActionController::Renderers - include ::ActionController::Renderers::All - include ::ActionController::Head - include ::ActionController::ConditionalGet - include ::ActionController::BasicImplicitRender - include ::ActionController::StrongParameters - include ::ActionController::DataStreaming - include ::ActionController::DefaultHeaders - include ::ActionController::Logging - include ::ActiveSupport::Callbacks - include ::AbstractController::Callbacks - include ::ActiveSupport::Rescuable - include ::ActionController::Rescue - include ::ActionController::Instrumentation - include ::ActionController::ParamsWrapper - extend ::ActionView::ViewPaths::ClassMethods - extend ::AbstractController::UrlFor::ClassMethods - extend ::ActionController::Rendering::ClassMethods - extend ::ActionController::Renderers::ClassMethods - extend ::ActionController::ConditionalGet::ClassMethods - extend ::ActionController::DefaultHeaders::ClassMethods - extend ::ActionController::Logging::ClassMethods - extend ::ActiveSupport::Callbacks::ClassMethods - extend ::AbstractController::Callbacks::ClassMethods - extend ::ActiveSupport::Rescuable::ClassMethods - extend ::ActionController::Instrumentation::ClassMethods - extend ::ActionController::ParamsWrapper::ClassMethods - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks?; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#940 - def _process_action_callbacks; end - - # source://actionpack//lib/action_controller/metal/renderers.rb#31 - def _renderers; end - - # source://actionpack//lib/action_controller/metal/renderers.rb#31 - def _renderers=(_arg0); end - - # source://actionpack//lib/action_controller/metal/renderers.rb#31 - def _renderers?; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#928 - def _run_process_action_callbacks(&block); end - - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 - def _wrapper_options; end - - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 - def _wrapper_options=(_arg0); end - - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 - def _wrapper_options?; end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options; end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options=(_arg0); end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options?; end - - # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 - def etaggers; end - - # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 - def etaggers=(_arg0); end - - # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 - def etaggers?; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def logger; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def logger=(value); end - - # source://actionpack//lib/action_controller/metal/redirecting.rb#13 - def raise_on_open_redirects; end - - # source://actionpack//lib/action_controller/metal/redirecting.rb#13 - def raise_on_open_redirects=(val); end - - # source://activesupport/7.0.4/lib/active_support/rescuable.rb#13 - def rescue_handlers; end - - # source://activesupport/7.0.4/lib/active_support/rescuable.rb#13 - def rescue_handlers=(_arg0); end - - # source://activesupport/7.0.4/lib/active_support/rescuable.rb#13 - def rescue_handlers?; end - - class << self - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks=(value); end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks?; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#932 - def _process_action_callbacks; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#936 - def _process_action_callbacks=(value); end - - # source://actionpack//lib/action_controller/metal/renderers.rb#31 - def _renderers; end - - # source://actionpack//lib/action_controller/metal/renderers.rb#31 - def _renderers=(value); end - - # source://actionpack//lib/action_controller/metal/renderers.rb#31 - def _renderers?; end - - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 - def _wrapper_options; end - - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 - def _wrapper_options=(value); end - - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 - def _wrapper_options?; end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options; end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options=(value); end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options?; end - - # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 - def etaggers; end - - # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 - def etaggers=(value); end - - # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 - def etaggers?; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def logger; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def logger=(value); end - - # source://actionpack//lib/action_controller/metal.rb#210 - def middleware_stack; end - - # source://actionpack//lib/action_controller/metal/redirecting.rb#13 - def raise_on_open_redirects; end - - # source://actionpack//lib/action_controller/metal/redirecting.rb#13 - def raise_on_open_redirects=(val); end - - # source://activesupport/7.0.4/lib/active_support/rescuable.rb#13 - def rescue_handlers; end - - # source://activesupport/7.0.4/lib/active_support/rescuable.rb#13 - def rescue_handlers=(value); end - - # source://activesupport/7.0.4/lib/active_support/rescuable.rb#13 - def rescue_handlers?; end - - # Shortcut helper that returns all the ActionController::API modules except - # the ones passed as arguments: - # - # class MyAPIBaseController < ActionController::Metal - # ActionController::API.without_modules(:UrlFor).each do |left| - # include left - # end - # end - # - # This gives better control over what you want to exclude and makes it easier - # to create an API controller class, instead of listing the modules required - # manually. - # - # source://actionpack//lib/action_controller/api.rb#104 - def without_modules(*modules); end - end -end - -# source://actionpack//lib/action_controller/api.rb#112 -ActionController::API::MODULES = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_controller/metal/exceptions.rb#4 -class ActionController::ActionControllerError < ::StandardError; end - -# source://actionpack//lib/action_controller/api/api_rendering.rb#4 -module ActionController::ApiRendering - extend ::ActiveSupport::Concern - include ::ActionController::Rendering - - mixes_in_class_methods ::ActionController::Rendering::ClassMethods - - # source://actionpack//lib/action_controller/api/api_rendering.rb#11 - def render_to_body(options = T.unsafe(nil)); end -end - -# source://actionpack//lib/action_controller/metal/exceptions.rb#7 -class ActionController::BadRequest < ::ActionController::ActionControllerError - # @return [BadRequest] a new instance of BadRequest - # - # source://actionpack//lib/action_controller/metal/exceptions.rb#8 - def initialize(msg = T.unsafe(nil)); end -end - -# Action Controllers are the core of a web request in \Rails. They are made up of one or more actions that are executed -# on request and then either it renders a template or redirects to another action. An action is defined as a public method -# on the controller, which will automatically be made accessible to the web-server through \Rails Routes. -# -# By default, only the ApplicationController in a \Rails application inherits from ActionController::Base. All other -# controllers inherit from ApplicationController. This gives you one class to configure things such as -# request forgery protection and filtering of sensitive request parameters. -# -# A sample controller could look like this: -# -# class PostsController < ApplicationController -# def index -# @posts = Post.all -# end -# -# def create -# @post = Post.create params[:post] -# redirect_to posts_path -# end -# end -# -# Actions, by default, render a template in the app/views directory corresponding to the name of the controller and action -# after executing code in the action. For example, the +index+ action of the PostsController would render the -# template app/views/posts/index.html.erb by default after populating the @posts instance variable. -# -# Unlike index, the create action will not render a template. After performing its main purpose (creating a -# new post), it initiates a redirect instead. This redirect works by returning an external -# 302 Moved HTTP response that takes the user to the index action. -# -# These two methods represent the two basic action archetypes used in Action Controllers: Get-and-show and do-and-redirect. -# Most actions are variations on these themes. -# -# == Requests -# -# For every request, the router determines the value of the +controller+ and +action+ keys. These determine which controller -# and action are called. The remaining request parameters, the session (if one is available), and the full request with -# all the HTTP headers are made available to the action through accessor methods. Then the action is performed. -# -# The full request object is available via the request accessor and is primarily used to query for HTTP headers: -# -# def server_ip -# location = request.env["REMOTE_ADDR"] -# render plain: "This server hosted at #{location}" -# end -# -# == Parameters -# -# All request parameters, whether they come from a query string in the URL or form data submitted through a POST request are -# available through the params method which returns a hash. For example, an action that was performed through -# /posts?category=All&limit=5 will include { "category" => "All", "limit" => "5" } in params. -# -# It's also possible to construct multi-dimensional parameter hashes by specifying keys using brackets, such as: -# -# -# -# -# A request coming from a form holding these inputs will include { "post" => { "name" => "david", "address" => "hyacintvej" } }. -# If the address input had been named post[address][street], the params would have included -# { "post" => { "address" => { "street" => "hyacintvej" } } }. There's no limit to the depth of the nesting. -# -# == Sessions -# -# Sessions allow you to store objects in between requests. This is useful for objects that are not yet ready to be persisted, -# such as a Signup object constructed in a multi-paged process, or objects that don't change much and are needed all the time, such -# as a User object for a system that requires login. The session should not be used, however, as a cache for objects where it's likely -# they could be changed unknowingly. It's usually too much work to keep it all synchronized -- something databases already excel at. -# -# You can place objects in the session by using the session method, which accesses a hash: -# -# session[:person] = Person.authenticate(user_name, password) -# -# You can retrieve it again through the same hash: -# -# "Hello #{session[:person]}" -# -# For removing objects from the session, you can either assign a single key to +nil+: -# -# # removes :person from session -# session[:person] = nil -# -# or you can remove the entire session with +reset_session+. -# -# By default, sessions are stored in an encrypted browser cookie (see -# ActionDispatch::Session::CookieStore). Thus the user will not be able to -# read or edit the session data. However, the user can keep a copy of the -# cookie even after it has expired, so you should avoid storing sensitive -# information in cookie-based sessions. -# -# == Responses -# -# Each action results in a response, which holds the headers and document to be sent to the user's browser. The actual response -# object is generated automatically through the use of renders and redirects and requires no user intervention. -# -# == Renders -# -# Action Controller sends content to the user by using one of five rendering methods. The most versatile and common is the rendering -# of a template. Included in the Action Pack is the Action View, which enables rendering of ERB templates. It's automatically configured. -# The controller passes objects to the view by assigning instance variables: -# -# def show -# @post = Post.find(params[:id]) -# end -# -# Which are then automatically available to the view: -# -# Title: <%= @post.title %> -# -# You don't have to rely on the automated rendering. For example, actions that could result in the rendering of different templates -# will use the manual rendering methods: -# -# def search -# @results = Search.find(params[:query]) -# case @results.count -# when 0 then render action: "no_results" -# when 1 then render action: "show" -# when 2..10 then render action: "show_many" -# end -# end -# -# Read more about writing ERB and Builder templates in ActionView::Base. -# -# == Redirects -# -# Redirects are used to move from one action to another. For example, after a create action, which stores a blog entry to the -# database, we might like to show the user the new entry. Because we're following good DRY principles (Don't Repeat Yourself), we're -# going to reuse (and redirect to) a show action that we'll assume has already been created. The code might look like this: -# -# def create -# @entry = Entry.new(params[:entry]) -# if @entry.save -# # The entry was saved correctly, redirect to show -# redirect_to action: 'show', id: @entry.id -# else -# # things didn't go so well, do something else -# end -# end -# -# In this case, after saving our new entry to the database, the user is redirected to the show method, which is then executed. -# Note that this is an external HTTP-level redirection which will cause the browser to make a second request (a GET to the show action), -# and not some internal re-routing which calls both "create" and then "show" within one request. -# -# Learn more about redirect_to and what options you have in ActionController::Redirecting. -# -# == Calling multiple redirects or renders -# -# An action may contain only a single render or a single redirect. Attempting to try to do either again will result in a DoubleRenderError: -# -# def do_something -# redirect_to action: "elsewhere" -# render action: "overthere" # raises DoubleRenderError -# end -# -# If you need to redirect on the condition of something, then be sure to add "and return" to halt execution. -# -# def do_something -# redirect_to(action: "elsewhere") and return if monkeys.nil? -# render action: "overthere" # won't be called if monkeys is nil -# end -# -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://actionpack//lib/action_controller/base.rb#167 -class ActionController::Base < ::ActionController::Metal - include ::ActionView::ViewPaths - include ::AbstractController::Rendering - include ::AbstractController::Translation - include ::AbstractController::AssetPaths - include ::AbstractController::Helpers - include ::ActionController::Helpers - include ::ActionDispatch::Routing::PolymorphicRoutes - include ::ActionDispatch::Routing::UrlFor - include ::AbstractController::UrlFor - include ::ActionController::UrlFor - include ::AbstractController::Logger - include ::ActiveSupport::Benchmarkable - include ::ActionController::Redirecting - include ::ActionView::Rendering - include ::ActionView::Layouts - include ::ActionController::Rendering - include ::ActionController::Renderers - include ::ActionController::Renderers::All - include ::ActionController::Head - include ::ActionController::ConditionalGet - include ::ActionController::EtagWithTemplateDigest - include ::ActionController::EtagWithFlash - include ::ActionController::Caching - include ::AbstractController::Caching::Fragments - include ::AbstractController::Caching::ConfigMethods - include ::AbstractController::Caching - include ::ActionController::MimeResponds - include ::ActionController::BasicImplicitRender - include ::ActionController::ImplicitRender - include ::ActionController::StrongParameters - include ::ActionController::ParameterEncoding - include ::ActionController::Cookies - include ::ActionController::Flash - include ::ActionController::FormBuilder - include ::ActiveSupport::Callbacks - include ::AbstractController::Callbacks - include ::ActionController::RequestForgeryProtection - include ::ActionController::ContentSecurityPolicy - include ::ActionController::PermissionsPolicy - include ::ActionController::Streaming - include ::ActionController::DataStreaming - include ::ActionController::HttpAuthentication::Basic::ControllerMethods - include ::ActionController::HttpAuthentication::Digest::ControllerMethods - include ::ActionController::HttpAuthentication::Token::ControllerMethods - include ::ActionController::DefaultHeaders - include ::ActionController::Logging - include ::ActiveSupport::Rescuable - include ::ActionController::Rescue - include ::ActionController::Instrumentation - include ::ActionController::ParamsWrapper - extend ::ActionView::ViewPaths::ClassMethods - extend ::AbstractController::Helpers::ClassMethods - extend ::ActionController::Helpers::ClassMethods - extend ::AbstractController::UrlFor::ClassMethods - extend ::ActionView::Rendering::ClassMethods - extend ::ActionView::Layouts::ClassMethods - extend ::ActionController::Rendering::ClassMethods - extend ::ActionController::Renderers::ClassMethods - extend ::ActionController::ConditionalGet::ClassMethods - extend ::AbstractController::Caching::Fragments::ClassMethods - extend ::AbstractController::Caching::ClassMethods - extend ::AbstractController::Caching::ConfigMethods - extend ::ActionController::ParameterEncoding::ClassMethods - extend ::ActionController::Flash::ClassMethods - extend ::ActionController::FormBuilder::ClassMethods - extend ::ActiveSupport::Callbacks::ClassMethods - extend ::AbstractController::Callbacks::ClassMethods - extend ::ActionController::RequestForgeryProtection::ClassMethods - extend ::ActionController::ContentSecurityPolicy::ClassMethods - extend ::ActionController::PermissionsPolicy::ClassMethods - extend ::ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods - extend ::ActionController::DefaultHeaders::ClassMethods - extend ::ActionController::Logging::ClassMethods - extend ::ActiveSupport::Rescuable::ClassMethods - extend ::ActionController::Instrumentation::ClassMethods - extend ::ActionController::ParamsWrapper::ClassMethods - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks?; end - - # source://actionpack//lib/abstract_controller/helpers.rb#11 - def _helper_methods; end - - # source://actionpack//lib/abstract_controller/helpers.rb#11 - def _helper_methods=(_arg0); end - - # source://actionpack//lib/abstract_controller/helpers.rb#11 - def _helper_methods?; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#940 - def _process_action_callbacks; end - - # source://actionpack//lib/action_controller/metal/renderers.rb#31 - def _renderers; end - - # source://actionpack//lib/action_controller/metal/renderers.rb#31 - def _renderers=(_arg0); end - - # source://actionpack//lib/action_controller/metal/renderers.rb#31 - def _renderers?; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#928 - def _run_process_action_callbacks(&block); end - - # source://actionpack//lib/abstract_controller/caching.rb#42 - def _view_cache_dependencies; end - - # source://actionpack//lib/abstract_controller/caching.rb#42 - def _view_cache_dependencies=(_arg0); end - - # source://actionpack//lib/abstract_controller/caching.rb#42 - def _view_cache_dependencies?; end - - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 - def _wrapper_options; end - - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 - def _wrapper_options=(_arg0); end - - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 - def _wrapper_options?; end - - # source://actionpack//lib/action_controller/metal/flash.rb#36 - def alert; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def allow_forgery_protection; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def allow_forgery_protection=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def asset_host; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def asset_host=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def assets_dir; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def assets_dir=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def default_asset_host_protocol; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def default_asset_host_protocol=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def default_protect_from_forgery; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def default_protect_from_forgery=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def default_static_extension; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def default_static_extension=(value); end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options; end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options=(_arg0); end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options?; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def enable_fragment_cache_logging; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def enable_fragment_cache_logging=(value); end - - # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#27 - def etag_with_template_digest; end - - # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#27 - def etag_with_template_digest=(_arg0); end - - # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#27 - def etag_with_template_digest?; end - - # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 - def etaggers; end - - # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 - def etaggers=(_arg0); end - - # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 - def etaggers?; end - - # source://actionpack//lib/action_controller/metal/flash.rb#10 - def flash(*_arg0, &_arg1); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def forgery_protection_origin_check; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def forgery_protection_origin_check=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def forgery_protection_strategy; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def forgery_protection_strategy=(value); end - - # source://actionpack//lib/abstract_controller/caching/fragments.rb#23 - def fragment_cache_keys; end - - # source://actionpack//lib/abstract_controller/caching/fragments.rb#23 - def fragment_cache_keys=(_arg0); end - - # source://actionpack//lib/abstract_controller/caching/fragments.rb#23 - def fragment_cache_keys?; end - - # source://actionpack//lib/action_controller/metal/helpers.rb#63 - def helpers_path; end - - # source://actionpack//lib/action_controller/metal/helpers.rb#63 - def helpers_path=(_arg0); end - - # source://actionpack//lib/action_controller/metal/helpers.rb#63 - def helpers_path?; end - - # source://actionpack//lib/action_controller/metal/helpers.rb#64 - def include_all_helpers; end - - # source://actionpack//lib/action_controller/metal/helpers.rb#64 - def include_all_helpers=(_arg0); end - - # source://actionpack//lib/action_controller/metal/helpers.rb#64 - def include_all_helpers?; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def javascripts_dir; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def javascripts_dir=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def log_warning_on_csrf_failure; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def log_warning_on_csrf_failure=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def logger; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def logger=(value); end - - # source://actionpack//lib/action_controller/metal/flash.rb#36 - def notice; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def per_form_csrf_tokens; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def per_form_csrf_tokens=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def perform_caching; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def perform_caching=(value); end - - # source://actionpack//lib/action_controller/metal/redirecting.rb#13 - def raise_on_open_redirects; end - - # source://actionpack//lib/action_controller/metal/redirecting.rb#13 - def raise_on_open_redirects=(val); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def relative_url_root; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def relative_url_root=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def request_forgery_protection_token; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def request_forgery_protection_token=(value); end - - # source://activesupport/7.0.4/lib/active_support/rescuable.rb#13 - def rescue_handlers; end - - # source://activesupport/7.0.4/lib/active_support/rescuable.rb#13 - def rescue_handlers=(_arg0); end - - # source://activesupport/7.0.4/lib/active_support/rescuable.rb#13 - def rescue_handlers?; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def stylesheets_dir; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def stylesheets_dir=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def urlsafe_csrf_tokens; end - - private - - # source://actionview/7.0.4/lib/action_view/layouts.rb#328 - def _layout(lookup_context, formats); end - - # source://actionpack//lib/action_controller/base.rb#266 - def _protected_ivars; end - - class << self - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks=(value); end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks?; end - - # source://actionpack//lib/action_controller/form_builder.rb#31 - def _default_form_builder; end - - # source://actionpack//lib/action_controller/form_builder.rb#31 - def _default_form_builder=(value); end - - # source://actionpack//lib/action_controller/form_builder.rb#31 - def _default_form_builder?; end - - # source://actionpack//lib/action_controller/metal/flash.rb#8 - def _flash_types; end - - # source://actionpack//lib/action_controller/metal/flash.rb#8 - def _flash_types=(value); end - - # source://actionpack//lib/action_controller/metal/flash.rb#8 - def _flash_types?; end - - # source://actionpack//lib/abstract_controller/helpers.rb#11 - def _helper_methods; end - - # source://actionpack//lib/abstract_controller/helpers.rb#11 - def _helper_methods=(value); end - - # source://actionpack//lib/abstract_controller/helpers.rb#11 - def _helper_methods?; end - - # source://actionpack//lib/abstract_controller/helpers.rb#15 - def _helpers; end - - # source://actionview/7.0.4/lib/action_view/layouts.rb#209 - def _layout; end - - # source://actionview/7.0.4/lib/action_view/layouts.rb#209 - def _layout=(value); end - - # source://actionview/7.0.4/lib/action_view/layouts.rb#209 - def _layout?; end - - # source://actionview/7.0.4/lib/action_view/layouts.rb#210 - def _layout_conditions; end - - # source://actionview/7.0.4/lib/action_view/layouts.rb#210 - def _layout_conditions=(value); end - - # source://actionview/7.0.4/lib/action_view/layouts.rb#210 - def _layout_conditions?; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#932 - def _process_action_callbacks; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#936 - def _process_action_callbacks=(value); end - - # source://actionpack//lib/action_controller/metal/renderers.rb#31 - def _renderers; end - - # source://actionpack//lib/action_controller/metal/renderers.rb#31 - def _renderers=(value); end - - # source://actionpack//lib/action_controller/metal/renderers.rb#31 - def _renderers?; end - - # source://actionpack//lib/abstract_controller/caching.rb#42 - def _view_cache_dependencies; end - - # source://actionpack//lib/abstract_controller/caching.rb#42 - def _view_cache_dependencies=(value); end - - # source://actionpack//lib/abstract_controller/caching.rb#42 - def _view_cache_dependencies?; end - - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 - def _wrapper_options; end - - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 - def _wrapper_options=(value); end - - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#185 - def _wrapper_options?; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def allow_forgery_protection; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def allow_forgery_protection=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def asset_host; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def asset_host=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def assets_dir; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def assets_dir=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def default_asset_host_protocol; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def default_asset_host_protocol=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def default_protect_from_forgery; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def default_protect_from_forgery=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def default_static_extension; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def default_static_extension=(value); end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options; end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options=(value); end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options?; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def enable_fragment_cache_logging; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def enable_fragment_cache_logging=(value); end - - # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#27 - def etag_with_template_digest; end - - # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#27 - def etag_with_template_digest=(value); end - - # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#27 - def etag_with_template_digest?; end - - # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 - def etaggers; end - - # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 - def etaggers=(value); end - - # source://actionpack//lib/action_controller/metal/conditional_get.rb#13 - def etaggers?; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def forgery_protection_origin_check; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def forgery_protection_origin_check=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def forgery_protection_strategy; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def forgery_protection_strategy=(value); end - - # source://actionpack//lib/abstract_controller/caching/fragments.rb#23 - def fragment_cache_keys; end - - # source://actionpack//lib/abstract_controller/caching/fragments.rb#23 - def fragment_cache_keys=(value); end - - # source://actionpack//lib/abstract_controller/caching/fragments.rb#23 - def fragment_cache_keys?; end - - # source://actionpack//lib/action_controller/metal/helpers.rb#63 - def helpers_path; end - - # source://actionpack//lib/action_controller/metal/helpers.rb#63 - def helpers_path=(value); end - - # source://actionpack//lib/action_controller/metal/helpers.rb#63 - def helpers_path?; end - - # source://actionpack//lib/action_controller/metal/helpers.rb#64 - def include_all_helpers; end - - # source://actionpack//lib/action_controller/metal/helpers.rb#64 - def include_all_helpers=(value); end - - # source://actionpack//lib/action_controller/metal/helpers.rb#64 - def include_all_helpers?; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def javascripts_dir; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def javascripts_dir=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def log_warning_on_csrf_failure; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def log_warning_on_csrf_failure=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def logger; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def logger=(value); end - - # source://actionpack//lib/action_controller/metal.rb#210 - def middleware_stack; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def per_form_csrf_tokens; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def per_form_csrf_tokens=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def perform_caching; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def perform_caching=(value); end - - # source://actionpack//lib/action_controller/metal/redirecting.rb#13 - def raise_on_open_redirects; end - - # source://actionpack//lib/action_controller/metal/redirecting.rb#13 - def raise_on_open_redirects=(val); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def relative_url_root; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def relative_url_root=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def request_forgery_protection_token; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def request_forgery_protection_token=(value); end - - # source://activesupport/7.0.4/lib/active_support/rescuable.rb#13 - def rescue_handlers; end - - # source://activesupport/7.0.4/lib/active_support/rescuable.rb#13 - def rescue_handlers=(value); end - - # source://activesupport/7.0.4/lib/active_support/rescuable.rb#13 - def rescue_handlers?; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def stylesheets_dir; end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#114 - def stylesheets_dir=(value); end - - # source://activesupport/7.0.4/lib/active_support/configurable.rb#113 - def urlsafe_csrf_tokens; end - - # source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#97 - def urlsafe_csrf_tokens=(urlsafe_csrf_tokens); end - - # Shortcut helper that returns all the modules included in - # ActionController::Base except the ones passed as arguments: - # - # class MyBaseController < ActionController::Metal - # ActionController::Base.without_modules(:ParamsWrapper, :Streaming).each do |left| - # include left - # end - # end - # - # This gives better control over what you want to exclude and makes it - # easier to create a bare controller class, instead of listing the modules - # required manually. - # - # source://actionpack//lib/action_controller/base.rb#198 - def without_modules(*modules); end - end -end - -# source://actionpack//lib/action_controller/base.rb#0 -module ActionController::Base::HelperMethods - # source://actionpack//lib/action_controller/metal/flash.rb#39 - def alert(*args, &block); end - - # source://actionpack//lib/abstract_controller/caching/fragments.rb#31 - def combined_fragment_cache_key(*args, &block); end - - # source://actionpack//lib/action_controller/metal/content_security_policy.rb#11 - def content_security_policy?(*args, &block); end - - # source://actionpack//lib/action_controller/metal/content_security_policy.rb#12 - def content_security_policy_nonce(*args, &block); end - - # source://actionpack//lib/action_controller/metal/cookies.rb#8 - def cookies(*args, &block); end - - # source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#106 - def form_authenticity_token(*args, &block); end - - # source://actionpack//lib/action_controller/metal/flash.rb#39 - def notice(*args, &block); end - - # source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#107 - def protect_against_forgery?(*args, &block); end - - # source://actionpack//lib/abstract_controller/caching.rb#43 - def view_cache_dependencies(*args, &block); end -end - -# source://actionpack//lib/action_controller/base.rb#206 -ActionController::Base::MODULES = T.let(T.unsafe(nil), Array) - -# Define some internal variables that should not be propagated to the view. -# -# source://actionpack//lib/action_controller/base.rb#261 -ActionController::Base::PROTECTED_IVARS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#4 -module ActionController::BasicImplicitRender - # source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#9 - def default_render; end - - # source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#5 - def send_action(method, *args); end -end - -# \Caching is a cheap way of speeding up slow applications by keeping the result of -# calculations, renderings, and database calls around for subsequent requests. -# -# You can read more about each approach by clicking the modules below. -# -# Note: To turn off all caching provided by Action Controller, set -# config.action_controller.perform_caching = false -# -# == \Caching stores -# -# All the caching stores from ActiveSupport::Cache are available to be used as backends -# for Action Controller caching. -# -# Configuration examples (FileStore is the default): -# -# config.action_controller.cache_store = :memory_store -# config.action_controller.cache_store = :file_store, '/path/to/cache/directory' -# config.action_controller.cache_store = :mem_cache_store, 'localhost' -# config.action_controller.cache_store = :mem_cache_store, Memcached::Rails.new('localhost:11211') -# config.action_controller.cache_store = MyOwnStore.new('parameter') -# -# source://actionpack//lib/action_controller/caching.rb#24 -module ActionController::Caching - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - include ::AbstractController::Caching::Fragments - include ::AbstractController::Caching - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods - mixes_in_class_methods ::AbstractController::Caching::ClassMethods - mixes_in_class_methods ::AbstractController::Caching::ConfigMethods - - private - - # source://actionpack//lib/action_controller/caching.rb#40 - def instrument_name; end - - # source://actionpack//lib/action_controller/caching.rb#32 - def instrument_payload(key); end - - module GeneratedClassMethods - def _view_cache_dependencies; end - def _view_cache_dependencies=(value); end - def _view_cache_dependencies?; end - def fragment_cache_keys; end - def fragment_cache_keys=(value); end - def fragment_cache_keys?; end - end - - module GeneratedInstanceMethods - def _view_cache_dependencies; end - def _view_cache_dependencies=(value); end - def _view_cache_dependencies?; end - def fragment_cache_keys; end - def fragment_cache_keys=(value); end - def fragment_cache_keys?; end - end -end - -# source://actionpack//lib/action_controller/metal/conditional_get.rb#7 -module ActionController::ConditionalGet - include ::ActionController::Head - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods - - # Sets an HTTP 1.1 Cache-Control header. Defaults to issuing a +private+ - # instruction, so that intermediate caches must not cache the response. - # - # expires_in 20.minutes - # expires_in 3.hours, public: true - # expires_in 3.hours, public: true, must_revalidate: true - # - # This method will overwrite an existing Cache-Control header. - # See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities. - # - # HTTP Cache-Control Extensions for Stale Content. See https://tools.ietf.org/html/rfc5861 - # It helps to cache an asset and serve it while is being revalidated and/or returning with an error. - # - # expires_in 3.hours, public: true, stale_while_revalidate: 60.seconds - # expires_in 3.hours, public: true, stale_while_revalidate: 60.seconds, stale_if_error: 5.minutes - # - # HTTP Cache-Control Extensions other values: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control - # Any additional key-value pairs are concatenated onto the Cache-Control header in the response: - # - # expires_in 3.hours, public: true, "s-maxage": 3.hours, "no-transform": true - # - # The method will also ensure an HTTP Date header for client compatibility. - # - # source://actionpack//lib/action_controller/metal/conditional_get.rb#276 - def expires_in(seconds, options = T.unsafe(nil)); end - - # Sets an HTTP 1.1 Cache-Control header of no-cache. This means the - # resource will be marked as stale, so clients must always revalidate. - # Intermediate/browser caches may still store the asset. - # - # source://actionpack//lib/action_controller/metal/conditional_get.rb#294 - def expires_now; end - - # Sets the +etag+, +last_modified+, or both on the response and renders a - # 304 Not Modified response if the request is already fresh. - # - # === Parameters: - # - # * :etag Sets a "weak" ETag validator on the response. See the - # +:weak_etag+ option. - # * :weak_etag Sets a "weak" ETag validator on the response. - # Requests that set If-None-Match header may return a 304 Not Modified - # response if it matches the ETag exactly. A weak ETag indicates semantic - # equivalence, not byte-for-byte equality, so they're good for caching - # HTML pages in browser caches. They can't be used for responses that - # must be byte-identical, like serving Range requests within a PDF file. - # * :strong_etag Sets a "strong" ETag validator on the response. - # Requests that set If-None-Match header may return a 304 Not Modified - # response if it matches the ETag exactly. A strong ETag implies exact - # equality: the response must match byte for byte. This is necessary for - # doing Range requests within a large video or PDF file, for example, or - # for compatibility with some CDNs that don't support weak ETags. - # * :last_modified Sets a "weak" last-update validator on the - # response. Subsequent requests that set If-Modified-Since may return a - # 304 Not Modified response if last_modified <= If-Modified-Since. - # * :public By default the Cache-Control header is private, set this to - # +true+ if you want your application to be cacheable by other devices (proxy caches). - # * :cache_control When given will overwrite an existing Cache-Control header. - # See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities. - # * :template By default, the template digest for the current - # controller/action is included in ETags. If the action renders a - # different template, you can include its digest instead. If the action - # doesn't render a template at all, you can pass template: false - # to skip any attempt to check for a template digest. - # - # === Example: - # - # def show - # @article = Article.find(params[:id]) - # fresh_when(etag: @article, last_modified: @article.updated_at, public: true) - # end - # - # This will render the show template if the request isn't sending a matching ETag or - # If-Modified-Since header and just a 304 Not Modified response if there's a match. - # - # You can also just pass a record. In this case +last_modified+ will be set - # by calling +updated_at+ and +etag+ by passing the object itself. - # - # def show - # @article = Article.find(params[:id]) - # fresh_when(@article) - # end - # - # You can also pass an object that responds to +maximum+, such as a - # collection of active records. In this case +last_modified+ will be set by - # calling maximum(:updated_at) on the collection (the timestamp of the - # most recently updated record) and the +etag+ by passing the object itself. - # - # def index - # @articles = Article.all - # fresh_when(@articles) - # end - # - # When passing a record or a collection, you can still set the public header: - # - # def show - # @article = Article.find(params[:id]) - # fresh_when(@article, public: true) - # end - # - # When overwriting Cache-Control header: - # - # def show - # @article = Article.find(params[:id]) - # fresh_when(@article, public: true, cache_control: { no_cache: true }) - # end - # - # This will set in the response Cache-Control = public, no-cache. - # - # When rendering a different template than the default controller/action - # style, you can indicate which digest to include in the ETag: - # - # before_action { fresh_when @article, template: 'widgets/show' } - # - # source://actionpack//lib/action_controller/metal/conditional_get.rb#117 - def fresh_when(object = T.unsafe(nil), etag: T.unsafe(nil), weak_etag: T.unsafe(nil), strong_etag: T.unsafe(nil), last_modified: T.unsafe(nil), public: T.unsafe(nil), cache_control: T.unsafe(nil), template: T.unsafe(nil)); end - - # Cache or yield the block. The cache is supposed to never expire. - # - # You can use this method when you have an HTTP response that never changes, - # and the browser and proxies should cache it indefinitely. - # - # * +public+: By default, HTTP responses are private, cached only on the - # user's web browser. To allow proxies to cache the response, set +true+ to - # indicate that they can serve the cached response to all users. - # - # source://actionpack//lib/action_controller/metal/conditional_get.rb#306 - def http_cache_forever(public: T.unsafe(nil)); end - - # Sets an HTTP 1.1 Cache-Control header of no-store. This means the - # resource may not be stored in any cache. - # - # source://actionpack//lib/action_controller/metal/conditional_get.rb#316 - def no_store; end - - # Sets the +etag+ and/or +last_modified+ on the response and checks it against - # the client request. If the request doesn't match the options provided, the - # request is considered stale and should be generated from scratch. Otherwise, - # it's fresh and we don't need to generate anything and a reply of 304 Not Modified is sent. - # - # === Parameters: - # - # * :etag Sets a "weak" ETag validator on the response. See the - # +:weak_etag+ option. - # * :weak_etag Sets a "weak" ETag validator on the response. - # Requests that set If-None-Match header may return a 304 Not Modified - # response if it matches the ETag exactly. A weak ETag indicates semantic - # equivalence, not byte-for-byte equality, so they're good for caching - # HTML pages in browser caches. They can't be used for responses that - # must be byte-identical, like serving Range requests within a PDF file. - # * :strong_etag Sets a "strong" ETag validator on the response. - # Requests that set If-None-Match header may return a 304 Not Modified - # response if it matches the ETag exactly. A strong ETag implies exact - # equality: the response must match byte for byte. This is necessary for - # doing Range requests within a large video or PDF file, for example, or - # for compatibility with some CDNs that don't support weak ETags. - # * :last_modified Sets a "weak" last-update validator on the - # response. Subsequent requests that set If-Modified-Since may return a - # 304 Not Modified response if last_modified <= If-Modified-Since. - # * :public By default the Cache-Control header is private, set this to - # +true+ if you want your application to be cacheable by other devices (proxy caches). - # * :cache_control When given will overwrite an existing Cache-Control header. - # See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities. - # * :template By default, the template digest for the current - # controller/action is included in ETags. If the action renders a - # different template, you can include its digest instead. If the action - # doesn't render a template at all, you can pass template: false - # to skip any attempt to check for a template digest. - # - # === Example: - # - # def show - # @article = Article.find(params[:id]) - # - # if stale?(etag: @article, last_modified: @article.updated_at) - # @statistics = @article.really_expensive_call - # respond_to do |format| - # # all the supported formats - # end - # end - # end - # - # You can also just pass a record. In this case +last_modified+ will be set - # by calling +updated_at+ and +etag+ by passing the object itself. - # - # def show - # @article = Article.find(params[:id]) - # - # if stale?(@article) - # @statistics = @article.really_expensive_call - # respond_to do |format| - # # all the supported formats - # end - # end - # end - # - # You can also pass an object that responds to +maximum+, such as a - # collection of active records. In this case +last_modified+ will be set by - # calling maximum(:updated_at) on the collection (the timestamp of the - # most recently updated record) and the +etag+ by passing the object itself. - # - # def index - # @articles = Article.all - # - # if stale?(@articles) - # @statistics = @articles.really_expensive_call - # respond_to do |format| - # # all the supported formats - # end - # end - # end - # - # When passing a record or a collection, you can still set the public header: - # - # def show - # @article = Article.find(params[:id]) - # - # if stale?(@article, public: true) - # @statistics = @article.really_expensive_call - # respond_to do |format| - # # all the supported formats - # end - # end - # end - # - # When overwriting Cache-Control header: - # - # def show - # @article = Article.find(params[:id]) - # - # if stale?(@article, public: true, cache_control: { no_cache: true }) - # @statistics = @articles.really_expensive_call - # respond_to do |format| - # # all the supported formats - # end - # end - # end - # - # This will set in the response Cache-Control = public, no-cache. - # - # When rendering a different template than the default controller/action - # style, you can indicate which digest to include in the ETag: - # - # def show - # super if stale? @article, template: 'widgets/show' - # end - # - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/conditional_get.rb#249 - def stale?(object = T.unsafe(nil), **freshness_kwargs); end - - private - - # source://actionpack//lib/action_controller/metal/conditional_get.rb#321 - def combine_etags(validator, options); end - - module GeneratedClassMethods - def etaggers; end - def etaggers=(value); end - def etaggers?; end - end - - module GeneratedInstanceMethods - def etaggers; end - def etaggers=(value); end - def etaggers?; end - end -end - -# source://actionpack//lib/action_controller/metal/conditional_get.rb#16 -module ActionController::ConditionalGet::ClassMethods - # Allows you to consider additional controller-wide information when generating an ETag. - # For example, if you serve pages tailored depending on who's logged in at the moment, you - # may want to add the current user id to be part of the ETag to prevent unauthorized displaying - # of cached pages. - # - # class InvoicesController < ApplicationController - # etag { current_user&.id } - # - # def show - # # Etag will differ even for the same invoice when it's viewed by a different current_user - # @invoice = Invoice.find(params[:id]) - # fresh_when etag: @invoice - # end - # end - # - # source://actionpack//lib/action_controller/metal/conditional_get.rb#31 - def etag(&etagger); end -end - -# source://actionpack//lib/action_controller/metal/content_security_policy.rb#4 -module ActionController::ContentSecurityPolicy - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - include ::AbstractController::Helpers - include ::ActiveSupport::Callbacks - include ::AbstractController::Callbacks - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::AbstractController::Helpers::ClassMethods - mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods - mixes_in_class_methods ::ActiveSupport::DescendantsTracker - mixes_in_class_methods ::AbstractController::Callbacks::ClassMethods - mixes_in_class_methods ::ActionController::ContentSecurityPolicy::ClassMethods - - private - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/content_security_policy.rb#73 - def content_security_policy?; end - - # source://actionpack//lib/action_controller/metal/content_security_policy.rb#77 - def content_security_policy_nonce; end - - # source://actionpack//lib/action_controller/metal/content_security_policy.rb#81 - def current_content_security_policy; end - - module GeneratedClassMethods - def __callbacks; end - def __callbacks=(value); end - def __callbacks?; end - def _helper_methods; end - def _helper_methods=(value); end - def _helper_methods?; end - end - - module GeneratedInstanceMethods - def __callbacks; end - def __callbacks?; end - def _helper_methods; end - def _helper_methods=(value); end - def _helper_methods?; end - end -end - -# source://actionpack//lib/action_controller/metal/content_security_policy.rb#15 -module ActionController::ContentSecurityPolicy::ClassMethods - # Overrides parts of the globally configured Content-Security-Policy - # header: - # - # class PostsController < ApplicationController - # content_security_policy do |policy| - # policy.base_uri "https://www.example.com" - # end - # end - # - # Options can be passed similar to +before_action+. For example, pass - # only: :index to override the header on the index action only: - # - # class PostsController < ApplicationController - # content_security_policy(only: :index) do |policy| - # policy.default_src :self, :https - # end - # end - # - # Pass +false+ to remove the Content-Security-Policy header: - # - # class PostsController < ApplicationController - # content_security_policy false, only: :index - # end - # - # source://actionpack//lib/action_controller/metal/content_security_policy.rb#39 - def content_security_policy(enabled = T.unsafe(nil), **options, &block); end - - # Overrides the globally configured Content-Security-Policy-Report-Only - # header: - # - # class PostsController < ApplicationController - # content_security_policy_report_only only: :index - # end - # - # Pass +false+ to remove the Content-Security-Policy-Report-Only header: - # - # class PostsController < ApplicationController - # content_security_policy_report_only false, only: :index - # end - # - # source://actionpack//lib/action_controller/metal/content_security_policy.rb#65 - def content_security_policy_report_only(report_only = T.unsafe(nil), **options); end -end - -# source://actionpack//lib/action_controller/metal/cookies.rb#4 -module ActionController::Cookies - extend ::ActiveSupport::Concern - - private - - # The cookies for the current request. See ActionDispatch::Cookies for - # more information. - # - # source://actionpack//lib/action_controller/metal/cookies.rb#14 - def cookies; end -end - -# Methods for sending arbitrary data and for streaming files to the browser, -# instead of rendering. -# -# source://actionpack//lib/action_controller/metal/data_streaming.rb#9 -module ActionController::DataStreaming - extend ::ActiveSupport::Concern - include ::ActionController::Rendering - - mixes_in_class_methods ::ActionController::Rendering::ClassMethods - - private - - # Sends the given binary data to the browser. This method is similar to - # render plain: data, but also allows you to specify whether - # the browser should display the response as a file attachment (i.e. in a - # download dialog) or as inline data. You may also set the content type, - # the file name, and other things. - # - # Options: - # * :filename - suggests a filename for the browser to use. - # * :type - specifies an HTTP content type. Defaults to 'application/octet-stream'. - # You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. - # If omitted, type will be inferred from the file extension specified in :filename. - # If no content type is registered for the extension, the default type 'application/octet-stream' will be used. - # * :disposition - specifies whether the file will be shown inline or downloaded. - # Valid values are 'inline' and 'attachment' (default). - # * :status - specifies the status code to send with the response. Defaults to 200. - # - # Generic data download: - # - # send_data buffer - # - # Download a dynamically-generated tarball: - # - # send_data generate_tgz('dir'), filename: 'dir.tgz' - # - # Display an image Active Record in the browser: - # - # send_data image.data, type: image.content_type, disposition: 'inline' - # - # See +send_file+ for more information on HTTP Content-* headers and caching. - # - # source://actionpack//lib/action_controller/metal/data_streaming.rb#109 - def send_data(data, options = T.unsafe(nil)); end - - # Sends the file. This uses a server-appropriate method (such as X-Sendfile) - # via the Rack::Sendfile middleware. The header to use is set via - # +config.action_dispatch.x_sendfile_header+. - # Your server can also configure this for you by setting the X-Sendfile-Type header. - # - # Be careful to sanitize the path parameter if it is coming from a web - # page. send_file(params[:path]) allows a malicious user to - # download any file on your server. - # - # Options: - # * :filename - suggests a filename for the browser to use. - # Defaults to File.basename(path). - # * :type - specifies an HTTP content type. - # You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. - # If omitted, the type will be inferred from the file extension specified in :filename. - # If no content type is registered for the extension, the default type 'application/octet-stream' will be used. - # * :disposition - specifies whether the file will be shown inline or downloaded. - # Valid values are 'inline' and 'attachment' (default). - # * :status - specifies the status code to send with the response. Defaults to 200. - # * :url_based_filename - set to +true+ if you want the browser to guess the filename from - # the URL, which is necessary for i18n filenames on certain browsers - # (setting :filename overrides this option). - # - # The default Content-Type and Content-Disposition headers are - # set to download arbitrary binary files in as many browsers as - # possible. IE versions 4, 5, 5.5, and 6 are all known to have - # a variety of quirks (especially when downloading over SSL). - # - # Simple download: - # - # send_file '/path/to.zip' - # - # Show a JPEG in the browser: - # - # send_file '/path/to.jpeg', type: 'image/jpeg', disposition: 'inline' - # - # Show a 404 page in the browser: - # - # send_file '/path/to/404.html', type: 'text/html; charset=utf-8', disposition: 'inline', status: 404 - # - # Read about the other Content-* HTTP headers if you'd like to - # provide the user with more information (such as Content-Description) in - # https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11. - # - # Also be aware that the document may be cached by proxies and browsers. - # The Pragma and Cache-Control headers declare how the file may be cached - # by intermediaries. They default to require clients to validate with - # the server before releasing cached responses. See - # https://www.mnot.net/cache_docs/ for an overview of web caching and - # https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 - # for the Cache-Control header spec. - # - # @raise [MissingFile] - # - # source://actionpack//lib/action_controller/metal/data_streaming.rb#69 - def send_file(path, options = T.unsafe(nil)); end - - # @raise [ArgumentError] - # - # source://actionpack//lib/action_controller/metal/data_streaming.rb#114 - def send_file_headers!(options); end -end - -# source://actionpack//lib/action_controller/metal/data_streaming.rb#15 -ActionController::DataStreaming::DEFAULT_SEND_FILE_DISPOSITION = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_controller/metal/data_streaming.rb#14 -ActionController::DataStreaming::DEFAULT_SEND_FILE_TYPE = T.let(T.unsafe(nil), String) - -# Allows configuring default headers that will be automatically merged into -# each response. -# -# source://actionpack//lib/action_controller/metal/default_headers.rb#6 -module ActionController::DefaultHeaders - extend ::ActiveSupport::Concern - - mixes_in_class_methods ::ActionController::DefaultHeaders::ClassMethods -end - -# source://actionpack//lib/action_controller/metal/default_headers.rb#9 -module ActionController::DefaultHeaders::ClassMethods - # source://actionpack//lib/action_controller/metal/default_headers.rb#10 - def make_response!(request); end -end - -# When you're using the flash, it's generally used as a conditional on the view. -# This means the content of the view depends on the flash. Which in turn means -# that the ETag for a response should be computed with the content of the flash -# in mind. This does that by including the content of the flash as a component -# in the ETag that's generated for a response. -# -# source://actionpack//lib/action_controller/metal/etag_with_flash.rb#9 -module ActionController::EtagWithFlash - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - include ::ActionController::ConditionalGet - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods - - module GeneratedClassMethods - def etaggers; end - def etaggers=(value); end - def etaggers?; end - end - - module GeneratedInstanceMethods - def etaggers; end - def etaggers=(value); end - def etaggers?; end - end -end - -# When our views change, they should bubble up into HTTP cache freshness -# and bust browser caches. So the template digest for the current action -# is automatically included in the ETag. -# -# Enabled by default for apps that use Action View. Disable by setting -# -# config.action_controller.etag_with_template_digest = false -# -# Override the template to digest by passing +:template+ to +fresh_when+ -# and +stale?+ calls. For example: -# -# # We're going to render widgets/show, not posts/show -# fresh_when @post, template: 'widgets/show' -# -# # We're not going to render a template, so omit it from the ETag. -# fresh_when @post, template: false -# -# source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#21 -module ActionController::EtagWithTemplateDigest - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - include ::ActionController::ConditionalGet - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods - - private - - # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#35 - def determine_template_etag(options); end - - # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#51 - def lookup_and_digest_template(template); end - - # Pick the template digest to include in the ETag. If the +:template+ option - # is present, use the named template. If +:template+ is +nil+ or absent, use - # the default controller/action template. If +:template+ is false, omit the - # template digest from the ETag. - # - # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#45 - def pick_template_for_etag(options); end - - module GeneratedClassMethods - def etag_with_template_digest; end - def etag_with_template_digest=(value); end - def etag_with_template_digest?; end - def etaggers; end - def etaggers=(value); end - def etaggers?; end - end - - module GeneratedInstanceMethods - def etag_with_template_digest; end - def etag_with_template_digest=(value); end - def etag_with_template_digest?; end - def etaggers; end - def etaggers=(value); end - def etaggers?; end - end -end - -# source://actionpack//lib/action_controller/metal/flash.rb#4 -module ActionController::Flash - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::ActionController::Flash::ClassMethods - - private - - # source://actionpack//lib/action_controller/metal/flash.rb#51 - def redirect_to(options = T.unsafe(nil), response_options_and_flash = T.unsafe(nil)); end - - module GeneratedClassMethods - def _flash_types; end - def _flash_types=(value); end - def _flash_types?; end - end - - module GeneratedInstanceMethods; end -end - -# source://actionpack//lib/action_controller/metal/flash.rb#14 -module ActionController::Flash::ClassMethods - # source://actionpack//lib/action_controller/metal/flash.rb#45 - def action_methods; end - - # Creates new flash types. You can pass as many types as you want to create - # flash types other than the default alert and notice in - # your controllers and views. For instance: - # - # # in application_controller.rb - # class ApplicationController < ActionController::Base - # add_flash_types :warning - # end - # - # # in your controller - # redirect_to user_path(@user), warning: "Incomplete profile" - # - # # in your view - # <%= warning %> - # - # This method will automatically define a new method for each of the given - # names, and it will be available in your views. - # - # source://actionpack//lib/action_controller/metal/flash.rb#32 - def add_flash_types(*types); end -end - -# Override the default form builder for all views rendered by this -# controller and any of its descendants. Accepts a subclass of -# ActionView::Helpers::FormBuilder. -# -# For example, given a form builder: -# -# class AdminFormBuilder < ActionView::Helpers::FormBuilder -# def special_field(name) -# end -# end -# -# The controller specifies a form builder as its default: -# -# class AdminAreaController < ApplicationController -# default_form_builder AdminFormBuilder -# end -# -# Then in the view any form using +form_for+ will be an instance of the -# specified form builder: -# -# <%= form_for(@instance) do |builder| %> -# <%= builder.special_field(:name) %> -# <% end %> -# -# source://actionpack//lib/action_controller/form_builder.rb#27 -module ActionController::FormBuilder - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::ActionController::FormBuilder::ClassMethods - - # Default form builder for the controller - # - # source://actionpack//lib/action_controller/form_builder.rb#46 - def default_form_builder; end - - module GeneratedClassMethods - def _default_form_builder; end - def _default_form_builder=(value); end - def _default_form_builder?; end - end - - module GeneratedInstanceMethods; end -end - -# source://actionpack//lib/action_controller/form_builder.rb#34 -module ActionController::FormBuilder::ClassMethods - # Set the form builder to be used as the default for all forms - # in the views rendered by this controller and its subclasses. - # - # ==== Parameters - # * builder - Default form builder, an instance of ActionView::Helpers::FormBuilder - # - # source://actionpack//lib/action_controller/form_builder.rb#40 - def default_form_builder(builder); end -end - -# source://actionpack//lib/action_controller/metal/head.rb#4 -module ActionController::Head - # Returns a response that has no content (merely headers). The options - # argument is interpreted to be a hash of header names and values. - # This allows you to easily return a response that consists only of - # significant headers: - # - # head :created, location: person_path(@person) - # - # head :created, location: @person - # - # It can also be used to return exceptional conditions: - # - # return head(:method_not_allowed) unless request.post? - # return head(:bad_request) unless valid_request? - # render - # - # See Rack::Utils::SYMBOL_TO_STATUS_CODE for a full list of valid +status+ symbols. - # - # source://actionpack//lib/action_controller/metal/head.rb#21 - def head(status, options = T.unsafe(nil)); end - - private - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/head.rb#52 - def include_content?(status); end -end - -# The \Rails framework provides a large number of helpers for working with assets, dates, forms, -# numbers and model objects, to name a few. These helpers are available to all templates -# by default. -# -# In addition to using the standard template helpers provided, creating custom helpers to -# extract complicated logic or reusable functionality is strongly encouraged. By default, each controller -# will include all helpers. These helpers are only accessible on the controller through #helpers -# -# In previous versions of \Rails the controller will include a helper which -# matches the name of the controller, e.g., MyController will automatically -# include MyHelper. You can revert to the old behavior with the following: -# -# # config/application.rb -# class Application < Rails::Application -# config.action_controller.include_all_helpers = false -# end -# -# Additional helpers can be specified using the +helper+ class method in ActionController::Base or any -# controller which inherits from it. -# -# The +to_s+ method from the \Time class can be wrapped in a helper method to display a custom message if -# a \Time object is blank: -# -# module FormattedTimeHelper -# def format_time(time, format=:long, blank_message=" ") -# time.blank? ? blank_message : time.to_fs(format) -# end -# end -# -# FormattedTimeHelper can now be included in a controller, using the +helper+ class method: -# -# class EventsController < ActionController::Base -# helper FormattedTimeHelper -# def index -# @events = Event.all -# end -# end -# -# Then, in any view rendered by EventsController, the format_time method can be called: -# -# <% @events.each do |event| -%> -#

-# <%= format_time(event.time, :short, "N/A") %> | <%= event.name %> -#

-# <% end -%> -# -# Finally, assuming we have two event instances, one which has a time and one which does not, -# the output might look like this: -# -# 23 Aug 11:30 | Carolina Railhawks Soccer Match -# N/A | Carolina Railhawks Training Workshop -# -# source://actionpack//lib/action_controller/metal/helpers.rb#56 -module ActionController::Helpers - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - include ::AbstractController::Helpers - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::AbstractController::Helpers::ClassMethods - mixes_in_class_methods ::ActionController::Helpers::ClassMethods - - # Provides a proxy to access helper methods from outside the view. - # - # source://actionpack//lib/action_controller/metal/helpers.rb#128 - def helpers; end - - class << self - # Returns the value of attribute helpers_path. - # - # source://actionpack//lib/action_controller/metal/helpers.rb#59 - def helpers_path; end - - # Sets the attribute helpers_path - # - # @param value the value to set the attribute helpers_path to. - # - # source://actionpack//lib/action_controller/metal/helpers.rb#59 - def helpers_path=(_arg0); end - end - - module GeneratedClassMethods - def _helper_methods; end - def _helper_methods=(value); end - def _helper_methods?; end - def helpers_path; end - def helpers_path=(value); end - def helpers_path?; end - def include_all_helpers; end - def include_all_helpers=(value); end - def include_all_helpers?; end - end - - module GeneratedInstanceMethods - def _helper_methods; end - def _helper_methods=(value); end - def _helper_methods?; end - def helpers_path; end - def helpers_path=(value); end - def helpers_path?; end - def include_all_helpers; end - def include_all_helpers=(value); end - def include_all_helpers?; end - end -end - -# source://actionpack//lib/action_controller/metal/helpers.rb#67 -module ActionController::Helpers::ClassMethods - # Returns a list of helper names in a given path. - # - # ActionController::Base.all_helpers_from_path 'app/helpers' - # # => ["application", "chart", "rubygems"] - # - # source://actionpack//lib/action_controller/metal/helpers.rb#111 - def all_helpers_from_path(path); end - - # Declares helper accessors for controller attributes. For example, the - # following adds new +name+ and name= instance methods to a - # controller and makes them available to the view: - # attr_accessor :name - # helper_attr :name - # - # ==== Parameters - # * attrs - Names of attributes to be converted into helpers. - # - # source://actionpack//lib/action_controller/metal/helpers.rb#76 - def helper_attr(*attrs); end - - # Provides a proxy to access helper methods from outside the view. - # - # Note that the proxy is rendered under a different view context. - # This may cause incorrect behaviour with capture methods. Consider - # using {helper}[rdoc-ref:AbstractController::Helpers::ClassMethods#helper] - # instead when using +capture+. - # - # source://actionpack//lib/action_controller/metal/helpers.rb#86 - def helpers; end - - # Override modules_for_helpers to accept +:all+ as argument, which loads - # all helpers in helpers_path. - # - # ==== Parameters - # * args - A list of helpers - # - # ==== Returns - # * array - A normalized list of modules for the list of helpers provided. - # - # source://actionpack//lib/action_controller/metal/helpers.rb#102 - def modules_for_helpers(args); end - - private - - # Extract helper names from files in app/helpers/**/*_helper.rb - # - # source://actionpack//lib/action_controller/metal/helpers.rb#122 - def all_application_helpers; end -end - -# HTTP Basic, Digest, and Token authentication. -# -# source://actionpack//lib/action_controller/metal/http_authentication.rb#9 -module ActionController::HttpAuthentication; end - -# = HTTP \Basic authentication -# -# === Simple \Basic example -# -# class PostsController < ApplicationController -# http_basic_authenticate_with name: "dhh", password: "secret", except: :index -# -# def index -# render plain: "Everyone can see me!" -# end -# -# def edit -# render plain: "I'm only accessible if you know the password" -# end -# end -# -# === Advanced \Basic example -# -# Here is a more advanced \Basic example where only Atom feeds and the XML API are protected by HTTP authentication. -# The regular HTML interface is protected by a session approach: -# -# class ApplicationController < ActionController::Base -# before_action :set_account, :authenticate -# -# private -# def set_account -# @account = Account.find_by(url_name: request.subdomains.first) -# end -# -# def authenticate -# case request.format -# when Mime[:xml], Mime[:atom] -# if user = authenticate_with_http_basic { |u, p| @account.users.authenticate(u, p) } -# @current_user = user -# else -# request_http_basic_authentication -# end -# else -# if session_authenticated? -# @current_user = @account.users.find(session[:authenticated][:user_id]) -# else -# redirect_to(login_url) and return false -# end -# end -# end -# end -# -# In your integration tests, you can do something like this: -# -# def test_access_granted_from_xml -# authorization = ActionController::HttpAuthentication::Basic.encode_credentials(users(:dhh).name, users(:dhh).password) -# -# get "/notes/1.xml", headers: { 'HTTP_AUTHORIZATION' => authorization } -# -# assert_equal 200, status -# end -# -# source://actionpack//lib/action_controller/metal/http_authentication.rb#66 -module ActionController::HttpAuthentication::Basic - extend ::ActionController::HttpAuthentication::Basic - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#127 - def auth_param(request); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#123 - def auth_scheme(request); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#105 - def authenticate(request, &login_procedure); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#135 - def authentication_request(controller, realm, message); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#119 - def decode_credentials(request); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#131 - def encode_credentials(user_name, password); end - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#111 - def has_basic_credentials?(request); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#115 - def user_name_and_password(request); end -end - -# source://actionpack//lib/action_controller/metal/http_authentication.rb#69 -module ActionController::HttpAuthentication::Basic::ControllerMethods - extend ::ActiveSupport::Concern - - mixes_in_class_methods ::ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#92 - def authenticate_or_request_with_http_basic(realm = T.unsafe(nil), message = T.unsafe(nil), &login_procedure); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#96 - def authenticate_with_http_basic(&login_procedure); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#83 - def http_basic_authenticate_or_request_with(name:, password:, realm: T.unsafe(nil), message: T.unsafe(nil)); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#100 - def request_http_basic_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end -end - -# source://actionpack//lib/action_controller/metal/http_authentication.rb#72 -module ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods - # Enables HTTP \Basic authentication. - # - # See ActionController::HttpAuthentication::Basic for example usage. - # - # @raise [ArgumentError] - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#76 - def http_basic_authenticate_with(name:, password:, realm: T.unsafe(nil), **options); end -end - -# = HTTP \Digest authentication -# -# === Simple \Digest example -# -# require "openssl" -# class PostsController < ApplicationController -# REALM = "SuperSecret" -# USERS = {"dhh" => "secret", #plain text password -# "dap" => OpenSSL::Digest::MD5.hexdigest(["dap",REALM,"secret"].join(":"))} #ha1 digest password -# -# before_action :authenticate, except: [:index] -# -# def index -# render plain: "Everyone can see me!" -# end -# -# def edit -# render plain: "I'm only accessible if you know the password" -# end -# -# private -# def authenticate -# authenticate_or_request_with_http_digest(REALM) do |username| -# USERS[username] -# end -# end -# end -# -# === Notes -# -# The +authenticate_or_request_with_http_digest+ block must return the user's password -# or the ha1 digest hash so the framework can appropriately hash to check the user's -# credentials. Returning +nil+ will cause authentication to fail. -# -# Storing the ha1 hash: MD5(username:realm:password), is better than storing a plain password. If -# the password file or database is compromised, the attacker would be able to use the ha1 hash to -# authenticate as the user at this +realm+, but would not have the user's password to try using at -# other sites. -# -# In rare instances, web servers or front proxies strip authorization headers before -# they reach your application. You can debug this situation by logging all environment -# variables, and check for HTTP_AUTHORIZATION, amongst others. -# -# source://actionpack//lib/action_controller/metal/http_authentication.rb#185 -module ActionController::HttpAuthentication::Digest - extend ::ActionController::HttpAuthentication::Digest - - # Returns false on a valid response, true otherwise. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#211 - def authenticate(request, realm, &password_procedure); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#269 - def authentication_header(controller, realm); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#276 - def authentication_request(controller, realm, message = T.unsafe(nil)); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#262 - def decode_credentials(header); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#258 - def decode_credentials_header(request); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#253 - def encode_credentials(http_method, credentials, password, password_is_ha1); end - - # Returns the expected response for a request of +http_method+ to +uri+ with the decoded +credentials+ and the expected +password+ - # Optional parameter +password_is_ha1+ is set to +true+ by default, since best practice is to store ha1 digest instead - # of a plain-text password. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#243 - def expected_response(http_method, uri, credentials, password, password_is_ha1 = T.unsafe(nil)); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#249 - def ha1(credentials, password); end - - # Uses an MD5 digest based on time to generate a value to be used only once. - # - # A server-specified data string which should be uniquely generated each time a 401 response is made. - # It is recommended that this string be base64 or hexadecimal data. - # Specifically, since the string is passed in the header lines as a quoted string, the double-quote character is not allowed. - # - # The contents of the nonce are implementation dependent. - # The quality of the implementation depends on a good choice. - # A nonce might, for example, be constructed as the base 64 encoding of - # - # time-stamp H(time-stamp ":" ETag ":" private-key) - # - # where time-stamp is a server-generated time or other non-repeating value, - # ETag is the value of the HTTP ETag header associated with the requested entity, - # and private-key is data known only to the server. - # With a nonce of this form a server would recalculate the hash portion after receiving the client authentication header and - # reject the request if it did not match the nonce from that header or - # if the time-stamp value is not recent enough. In this way the server can limit the time of the nonce's validity. - # The inclusion of the ETag prevents a replay request for an updated version of the resource. - # (Note: including the IP address of the client in the nonce would appear to offer the server the ability - # to limit the reuse of the nonce to the same client that originally got it. - # However, that would break proxy farms, where requests from a single user often go through different proxies in the farm. - # Also, IP address spoofing is not that hard.) - # - # An implementation might choose not to accept a previously used nonce or a previously used digest, in order to - # protect against a replay attack. Or, an implementation might choose to use one-time nonces or digests for - # POST, PUT, or PATCH requests, and a time-stamp for GET requests. For more details on the issues involved see Section 4 - # of this document. - # - # The nonce is opaque to the client. Composed of Time, and hash of Time with secret - # key from the Rails session secret generated upon creation of project. Ensures - # the time cannot be modified by client. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#321 - def nonce(secret_key, time = T.unsafe(nil)); end - - # Opaque based on digest of secret key - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#340 - def opaque(secret_key); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#283 - def secret_token(request); end - - # Returns false unless the request credentials response value matches the expected value. - # First try the password as a ha1 digest password. If this fails, then try it as a plain - # text password. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#218 - def validate_digest_response(request, realm, &password_procedure); end - - # Might want a shorter timeout depending on whether the request - # is a PATCH, PUT, or POST, and if the client is a browser or web service. - # Can be much shorter if the Stale directive is implemented. This would - # allow a user to use new nonce without prompting the user again for their - # username and password. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#333 - def validate_nonce(secret_key, request, value, seconds_to_timeout = T.unsafe(nil)); end -end - -# source://actionpack//lib/action_controller/metal/http_authentication.rb#188 -module ActionController::HttpAuthentication::Digest::ControllerMethods - # Authenticate using an HTTP \Digest, or otherwise render an HTTP header - # requesting the client to send a \Digest. - # - # See ActionController::HttpAuthentication::Digest for example usage. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#193 - def authenticate_or_request_with_http_digest(realm = T.unsafe(nil), message = T.unsafe(nil), &password_procedure); end - - # Authenticate using an HTTP \Digest. Returns true if authentication is - # successful, false otherwise. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#199 - def authenticate_with_http_digest(realm = T.unsafe(nil), &password_procedure); end - - # Render an HTTP header requesting the client to send a \Digest for - # authentication. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#205 - def request_http_digest_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end -end - -# = HTTP \Token authentication -# -# === Simple \Token example -# -# class PostsController < ApplicationController -# TOKEN = "secret" -# -# before_action :authenticate, except: [ :index ] -# -# def index -# render plain: "Everyone can see me!" -# end -# -# def edit -# render plain: "I'm only accessible if you know the password" -# end -# -# private -# def authenticate -# authenticate_or_request_with_http_token do |token, options| -# # Compare the tokens in a time-constant manner, to mitigate -# # timing attacks. -# ActiveSupport::SecurityUtils.secure_compare(token, TOKEN) -# end -# end -# end -# -# -# Here is a more advanced Token example where only Atom feeds and the XML API are protected by HTTP token authentication. -# The regular HTML interface is protected by a session approach: -# -# class ApplicationController < ActionController::Base -# before_action :set_account, :authenticate -# -# private -# def set_account -# @account = Account.find_by(url_name: request.subdomains.first) -# end -# -# def authenticate -# case request.format -# when Mime[:xml], Mime[:atom] -# if user = authenticate_with_http_token { |t, o| @account.users.authenticate(t, o) } -# @current_user = user -# else -# request_http_token_authentication -# end -# else -# if session_authenticated? -# @current_user = @account.users.find(session[:authenticated][:user_id]) -# else -# redirect_to(login_url) and return false -# end -# end -# end -# end -# -# -# In your integration tests, you can do something like this: -# -# def test_access_granted_from_xml -# authorization = ActionController::HttpAuthentication::Token.encode_credentials(users(:dhh).token) -# -# get "/notes/1.xml", headers: { 'HTTP_AUTHORIZATION' => authorization } -# -# assert_equal 200, status -# end -# -# -# On shared hosts, Apache sometimes doesn't pass authentication headers to -# FCGI instances. If your environment matches this description and you cannot -# authenticate, try this rule in your Apache setup: -# -# RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L] -# -# source://actionpack//lib/action_controller/metal/http_authentication.rb#419 -module ActionController::HttpAuthentication::Token - extend ::ActionController::HttpAuthentication::Token - - # If token Authorization header is present, call the login - # procedure with the present token and options. - # - # Returns the return value of login_procedure if a - # token is found. Returns nil if no token is found. - # - # ==== Parameters - # - # * +controller+ - ActionController::Base instance for the current request. - # * +login_procedure+ - Proc to call if a token is present. The Proc - # should take two arguments: - # - # authenticate(controller) { |token, options| ... } - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#461 - def authenticate(controller, &login_procedure); end - - # Sets a WWW-Authenticate header to let the client know a token is desired. - # - # Returns nothing. - # - # ==== Parameters - # - # * +controller+ - ActionController::Base instance for the outgoing response. - # * +realm+ - String realm to use in the header. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#541 - def authentication_request(controller, realm, message = T.unsafe(nil)); end - - # Encodes the given token and options into an Authorization header value. - # - # Returns String. - # - # ==== Parameters - # - # * +token+ - String token. - # * +options+ - Optional Hash of the options. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#526 - def encode_credentials(token, options = T.unsafe(nil)); end - - # Takes +raw_params+ and turns it into an array of parameters. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#496 - def params_array_from(raw_params); end - - # This method takes an authorization body and splits up the key-value - # pairs by the standardized :, ;, or \t - # delimiters defined in +AUTHN_PAIR_DELIMITERS+. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#508 - def raw_params(auth); end - - # This removes the " characters wrapping the value. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#501 - def rewrite_param_values(array_params); end - - # Parses the token and options out of the token Authorization header. - # The value for the Authorization header is expected to have the prefix - # "Token" or "Bearer". If the header looks like this: - # - # Authorization: Token token="abc", nonce="def" - # - # Then the returned token is "abc", and the options are - # {nonce: "def"}. - # - # Returns an +Array+ of [String, Hash] if a token is present. - # Returns +nil+ if no token is found. - # - # ==== Parameters - # - # * +request+ - ActionDispatch::Request instance with the current headers. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#483 - def token_and_options(request); end - - # source://actionpack//lib/action_controller/metal/http_authentication.rb#491 - def token_params_from(auth); end -end - -# source://actionpack//lib/action_controller/metal/http_authentication.rb#422 -ActionController::HttpAuthentication::Token::AUTHN_PAIR_DELIMITERS = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_controller/metal/http_authentication.rb#425 -module ActionController::HttpAuthentication::Token::ControllerMethods - # Authenticate using an HTTP Bearer token, or otherwise render an HTTP - # header requesting the client to send a Bearer token. - # - # See ActionController::HttpAuthentication::Token for example usage. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#430 - def authenticate_or_request_with_http_token(realm = T.unsafe(nil), message = T.unsafe(nil), &login_procedure); end - - # Authenticate using an HTTP Bearer token. Returns true if - # authentication is successful, false otherwise. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#436 - def authenticate_with_http_token(&login_procedure); end - - # Render an HTTP header requesting the client to send a Bearer token for - # authentication. - # - # source://actionpack//lib/action_controller/metal/http_authentication.rb#442 - def request_http_token_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end -end - -# source://actionpack//lib/action_controller/metal/http_authentication.rb#420 -ActionController::HttpAuthentication::Token::TOKEN_KEY = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_controller/metal/http_authentication.rb#421 -ActionController::HttpAuthentication::Token::TOKEN_REGEX = T.let(T.unsafe(nil), Regexp) - -# Handles implicit rendering for a controller action that does not -# explicitly respond with +render+, +respond_to+, +redirect+, or +head+. -# -# For API controllers, the implicit response is always 204 No Content. -# -# For all other controllers, we use these heuristics to decide whether to -# render a template, raise an error for a missing template, or respond with -# 204 No Content: -# -# First, if we DO find a template, it's rendered. Template lookup accounts -# for the action name, locales, format, variant, template handlers, and more -# (see +render+ for details). -# -# Second, if we DON'T find a template but the controller action does have -# templates for other formats, variants, etc., then we trust that you meant -# to provide a template for this response, too, and we raise -# ActionController::UnknownFormat with an explanation. -# -# Third, if we DON'T find a template AND the request is a page load in a web -# browser (technically, a non-XHR GET request for an HTML response) where -# you reasonably expect to have rendered a template, then we raise -# ActionController::MissingExactTemplate with an explanation. -# -# Finally, if we DON'T find a template AND the request isn't a browser page -# load, then we implicitly respond with 204 No Content. -# -# source://actionpack//lib/action_controller/metal/implicit_render.rb#29 -module ActionController::ImplicitRender - include ::ActionController::BasicImplicitRender - - # source://actionpack//lib/action_controller/metal/implicit_render.rb#33 - def default_render; end - - # source://actionpack//lib/action_controller/metal/implicit_render.rb#52 - def method_for_action(action_name); end - - private - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/implicit_render.rb#59 - def interactive_browser_request?; end -end - -# Adds instrumentation to several ends in ActionController::Base. It also provides -# some hooks related with process_action. This allows an ORM like Active Record -# and/or DataMapper to plug in ActionController and show related information. -# -# Check ActiveRecord::Railties::ControllerRuntime for an example. -# -# source://actionpack//lib/action_controller/metal/instrumentation.rb#12 -module ActionController::Instrumentation - extend ::ActiveSupport::Concern - include ::ActiveSupport::Benchmarkable - include ::AbstractController::Logger - - mixes_in_class_methods ::ActionController::Instrumentation::ClassMethods - - # source://actionpack//lib/action_controller/metal/instrumentation.rb#40 - def redirect_to(*_arg0); end - - # source://actionpack//lib/action_controller/metal/instrumentation.rb#19 - def render(*_arg0); end - - # source://actionpack//lib/action_controller/metal/instrumentation.rb#34 - def send_data(data, options = T.unsafe(nil)); end - - # source://actionpack//lib/action_controller/metal/instrumentation.rb#27 - def send_file(path, options = T.unsafe(nil)); end - - def view_runtime; end - def view_runtime=(_arg0); end - - private - - # Every time after an action is processed, this method is invoked - # with the payload, so you can add more information. - # - # source://actionpack//lib/action_controller/metal/instrumentation.rb#96 - def append_info_to_payload(payload); end - - # A hook which allows you to clean up any time, wrongly taken into account in - # views, like database querying time. - # - # def cleanup_view_runtime - # super - time_taken_in_something_expensive - # end - # - # source://actionpack//lib/action_controller/metal/instrumentation.rb#90 - def cleanup_view_runtime; end - - # A hook invoked every time a before callback is halted. - # - # source://actionpack//lib/action_controller/metal/instrumentation.rb#80 - def halted_callback_hook(filter, _); end - - # source://actionpack//lib/action_controller/metal/instrumentation.rb#50 - def process_action(*_arg0); end -end - -# source://actionpack//lib/action_controller/metal/instrumentation.rb#100 -module ActionController::Instrumentation::ClassMethods - # A hook which allows other frameworks to log what happened during - # controller process action. This method should return an array - # with the messages to be added. - # - # source://actionpack//lib/action_controller/metal/instrumentation.rb#104 - def log_process_action(payload); end -end - -# source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#8 -class ActionController::InvalidAuthenticityToken < ::ActionController::ActionControllerError; end - -# source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#11 -class ActionController::InvalidCrossOriginRequest < ::ActionController::ActionControllerError; end - -# Mix this module into your controller, and all actions in that controller -# will be able to stream data to the client as it's written. -# -# class MyController < ActionController::Base -# include ActionController::Live -# -# def stream -# response.headers['Content-Type'] = 'text/event-stream' -# 100.times { -# response.stream.write "hello world\n" -# sleep 1 -# } -# ensure -# response.stream.close -# end -# end -# -# There are a few caveats with this module. You *cannot* write headers after the -# response has been committed (Response#committed? will return truthy). -# Calling +write+ or +close+ on the response stream will cause the response -# object to be committed. Make sure all headers are set before calling write -# or close on your stream. -# -# You *must* call close on your stream when you're finished, otherwise the -# socket may be left open forever. -# -# The final caveat is that your actions are executed in a separate thread than -# the main thread. Make sure your actions are thread safe, and this shouldn't -# be a problem (don't share state across threads, etc). -# -# source://actionpack//lib/action_controller/metal/live.rb#37 -module ActionController::Live - extend ::ActiveSupport::Concern - - mixes_in_class_methods ::ActionController::Live::ClassMethods - - # source://actionpack//lib/action_controller/test_case.rb#24 - def new_controller_thread; end - - # source://actionpack//lib/action_controller/metal/live.rb#249 - def process(name); end - - # source://actionpack//lib/action_controller/metal/live.rb#295 - def response_body=(body); end - - # Sends a stream to the browser, which is helpful when you're generating exports or other running data where you - # don't want the entire file buffered in memory first. Similar to send_data, but where the data is generated live. - # - # Options: - # * :filename - suggests a filename for the browser to use. - # * :type - specifies an HTTP content type. - # You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. - # If omitted, type will be inferred from the file extension specified in :filename. - # If no content type is registered for the extension, the default type 'application/octet-stream' will be used. - # * :disposition - specifies whether the file will be shown inline or downloaded. - # Valid values are 'inline' and 'attachment' (default). - # - # Example of generating a csv export: - # - # send_stream(filename: "subscribers.csv") do |stream| - # stream.write "email_address,updated_at\n" - # - # @subscribers.find_each do |subscriber| - # stream.write "#{subscriber.email_address},#{subscriber.updated_at}\n" - # end - # end - # - # source://actionpack//lib/action_controller/metal/live.rb#321 - def send_stream(filename:, disposition: T.unsafe(nil), type: T.unsafe(nil)); end - - private - - # source://actionpack//lib/action_controller/metal/live.rb#348 - def log_error(exception); end -end - -# source://actionpack//lib/action_controller/metal/live.rb#127 -class ActionController::Live::Buffer < ::ActionDispatch::Response::Buffer - include ::MonitorMixin - - # @return [Buffer] a new instance of Buffer - # - # source://actionpack//lib/action_controller/metal/live.rb#143 - def initialize(response); end - - # Inform the producer/writing thread that the client has - # disconnected; the reading thread is no longer interested in - # anything that's being written. - # - # See also #close. - # - # source://actionpack//lib/action_controller/metal/live.rb#193 - def abort; end - - # source://actionpack//lib/action_controller/metal/live.rb#212 - def call_on_error; end - - # Write a 'close' event to the buffer; the producer/writing thread - # uses this to notify us that it's finished supplying content. - # - # See also #abort. - # - # source://actionpack//lib/action_controller/metal/live.rb#180 - def close; end - - # Is the client still connected and waiting for content? - # - # The result of calling `write` when this is `false` is determined - # by `ignore_disconnect`. - # - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/live.rb#204 - def connected?; end - - # Ignore that the client has disconnected. - # - # If this value is `true`, calling `write` after the client - # disconnects will result in the written content being silently - # discarded. If this value is `false` (the default), a - # ClientDisconnected exception will be raised. - # - # source://actionpack//lib/action_controller/metal/live.rb#141 - def ignore_disconnect; end - - # Ignore that the client has disconnected. - # - # If this value is `true`, calling `write` after the client - # disconnects will result in the written content being silently - # discarded. If this value is `false` (the default), a - # ClientDisconnected exception will be raised. - # - # source://actionpack//lib/action_controller/metal/live.rb#141 - def ignore_disconnect=(_arg0); end - - # source://actionpack//lib/action_controller/metal/live.rb#208 - def on_error(&block); end - - # source://actionpack//lib/action_controller/metal/live.rb#151 - def write(string); end - - # Same as +write+ but automatically include a newline at the end of the string. - # - # source://actionpack//lib/action_controller/metal/live.rb#172 - def writeln(string); end - - private - - # source://actionpack//lib/action_controller/metal/live.rb#228 - def build_queue(queue_size); end - - # source://actionpack//lib/action_controller/metal/live.rb#217 - def each_chunk(&block); end - - class << self - # Returns the value of attribute queue_size. - # - # source://actionpack//lib/action_controller/metal/live.rb#131 - def queue_size; end - - # Sets the attribute queue_size - # - # @param value the value to set the attribute queue_size to. - # - # source://actionpack//lib/action_controller/metal/live.rb#131 - def queue_size=(_arg0); end - end -end - -# source://actionpack//lib/action_controller/metal/live.rb#40 -module ActionController::Live::ClassMethods - # source://actionpack//lib/action_controller/metal/live.rb#41 - def make_response!(request); end -end - -# source://actionpack//lib/action_controller/metal/live.rb#124 -class ActionController::Live::ClientDisconnected < ::RuntimeError; end - -# source://actionpack//lib/action_controller/metal/live.rb#233 -class ActionController::Live::Response < ::ActionDispatch::Response - private - - # source://actionpack//lib/action_controller/metal/live.rb#235 - def before_committed; end - - # source://actionpack//lib/action_controller/metal/live.rb#242 - def build_buffer(response, body); end -end - -# This class provides the ability to write an SSE (Server Sent Event) -# to an IO stream. The class is initialized with a stream and can be used -# to either write a JSON string or an object which can be converted to JSON. -# -# Writing an object will convert it into standard SSE format with whatever -# options you have configured. You may choose to set the following options: -# -# 1) Event. If specified, an event with this name will be dispatched on -# the browser. -# 2) Retry. The reconnection time in milliseconds used when attempting -# to send the event. -# 3) Id. If the connection dies while sending an SSE to the browser, then -# the server will receive a +Last-Event-ID+ header with value equal to +id+. -# -# After setting an option in the constructor of the SSE object, all future -# SSEs sent across the stream will use those options unless overridden. -# -# Example Usage: -# -# class MyController < ActionController::Base -# include ActionController::Live -# -# def index -# response.headers['Content-Type'] = 'text/event-stream' -# sse = SSE.new(response.stream, retry: 300, event: "event-name") -# sse.write({ name: 'John'}) -# sse.write({ name: 'John'}, id: 10) -# sse.write({ name: 'John'}, id: 10, event: "other-event") -# sse.write({ name: 'John'}, id: 10, event: "other-event", retry: 500) -# ensure -# sse.close -# end -# end -# -# Note: SSEs are not currently supported by IE. However, they are supported -# by Chrome, Firefox, Opera, and Safari. -# -# source://actionpack//lib/action_controller/metal/live.rb#88 -class ActionController::Live::SSE - # @return [SSE] a new instance of SSE - # - # source://actionpack//lib/action_controller/metal/live.rb#91 - def initialize(stream, options = T.unsafe(nil)); end - - # source://actionpack//lib/action_controller/metal/live.rb#96 - def close; end - - # source://actionpack//lib/action_controller/metal/live.rb#100 - def write(object, options = T.unsafe(nil)); end - - private - - # source://actionpack//lib/action_controller/metal/live.rb#110 - def perform_write(json, options); end -end - -# source://actionpack//lib/action_controller/metal/live.rb#89 -ActionController::Live::SSE::PERMITTED_OPTIONS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_controller/test_case.rb#170 -class ActionController::LiveTestResponse < ::ActionController::Live::Response - # Was there a server-side error? - # - # source://rack/2.2.4/lib/rack/response.rb#141 - def error?; end - - # Was the URL not found? - # - # source://rack/2.2.4/lib/rack/response.rb#151 - def missing?; end - - # Was the response successful? - # - # source://rack/2.2.4/lib/rack/response.rb#138 - def success?; end -end - -# source://actionpack//lib/action_controller/log_subscriber.rb#4 -class ActionController::LogSubscriber < ::ActiveSupport::LogSubscriber - # source://actionpack//lib/action_controller/log_subscriber.rb#67 - def exist_fragment?(event); end - - # source://actionpack//lib/action_controller/log_subscriber.rb#67 - def expire_fragment(event); end - - # source://actionpack//lib/action_controller/log_subscriber.rb#40 - def halted_callback(event); end - - # source://actionpack//lib/action_controller/log_subscriber.rb#76 - def logger; end - - # source://actionpack//lib/action_controller/log_subscriber.rb#20 - def process_action(event); end - - # source://actionpack//lib/action_controller/log_subscriber.rb#67 - def read_fragment(event); end - - # source://actionpack//lib/action_controller/log_subscriber.rb#48 - def redirect_to(event); end - - # source://actionpack//lib/action_controller/log_subscriber.rb#52 - def send_data(event); end - - # source://actionpack//lib/action_controller/log_subscriber.rb#44 - def send_file(event); end - - # source://actionpack//lib/action_controller/log_subscriber.rb#7 - def start_processing(event); end - - # source://actionpack//lib/action_controller/log_subscriber.rb#56 - def unpermitted_parameters(event); end - - # source://actionpack//lib/action_controller/log_subscriber.rb#67 - def write_fragment(event); end -end - -# source://actionpack//lib/action_controller/log_subscriber.rb#5 -ActionController::LogSubscriber::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_controller/metal/logging.rb#4 -module ActionController::Logging - extend ::ActiveSupport::Concern - - mixes_in_class_methods ::ActionController::Logging::ClassMethods -end - -# source://actionpack//lib/action_controller/metal/logging.rb#7 -module ActionController::Logging::ClassMethods - # Set a different log level per request. - # - # # Use the debug log level if a particular cookie is set. - # class ApplicationController < ActionController::Base - # log_at :debug, if: -> { cookies[:debug] } - # end - # - # source://actionpack//lib/action_controller/metal/logging.rb#15 - def log_at(level, **options); end -end - -# ActionController::Metal is the simplest possible controller, providing a -# valid Rack interface without the additional niceties provided by -# ActionController::Base. -# -# A sample metal controller might look like this: -# -# class HelloController < ActionController::Metal -# def index -# self.response_body = "Hello World!" -# end -# end -# -# And then to route requests to your metal controller, you would add -# something like this to config/routes.rb: -# -# get 'hello', to: HelloController.action(:index) -# -# The +action+ method returns a valid Rack application for the \Rails -# router to dispatch to. -# -# == Rendering Helpers -# -# ActionController::Metal by default provides no utilities for rendering -# views, partials, or other responses aside from explicitly calling of -# response_body=, content_type=, and status=. To -# add the render helpers you're used to having in a normal controller, you -# can do the following: -# -# class HelloController < ActionController::Metal -# include AbstractController::Rendering -# include ActionView::Layouts -# append_view_path "#{Rails.root}/app/views" -# -# def index -# render "hello/index" -# end -# end -# -# == Redirection Helpers -# -# To add redirection helpers to your metal controller, do the following: -# -# class HelloController < ActionController::Metal -# include ActionController::Redirecting -# include Rails.application.routes.url_helpers -# -# def index -# redirect_to root_url -# end -# end -# -# == Other Helpers -# -# You can refer to the modules included in ActionController::Base to see -# other features you can bring into your metal controller. -# -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://actionpack//lib/action_controller/metal.rb#117 -class ActionController::Metal < ::AbstractController::Base - include ::ActionController::Testing::Functional - - # @return [Metal] a new instance of Metal - # - # source://actionpack//lib/action_controller/metal.rb#150 - def initialize; end - - # source://actionpack//lib/action_controller/metal.rb#147 - def content_type(*_arg0, &_arg1); end - - # source://actionpack//lib/action_controller/metal.rb#147 - def content_type=(arg); end - - # Delegates to the class's ::controller_name. - # - # source://actionpack//lib/action_controller/metal.rb#141 - def controller_name; end - - # source://actionpack//lib/action_controller/metal.rb#185 - def dispatch(name, request, response); end - - # source://actionpack//lib/action_controller/metal.rb#147 - def headers(*_arg0, &_arg1); end - - # source://actionpack//lib/action_controller/metal.rb#147 - def location(*_arg0, &_arg1); end - - # source://actionpack//lib/action_controller/metal.rb#147 - def location=(arg); end - - # source://actionpack//lib/action_controller/metal.rb#147 - def media_type(*_arg0, &_arg1); end - - # source://actionpack//lib/action_controller/metal.rb#210 - def middleware_stack; end - - # source://actionpack//lib/action_controller/metal.rb#210 - def middleware_stack=(_arg0); end - - # source://actionpack//lib/action_controller/metal.rb#210 - def middleware_stack?; end - - # source://actionpack//lib/action_controller/metal.rb#157 - def params; end - - # source://actionpack//lib/action_controller/metal.rb#161 - def params=(val); end - - # Tests if render or redirect has already happened. - # - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal.rb#181 - def performed?; end - - # source://activesupport/7.0.4/lib/active_support/core_ext/module/attr_internal.rb#33 - def request; end - - # source://activesupport/7.0.4/lib/active_support/core_ext/module/attr_internal.rb#33 - def request=(_arg0); end - - # source://actionpack//lib/action_controller/metal.rb#206 - def reset_session; end - - # source://activesupport/7.0.4/lib/active_support/core_ext/module/attr_internal.rb#33 - def response; end - - # source://activesupport/7.0.4/lib/active_support/core_ext/module/attr_internal.rb#33 - def response=(_arg0); end - - # source://actionpack//lib/action_controller/metal.rb#172 - def response_body=(body); end - - # source://actionpack//lib/action_controller/metal.rb#147 - def response_code(*_arg0, &_arg1); end - - # source://actionpack//lib/action_controller/metal.rb#146 - def session(*_arg0, &_arg1); end - - # source://actionpack//lib/action_controller/metal.rb#197 - def set_request!(request); end - - # source://actionpack//lib/action_controller/metal.rb#193 - def set_response!(response); end - - # source://actionpack//lib/action_controller/metal.rb#147 - def status(*_arg0, &_arg1); end - - # source://actionpack//lib/action_controller/metal.rb#147 - def status=(arg); end - - # source://actionpack//lib/action_controller/metal.rb#202 - def to_a; end - - # Basic url_for that can be overridden for more robust functionality. - # - # source://actionpack//lib/action_controller/metal.rb#168 - def url_for(string); end - - class << self - # Returns a Rack endpoint for the given action name. - # - # source://actionpack//lib/action_controller/metal.rb#231 - def action(name); end - - # source://actionpack//lib/action_controller/metal.rb#136 - def action_encoding_template(action); end - - # Returns the last part of the controller's name, underscored, without the ending - # Controller. For instance, PostsController returns posts. - # Namespaces are left out, so Admin::PostsController returns posts as well. - # - # ==== Returns - # * string - # - # source://actionpack//lib/action_controller/metal.rb#126 - def controller_name; end - - # Direct dispatch to the controller. Instantiates the controller, then - # executes the action named +name+. - # - # source://actionpack//lib/action_controller/metal.rb#247 - def dispatch(name, req, res); end - - # source://actionpack//lib/action_controller/metal.rb#212 - def inherited(base); end - - # source://actionpack//lib/action_controller/metal.rb#130 - def make_response!(request); end - - # Alias for +middleware_stack+. - # - # source://actionpack//lib/action_controller/metal.rb#226 - def middleware; end - - # source://actionpack//lib/action_controller/metal.rb#210 - def middleware_stack; end - - # source://actionpack//lib/action_controller/metal.rb#210 - def middleware_stack=(value); end - - # source://actionpack//lib/action_controller/metal.rb#210 - def middleware_stack?; end - - # Pushes the given Rack middleware and its arguments to the bottom of the - # middleware stack. - # - # source://actionpack//lib/action_controller/metal.rb#220 - def use(*_arg0, &_arg1); end - end -end - -# source://actionpack//lib/action_controller/metal/exceptions.rb#50 -class ActionController::MethodNotAllowed < ::ActionController::ActionControllerError - # @return [MethodNotAllowed] a new instance of MethodNotAllowed - # - # source://actionpack//lib/action_controller/metal/exceptions.rb#51 - def initialize(*allowed_methods); end -end - -# Extend ActionDispatch middleware stack to make it aware of options -# allowing the following syntax in controllers: -# -# class PostsController < ApplicationController -# use AuthenticationMiddleware, except: [:index, :show] -# end -# -# source://actionpack//lib/action_controller/metal.rb#14 -class ActionController::MiddlewareStack < ::ActionDispatch::MiddlewareStack - # source://actionpack//lib/action_controller/metal.rb#27 - def build(action, app = T.unsafe(nil), &block); end - - private - - # source://actionpack//lib/action_controller/metal.rb#40 - def build_middleware(klass, args, block); end -end - -# source://actionpack//lib/action_controller/metal.rb#37 -ActionController::MiddlewareStack::EXCLUDE = T.let(T.unsafe(nil), Proc) - -# source://actionpack//lib/action_controller/metal.rb#36 -ActionController::MiddlewareStack::INCLUDE = T.let(T.unsafe(nil), Proc) - -# source://actionpack//lib/action_controller/metal.rb#15 -class ActionController::MiddlewareStack::Middleware < ::ActionDispatch::MiddlewareStack::Middleware - # @return [Middleware] a new instance of Middleware - # - # source://actionpack//lib/action_controller/metal.rb#16 - def initialize(klass, args, actions, strategy, block); end - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal.rb#22 - def valid?(action); end -end - -# source://actionpack//lib/action_controller/metal.rb#38 -ActionController::MiddlewareStack::NULL = T.let(T.unsafe(nil), Proc) - -# source://actionpack//lib/action_controller/metal/mime_responds.rb#6 -module ActionController::MimeResponds - # Without web-service support, an action which collects the data for displaying a list of people - # might look something like this: - # - # def index - # @people = Person.all - # end - # - # That action implicitly responds to all formats, but formats can also be explicitly enumerated: - # - # def index - # @people = Person.all - # respond_to :html, :js - # end - # - # Here's the same action, with web-service support baked in: - # - # def index - # @people = Person.all - # - # respond_to do |format| - # format.html - # format.js - # format.xml { render xml: @people } - # end - # end - # - # What that says is, "if the client wants HTML or JS in response to this action, just respond as we - # would have before, but if the client wants XML, return them the list of people in XML format." - # (Rails determines the desired response format from the HTTP Accept header submitted by the client.) - # - # Supposing you have an action that adds a new person, optionally creating their company - # (by name) if it does not already exist, without web-services, it might look like this: - # - # def create - # @company = Company.find_or_create_by(name: params[:company][:name]) - # @person = @company.people.create(params[:person]) - # - # redirect_to(person_list_url) - # end - # - # Here's the same action, with web-service support baked in: - # - # def create - # company = params[:person].delete(:company) - # @company = Company.find_or_create_by(name: company[:name]) - # @person = @company.people.create(params[:person]) - # - # respond_to do |format| - # format.html { redirect_to(person_list_url) } - # format.js - # format.xml { render xml: @person.to_xml(include: @company) } - # end - # end - # - # If the client wants HTML, we just redirect them back to the person list. If they want JavaScript, - # then it is an Ajax request and we render the JavaScript template associated with this action. - # Lastly, if the client wants XML, we render the created person as XML, but with a twist: we also - # include the person's company in the rendered XML, so you get something like this: - # - # - # ... - # ... - # - # ... - # ... - # ... - # - # - # - # Note, however, the extra bit at the top of that action: - # - # company = params[:person].delete(:company) - # @company = Company.find_or_create_by(name: company[:name]) - # - # This is because the incoming XML document (if a web-service request is in process) can only contain a - # single root-node. So, we have to rearrange things so that the request looks like this (url-encoded): - # - # person[name]=...&person[company][name]=...&... - # - # And, like this (xml-encoded): - # - # - # ... - # - # ... - # - # - # - # In other words, we make the request so that it operates on a single entity's person. Then, in the action, - # we extract the company data from the request, find or create the company, and then create the new person - # with the remaining data. - # - # Note that you can define your own XML parameter parser which would allow you to describe multiple entities - # in a single request (i.e., by wrapping them all in a single root node), but if you just go with the flow - # and accept Rails' defaults, life will be much easier. - # - # If you need to use a MIME type which isn't supported by default, you can register your own handlers in - # +config/initializers/mime_types.rb+ as follows. - # - # Mime::Type.register "image/jpeg", :jpg - # - # +respond_to+ also allows you to specify a common block for different formats by using +any+: - # - # def index - # @people = Person.all - # - # respond_to do |format| - # format.html - # format.any(:xml, :json) { render request.format.to_sym => @people } - # end - # end - # - # In the example above, if the format is xml, it will render: - # - # render xml: @people - # - # Or if the format is json: - # - # render json: @people - # - # +any+ can also be used with no arguments, in which case it will be used for any format requested by - # the user: - # - # respond_to do |format| - # format.html - # format.any { redirect_to support_path } - # end - # - # Formats can have different variants. - # - # The request variant is a specialization of the request format, like :tablet, - # :phone, or :desktop. - # - # We often want to render different html/json/xml templates for phones, - # tablets, and desktop browsers. Variants make it easy. - # - # You can set the variant in a +before_action+: - # - # request.variant = :tablet if /iPad/.match?(request.user_agent) - # - # Respond to variants in the action just like you respond to formats: - # - # respond_to do |format| - # format.html do |variant| - # variant.tablet # renders app/views/projects/show.html+tablet.erb - # variant.phone { extra_setup; render ... } - # variant.none { special_setup } # executed only if there is no variant set - # end - # end - # - # Provide separate templates for each format and variant: - # - # app/views/projects/show.html.erb - # app/views/projects/show.html+tablet.erb - # app/views/projects/show.html+phone.erb - # - # When you're not sharing any code within the format, you can simplify defining variants - # using the inline syntax: - # - # respond_to do |format| - # format.js { render "trash" } - # format.html.phone { redirect_to progress_path } - # format.html.none { render "trash" } - # end - # - # Variants also support common +any+/+all+ block that formats have. - # - # It works for both inline: - # - # respond_to do |format| - # format.html.any { render html: "any" } - # format.html.phone { render html: "phone" } - # end - # - # and block syntax: - # - # respond_to do |format| - # format.html do |variant| - # variant.any(:tablet, :phablet){ render html: "any" } - # variant.phone { render html: "phone" } - # end - # end - # - # You can also set an array of variants: - # - # request.variant = [:tablet, :phone] - # - # This will work similarly to formats and MIME types negotiation. If there - # is no +:tablet+ variant declared, the +:phone+ variant will be used: - # - # respond_to do |format| - # format.html.none - # format.html.phone # this gets rendered - # end - # - # @raise [ArgumentError] - # @yield [collector] - # - # source://actionpack//lib/action_controller/metal/mime_responds.rb#201 - def respond_to(*mimes); end -end - -# A container for responses available from the current controller for -# requests for different mime-types sent to a particular action. -# -# The public controller methods +respond_to+ may be called with a block -# that is used to define responses to different mime-types, e.g. -# for +respond_to+ : -# -# respond_to do |format| -# format.html -# format.xml { render xml: @people } -# end -# -# In this usage, the argument passed to the block (+format+ above) is an -# instance of the ActionController::MimeResponds::Collector class. This -# object serves as a container in which available responses can be stored by -# calling any of the dynamically generated, mime-type-specific methods such -# as +html+, +xml+ etc on the Collector. Each response is represented by a -# corresponding block if present. -# -# A subsequent call to #negotiate_format(request) will enable the Collector -# to determine which specific mime-type it should respond with for the current -# request, with this response then being accessible by calling #response. -# -# source://actionpack//lib/action_controller/metal/mime_responds.rb#242 -class ActionController::MimeResponds::Collector - include ::AbstractController::Collector - - # @return [Collector] a new instance of Collector - # - # source://actionpack//lib/action_controller/metal/mime_responds.rb#246 - def initialize(mimes, variant = T.unsafe(nil)); end - - # source://actionpack//lib/action_controller/metal/mime_responds.rb#253 - def all(*args, &block); end - - # source://actionpack//lib/action_controller/metal/mime_responds.rb#253 - def any(*args, &block); end - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/mime_responds.rb#271 - def any_response?; end - - # source://actionpack//lib/action_controller/metal/mime_responds.rb#262 - def custom(mime_type, &block); end - - # Returns the value of attribute format. - # - # source://actionpack//lib/action_controller/metal/mime_responds.rb#244 - def format; end - - # Sets the attribute format - # - # @param value the value to set the attribute format to. - # - # source://actionpack//lib/action_controller/metal/mime_responds.rb#244 - def format=(_arg0); end - - # source://actionpack//lib/action_controller/metal/mime_responds.rb#288 - def negotiate_format(request); end - - # source://actionpack//lib/action_controller/metal/mime_responds.rb#275 - def response; end -end - -# source://actionpack//lib/action_controller/metal/mime_responds.rb#292 -class ActionController::MimeResponds::Collector::VariantCollector - # @return [VariantCollector] a new instance of VariantCollector - # - # source://actionpack//lib/action_controller/metal/mime_responds.rb#293 - def initialize(variant = T.unsafe(nil)); end - - # source://actionpack//lib/action_controller/metal/mime_responds.rb#298 - def all(*args, &block); end - - # source://actionpack//lib/action_controller/metal/mime_responds.rb#298 - def any(*args, &block); end - - # source://actionpack//lib/action_controller/metal/mime_responds.rb#309 - def method_missing(name, *args, &block); end - - # source://actionpack//lib/action_controller/metal/mime_responds.rb#313 - def variant; end - - private - - # source://actionpack//lib/action_controller/metal/mime_responds.rb#322 - def variant_key; end -end - -# source://actionpack//lib/action_controller/metal/exceptions.rb#94 -class ActionController::MissingExactTemplate < ::ActionController::UnknownFormat; end - -# source://actionpack//lib/action_controller/metal/exceptions.rb#59 -class ActionController::MissingFile < ::ActionController::ActionControllerError; end - -# See Responder#api_behavior -# -# source://actionpack//lib/action_controller/metal/renderers.rb#17 -class ActionController::MissingRenderer < ::LoadError - # @return [MissingRenderer] a new instance of MissingRenderer - # - # source://actionpack//lib/action_controller/metal/renderers.rb#18 - def initialize(format); end -end - -# source://actionpack//lib/action_controller/metal/exceptions.rb#56 -class ActionController::NotImplemented < ::ActionController::MethodNotAllowed; end - -# Specify binary encoding for parameters for a given action. -# -# source://actionpack//lib/action_controller/metal/parameter_encoding.rb#5 -module ActionController::ParameterEncoding - extend ::ActiveSupport::Concern - - mixes_in_class_methods ::ActionController::ParameterEncoding::ClassMethods -end - -# source://actionpack//lib/action_controller/metal/parameter_encoding.rb#8 -module ActionController::ParameterEncoding::ClassMethods - # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#18 - def action_encoding_template(action); end - - # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#9 - def inherited(klass); end - - # Specify the encoding for a parameter on an action. - # If not specified the default is UTF-8. - # - # You can specify a binary (ASCII_8BIT) parameter with: - # - # class RepositoryController < ActionController::Base - # # This specifies that file_path is not UTF-8 and is instead ASCII_8BIT - # param_encoding :show, :file_path, Encoding::ASCII_8BIT - # - # def show - # @repo = Repository.find_by_filesystem_path params[:file_path] - # - # # params[:repo_name] remains UTF-8 encoded - # @repo_name = params[:repo_name] - # end - # - # def index - # @repositories = Repository.all - # end - # end - # - # The file_path parameter on the show action would be encoded as ASCII-8BIT, - # but all other arguments will remain UTF-8 encoded. - # This is useful in the case where an application must handle data - # but encoding of the data is unknown, like file system data. - # - # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#77 - def param_encoding(action, param, encoding); end - - # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#14 - def setup_param_encode; end - - # Specify that a given action's parameters should all be encoded as - # ASCII-8BIT (it "skips" the encoding default of UTF-8). - # - # For example, a controller would use it like this: - # - # class RepositoryController < ActionController::Base - # skip_parameter_encoding :show - # - # def show - # @repo = Repository.find_by_filesystem_path params[:file_path] - # - # # `repo_name` is guaranteed to be UTF-8, but was ASCII-8BIT, so - # # tag it as such - # @repo_name = params[:repo_name].force_encoding 'UTF-8' - # end - # - # def index - # @repositories = Repository.all - # end - # end - # - # The show action in the above controller would have all parameter values - # encoded as ASCII-8BIT. This is useful in the case where an application - # must handle data but encoding of the data is unknown, like file system data. - # - # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#48 - def skip_parameter_encoding(action); end -end - -# Raised when a required parameter is missing. -# -# params = ActionController::Parameters.new(a: {}) -# params.fetch(:b) -# # => ActionController::ParameterMissing: param is missing or the value is empty: b -# params.require(:a) -# # => ActionController::ParameterMissing: param is missing or the value is empty: a -# -# source://actionpack//lib/action_controller/metal/strong_parameters.rb#21 -class ActionController::ParameterMissing < ::KeyError - # @return [ParameterMissing] a new instance of ParameterMissing - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#24 - def initialize(param, keys = T.unsafe(nil)); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#33 - def corrections; end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#22 - def keys; end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#22 - def param; end -end - -# == Action Controller \Parameters -# -# Allows you to choose which attributes should be permitted for mass updating -# and thus prevent accidentally exposing that which shouldn't be exposed. -# Provides two methods for this purpose: #require and #permit. The former is -# used to mark parameters as required. The latter is used to set the parameter -# as permitted and limit which attributes should be allowed for mass updating. -# -# params = ActionController::Parameters.new({ -# person: { -# name: "Francesco", -# age: 22, -# role: "admin" -# } -# }) -# -# permitted = params.require(:person).permit(:name, :age) -# permitted # => #"Francesco", "age"=>22} permitted: true> -# permitted.permitted? # => true -# -# Person.first.update!(permitted) -# # => # -# -# It provides two options that controls the top-level behavior of new instances: -# -# * +permit_all_parameters+ - If it's +true+, all the parameters will be -# permitted by default. The default is +false+. -# * +action_on_unpermitted_parameters+ - Controls behavior when parameters that are not explicitly -# permitted are found. The default value is :log in test and development environments, -# +false+ otherwise. The values can be: -# * +false+ to take no action. -# * :log to emit an ActiveSupport::Notifications.instrument event on the -# unpermitted_parameters.action_controller topic and log at the DEBUG level. -# * :raise to raise a ActionController::UnpermittedParameters exception. -# -# Examples: -# -# params = ActionController::Parameters.new -# params.permitted? # => false -# -# ActionController::Parameters.permit_all_parameters = true -# -# params = ActionController::Parameters.new -# params.permitted? # => true -# -# params = ActionController::Parameters.new(a: "123", b: "456") -# params.permit(:c) -# # => # -# -# ActionController::Parameters.action_on_unpermitted_parameters = :raise -# -# params = ActionController::Parameters.new(a: "123", b: "456") -# params.permit(:c) -# # => ActionController::UnpermittedParameters: found unpermitted keys: a, b -# -# Please note that these options *are not thread-safe*. In a multi-threaded -# environment they should only be set once at boot-time and never mutated at -# runtime. -# -# You can fetch values of ActionController::Parameters using either -# :key or "key". -# -# params = ActionController::Parameters.new(key: "value") -# params[:key] # => "value" -# params["key"] # => "value" -# -# source://actionpack//lib/action_controller/metal/strong_parameters.rb#132 -class ActionController::Parameters - # Returns a new instance of ActionController::Parameters. - # Also, sets the +permitted+ attribute to the default value of - # ActionController::Parameters.permit_all_parameters. - # - # class Person < ActiveRecord::Base - # end - # - # params = ActionController::Parameters.new(name: "Francesco") - # params.permitted? # => false - # Person.new(params) # => ActiveModel::ForbiddenAttributesError - # - # ActionController::Parameters.permit_all_parameters = true - # - # params = ActionController::Parameters.new(name: "Francesco") - # params.permitted? # => true - # Person.new(params) # => # - # - # @return [Parameters] a new instance of Parameters - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#267 - def initialize(parameters = T.unsafe(nil), logging_context = T.unsafe(nil)); end - - # Returns true if another +Parameters+ object contains the same content and - # permitted flag. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#275 - def ==(other); end - - # Returns a parameter for the given +key+. If not found, - # returns +nil+. - # - # params = ActionController::Parameters.new(person: { name: "Francesco" }) - # params[:person] # => #"Francesco"} permitted: false> - # params[:none] # => nil - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#643 - def [](key); end - - # Assigns a value to a given +key+. The given key may still get filtered out - # when +permit+ is called. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#649 - def []=(key, value); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#243 - def always_permitted_parameters; end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#243 - def always_permitted_parameters=(val); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 - def as_json(*_arg0, &_arg1); end - - # Returns a new instance of ActionController::Parameters with +nil+ values removed. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#819 - def compact; end - - # Removes all +nil+ values in place and returns +self+, or +nil+ if no changes were made. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#824 - def compact!; end - - # Returns a new instance of ActionController::Parameters without the blank values. - # Uses Object#blank? for determining if a value is blank. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#830 - def compact_blank; end - - # Removes all blank values in place and returns self. - # Uses Object#blank? for determining if a value is blank. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#836 - def compact_blank!; end - - # Attribute that keeps track of converted arrays, if any, to avoid double - # looping in the common use case permit + mass-assignment. Defined in a - # method to instantiate it only if needed. - # - # Testing membership still loops, but it's going to be faster than our own - # loop that converts values. Also, we are not going to build a new array - # object per fetch. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#407 - def converted_arrays; end - - # Returns duplicate of object including all parameters. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#921 - def deep_dup; end - - # Returns a new ActionController::Parameters instance with the - # results of running +block+ once for every key. This includes the keys - # from the root hash and from all nested hashes and arrays. The values are unchanged. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#770 - def deep_transform_keys(&block); end - - # Returns the ActionController::Parameters instance changing its keys. - # This includes the keys from the root hash and from all nested hashes and arrays. - # The values are unchanged. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#779 - def deep_transform_keys!(&block); end - - # Deletes a key-value pair from +Parameters+ and returns the value. If - # +key+ is not found, returns +nil+ (or, with optional code block, yields - # +key+ and returns the result). Cf. #extract!, which returns the - # corresponding +ActionController::Parameters+ object. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#788 - def delete(key, &block); end - - # Removes items that the block evaluates to true and returns self. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#812 - def delete_if(&block); end - - # Extracts the nested parameter from the given +keys+ by calling +dig+ - # at each step. Returns +nil+ if any intermediate step is +nil+. - # - # params = ActionController::Parameters.new(foo: { bar: { baz: 1 } }) - # params.dig(:foo, :bar, :baz) # => 1 - # params.dig(:foo, :zot, :xyz) # => nil - # - # params2 = ActionController::Parameters.new(foo: [10, 11, 12]) - # params2.dig(:foo, 1) # => 11 - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#687 - def dig(*keys); end - - # Convert all hashes in values into parameters, then yield each pair in - # the same way as Hash#each_pair. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#379 - def each(&block); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 - def each_key(*_arg0, &_arg1); end - - # Convert all hashes in values into parameters, then yield each pair in - # the same way as Hash#each_pair. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#379 - def each_pair(&block); end - - # Convert all hashes in values into parameters, then yield each value in - # the same way as Hash#each_value. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#391 - def each_value(&block); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 - def empty?(*_arg0, &_arg1); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#916 - def encode_with(coder); end - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#283 - def eql?(other); end - - # Returns a new ActionController::Parameters instance that - # filters out the given +keys+. - # - # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) - # params.except(:a, :b) # => #3} permitted: false> - # params.except(:d) # => #1, "b"=>2, "c"=>3} permitted: false> - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#716 - def except(*keys); end - - # Removes and returns the key/value pairs matching the given keys. - # - # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) - # params.extract!(:a, :b) # => #1, "b"=>2} permitted: false> - # params # => #3} permitted: false> - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#725 - def extract!(*keys); end - - # Returns a parameter for the given +key+. If the +key+ - # can't be found, there are several options: With no other arguments, - # it will raise an ActionController::ParameterMissing error; - # if a second argument is given, then that is returned (converted to an - # instance of ActionController::Parameters if possible); if a block - # is given, then that will be run and its result returned. - # - # params = ActionController::Parameters.new(person: { name: "Francesco" }) - # params.fetch(:person) # => #"Francesco"} permitted: false> - # params.fetch(:none) # => ActionController::ParameterMissing: param is missing or the value is empty: none - # params.fetch(:none, {}) # => # - # params.fetch(:none, "Francesco") # => "Francesco" - # params.fetch(:none) { "Francesco" } # => "Francesco" - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#666 - def fetch(key, *args); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 - def has_key?(*_arg0, &_arg1); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 - def has_value?(*_arg0, &_arg1); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#289 - def hash; end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 - def include?(*_arg0, &_arg1); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#898 - def init_with(coder); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#885 - def inspect; end - - # Equivalent to Hash#keep_if, but returns +nil+ if no changes were made. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#799 - def keep_if(&block); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 - def key?(*_arg0, &_arg1); end - - # :method: values - # - # :call-seq: - # values() - # - # Returns a new array of the values of the parameters. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 - def keys(*_arg0, &_arg1); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 - def member?(*_arg0, &_arg1); end - - # Returns a new ActionController::Parameters with all keys from - # +other_hash+ merged into current hash. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#848 - def merge(other_hash); end - - # Returns current ActionController::Parameters instance with - # +other_hash+ merged into current hash. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#856 - def merge!(other_hash); end - - # Returns a new ActionController::Parameters instance that - # includes only the given +filters+ and sets the +permitted+ attribute - # for the object to +true+. This is useful for limiting which attributes - # should be allowed for mass updating. - # - # params = ActionController::Parameters.new(user: { name: "Francesco", age: 22, role: "admin" }) - # permitted = params.require(:user).permit(:name, :age) - # permitted.permitted? # => true - # permitted.has_key?(:name) # => true - # permitted.has_key?(:age) # => true - # permitted.has_key?(:role) # => false - # - # Only permitted scalars pass the filter. For example, given - # - # params.permit(:name) - # - # +:name+ passes if it is a key of +params+ whose associated value is of type - # +String+, +Symbol+, +NilClass+, +Numeric+, +TrueClass+, +FalseClass+, - # +Date+, +Time+, +DateTime+, +StringIO+, +IO+, - # +ActionDispatch::Http::UploadedFile+ or +Rack::Test::UploadedFile+. - # Otherwise, the key +:name+ is filtered out. - # - # You may declare that the parameter should be an array of permitted scalars - # by mapping it to an empty array: - # - # params = ActionController::Parameters.new(tags: ["rails", "parameters"]) - # params.permit(tags: []) - # - # Sometimes it is not possible or convenient to declare the valid keys of - # a hash parameter or its internal structure. Just map to an empty hash: - # - # params.permit(preferences: {}) - # - # Be careful because this opens the door to arbitrary input. In this - # case, +permit+ ensures values in the returned structure are permitted - # scalars and filters out anything else. - # - # You can also use +permit+ on nested parameters, like: - # - # params = ActionController::Parameters.new({ - # person: { - # name: "Francesco", - # age: 22, - # pets: [{ - # name: "Purplish", - # category: "dogs" - # }] - # } - # }) - # - # permitted = params.permit(person: [ :name, { pets: :name } ]) - # permitted.permitted? # => true - # permitted[:person][:name] # => "Francesco" - # permitted[:person][:age] # => nil - # permitted[:person][:pets][0][:name] # => "Purplish" - # permitted[:person][:pets][0][:category] # => nil - # - # Note that if you use +permit+ in a key that points to a hash, - # it won't allow all the hash. You also need to specify which - # attributes inside the hash should be permitted. - # - # params = ActionController::Parameters.new({ - # person: { - # contact: { - # email: "none@test.com", - # phone: "555-1234" - # } - # } - # }) - # - # params.require(:person).permit(:contact) - # # => # - # - # params.require(:person).permit(contact: :phone) - # # => ##"555-1234"} permitted: true>} permitted: true> - # - # params.require(:person).permit(contact: [ :email, :phone ]) - # # => ##"none@test.com", "phone"=>"555-1234"} permitted: true>} permitted: true> - # - # If your parameters specify multiple parameters indexed by a number, - # you can permit each set of parameters under the numeric key to be the same using the same syntax as permitting a single item. - # - # params = ActionController::Parameters.new({ - # person: { - # '0': { - # email: "none@test.com", - # phone: "555-1234" - # }, - # '1': { - # email: "nothing@test.com", - # phone: "555-6789" - # }, - # } - # }) - # params.permit(person: [:email]).to_h - # # => {"person"=>{"0"=>{"email"=>"none@test.com"}, "1"=>{"email"=>"nothing@test.com"}}} - # - # If you want to specify what keys you want from each numeric key, you can instead specify each one individually - # - # params = ActionController::Parameters.new({ - # person: { - # '0': { - # email: "none@test.com", - # phone: "555-1234" - # }, - # '1': { - # email: "nothing@test.com", - # phone: "555-6789" - # }, - # } - # }) - # params.permit(person: { '0': [:email], '1': [:phone]}).to_h - # # => {"person"=>{"0"=>{"email"=>"none@test.com"}, "1"=>{"phone"=>"555-6789"}}} - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#620 - def permit(*filters); end - - # Sets the +permitted+ attribute to +true+. This can be used to pass - # mass assignment. Returns +self+. - # - # class Person < ActiveRecord::Base - # end - # - # params = ActionController::Parameters.new(name: "Francesco") - # params.permitted? # => false - # Person.new(params) # => ActiveModel::ForbiddenAttributesError - # params.permit! - # params.permitted? # => true - # Person.new(params) # => # - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#433 - def permit!; end - - # Returns +true+ if the parameter is permitted, +false+ otherwise. - # - # params = ActionController::Parameters.new - # params.permitted? # => false - # params.permit! - # params.permitted? # => true - # - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#417 - def permitted?; end - - # Returns a new instance of ActionController::Parameters with items - # that the block evaluates to true removed. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#807 - def reject(&block); end - - # Removes items that the block evaluates to true and returns self. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#812 - def reject!(&block); end - - # This method accepts both a single key and an array of keys. - # - # When passed a single key, if it exists and its associated value is - # either present or the singleton +false+, returns said value: - # - # ActionController::Parameters.new(person: { name: "Francesco" }).require(:person) - # # => #"Francesco"} permitted: false> - # - # Otherwise raises ActionController::ParameterMissing: - # - # ActionController::Parameters.new.require(:person) - # # ActionController::ParameterMissing: param is missing or the value is empty: person - # - # ActionController::Parameters.new(person: nil).require(:person) - # # ActionController::ParameterMissing: param is missing or the value is empty: person - # - # ActionController::Parameters.new(person: "\t").require(:person) - # # ActionController::ParameterMissing: param is missing or the value is empty: person - # - # ActionController::Parameters.new(person: {}).require(:person) - # # ActionController::ParameterMissing: param is missing or the value is empty: person - # - # When given an array of keys, the method tries to require each one of them - # in order. If it succeeds, an array with the respective return values is - # returned: - # - # params = ActionController::Parameters.new(user: { ... }, profile: { ... }) - # user_params, profile_params = params.require([:user, :profile]) - # - # Otherwise, the method re-raises the first exception found: - # - # params = ActionController::Parameters.new(user: {}, profile: {}) - # user_params, profile_params = params.require([:user, :profile]) - # # ActionController::ParameterMissing: param is missing or the value is empty: user - # - # Technically this method can be used to fetch terminal values: - # - # # CAREFUL - # params = ActionController::Parameters.new(person: { name: "Finn" }) - # name = params.require(:person).require(:name) # CAREFUL - # - # but take into account that at some point those ones have to be permitted: - # - # def person_params - # params.require(:person).permit(:name).tap do |person_params| - # person_params.require(:name) # SAFER - # end - # end - # - # for example. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#494 - def require(key); end - - # This method accepts both a single key and an array of keys. - # - # When passed a single key, if it exists and its associated value is - # either present or the singleton +false+, returns said value: - # - # ActionController::Parameters.new(person: { name: "Francesco" }).require(:person) - # # => #"Francesco"} permitted: false> - # - # Otherwise raises ActionController::ParameterMissing: - # - # ActionController::Parameters.new.require(:person) - # # ActionController::ParameterMissing: param is missing or the value is empty: person - # - # ActionController::Parameters.new(person: nil).require(:person) - # # ActionController::ParameterMissing: param is missing or the value is empty: person - # - # ActionController::Parameters.new(person: "\t").require(:person) - # # ActionController::ParameterMissing: param is missing or the value is empty: person - # - # ActionController::Parameters.new(person: {}).require(:person) - # # ActionController::ParameterMissing: param is missing or the value is empty: person - # - # When given an array of keys, the method tries to require each one of them - # in order. If it succeeds, an array with the respective return values is - # returned: - # - # params = ActionController::Parameters.new(user: { ... }, profile: { ... }) - # user_params, profile_params = params.require([:user, :profile]) - # - # Otherwise, the method re-raises the first exception found: - # - # params = ActionController::Parameters.new(user: {}, profile: {}) - # user_params, profile_params = params.require([:user, :profile]) - # # ActionController::ParameterMissing: param is missing or the value is empty: user - # - # Technically this method can be used to fetch terminal values: - # - # # CAREFUL - # params = ActionController::Parameters.new(person: { name: "Finn" }) - # name = params.require(:person).require(:name) # CAREFUL - # - # but take into account that at some point those ones have to be permitted: - # - # def person_params - # params.require(:person).permit(:name).tap do |person_params| - # person_params.require(:name) # SAFER - # end - # end - # - # for example. - # Alias of #require. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#494 - def required(key); end - - # Returns a new ActionController::Parameters with all keys from - # current hash merged into +other_hash+. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#863 - def reverse_merge(other_hash); end - - # Returns current ActionController::Parameters instance with - # current hash merged into +other_hash+. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#872 - def reverse_merge!(other_hash); end - - # Returns a new instance of ActionController::Parameters with only - # items that the block evaluates to true. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#794 - def select(&block); end - - # Equivalent to Hash#keep_if, but returns +nil+ if no changes were made. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#799 - def select!(&block); end - - # Returns a new ActionController::Parameters instance that - # includes only the given +keys+. If the given +keys+ - # don't exist, returns an empty hash. - # - # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) - # params.slice(:a, :b) # => #1, "b"=>2} permitted: false> - # params.slice(:d) # => # - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#699 - def slice(*keys); end - - # Returns current ActionController::Parameters instance which - # contains only the given +keys+. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#705 - def slice!(*keys); end - - # This is required by ActiveModel attribute assignment, so that user can - # pass +Parameters+ to a mass assignment methods in a model. It should not - # matter as we are using +HashWithIndifferentAccess+ internally. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#881 - def stringify_keys; end - - # Returns a safe ActiveSupport::HashWithIndifferentAccess - # representation of the parameters with all unpermitted keys removed. - # - # params = ActionController::Parameters.new({ - # name: "Senjougahara Hitagi", - # oddity: "Heavy stone crab" - # }) - # params.to_h - # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash - # - # safe_params = params.permit(:name) - # safe_params.to_h # => {"name"=>"Senjougahara Hitagi"} - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#305 - def to_h; end - - # Returns a safe Hash representation of the parameters - # with all unpermitted keys removed. - # - # params = ActionController::Parameters.new({ - # name: "Senjougahara Hitagi", - # oddity: "Heavy stone crab" - # }) - # params.to_hash - # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash - # - # safe_params = params.permit(:name) - # safe_params.to_hash # => {"name"=>"Senjougahara Hitagi"} - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#325 - def to_hash; end - - # Returns a string representation of the receiver suitable for use as a URL - # query string: - # - # params = ActionController::Parameters.new({ - # name: "David", - # nationality: "Danish" - # }) - # params.to_query - # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash - # - # safe_params = params.permit(:name, :nationality) - # safe_params.to_query - # # => "name=David&nationality=Danish" - # - # An optional namespace can be passed to enclose key names: - # - # params = ActionController::Parameters.new({ - # name: "David", - # nationality: "Danish" - # }) - # safe_params = params.permit(:name, :nationality) - # safe_params.to_query("user") - # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" - # - # The string pairs "key=value" that conform the query string - # are sorted lexicographically in ascending order. - # - # This method is also aliased as +to_param+. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#357 - def to_param(*args); end - - # Returns a string representation of the receiver suitable for use as a URL - # query string: - # - # params = ActionController::Parameters.new({ - # name: "David", - # nationality: "Danish" - # }) - # params.to_query - # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash - # - # safe_params = params.permit(:name, :nationality) - # safe_params.to_query - # # => "name=David&nationality=Danish" - # - # An optional namespace can be passed to enclose key names: - # - # params = ActionController::Parameters.new({ - # name: "David", - # nationality: "Danish" - # }) - # safe_params = params.permit(:name, :nationality) - # safe_params.to_query("user") - # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" - # - # The string pairs "key=value" that conform the query string - # are sorted lexicographically in ascending order. - # - # This method is also aliased as +to_param+. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#357 - def to_query(*args); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 - def to_s(*_arg0, &_arg1); end - - # Returns an unsafe, unfiltered - # ActiveSupport::HashWithIndifferentAccess representation of the - # parameters. - # - # params = ActionController::Parameters.new({ - # name: "Senjougahara Hitagi", - # oddity: "Heavy stone crab" - # }) - # params.to_unsafe_h - # # => {"name"=>"Senjougahara Hitagi", "oddity" => "Heavy stone crab"} - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#372 - def to_unsafe_h; end - - # Returns an unsafe, unfiltered - # ActiveSupport::HashWithIndifferentAccess representation of the - # parameters. - # - # params = ActionController::Parameters.new({ - # name: "Senjougahara Hitagi", - # oddity: "Heavy stone crab" - # }) - # params.to_unsafe_h - # # => {"name"=>"Senjougahara Hitagi", "oddity" => "Heavy stone crab"} - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#372 - def to_unsafe_hash; end - - # Returns a new ActionController::Parameters instance with the - # results of running +block+ once for every key. The values are unchanged. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#752 - def transform_keys(&block); end - - # Performs keys transformation and returns the altered - # ActionController::Parameters instance. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#761 - def transform_keys!(&block); end - - # Returns a new ActionController::Parameters with the results of - # running +block+ once for every value. The keys are unchanged. - # - # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) - # params.transform_values { |x| x * 2 } - # # => #2, "b"=>4, "c"=>6} permitted: false> - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#735 - def transform_values; end - - # Performs values transformation and returns the altered - # ActionController::Parameters instance. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#744 - def transform_values!; end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 - def value?(*_arg0, &_arg1); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#233 - def values(*_arg0, &_arg1); end - - # Returns values that were assigned to the given +keys+. Note that all the - # +Hash+ objects will be converted to ActionController::Parameters. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#842 - def values_at(*keys); end - - # Returns a new ActionController::Parameters with all keys from - # current hash merged into +other_hash+. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#863 - def with_defaults(other_hash); end - - # Returns current ActionController::Parameters instance with - # current hash merged into +other_hash+. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#872 - def with_defaults!(other_hash); end - - protected - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#936 - def each_nested_attribute; end - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#932 - def nested_attributes?; end - - # Returns the value of attribute parameters. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#928 - def parameters; end - - # Sets the attribute permitted - # - # @param value the value to set the attribute permitted to. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#930 - def permitted=(_arg0); end - - private - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1076 - def array_of_permitted_scalars?(value); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#964 - def convert_hashes_to_parameters(key, value); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#949 - def convert_parameters_to_hashes(value, using); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#970 - def convert_value_to_parameters(value); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#990 - def each_element(object, filter, &block); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1088 - def hash_filter(params, filter); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1147 - def initialize_copy(source); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#943 - def new_instance_with_inherited_permitted_status(hash); end - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1082 - def non_scalar?(value); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1132 - def permit_any_in_array(array); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1115 - def permit_any_in_parameters(params); end - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1047 - def permitted_scalar?(value); end - - # Adds existing keys to the params if their values are scalar. - # - # For example: - # - # puts self.keys #=> ["zipcode(90210i)"] - # params = {} - # - # permitted_scalar_filter(params, "zipcode") - # - # puts params.keys # => ["zipcode"] - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1061 - def permitted_scalar_filter(params, permitted_key); end - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#984 - def specify_numeric_keys?(filter); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1016 - def unpermitted_keys(params); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1003 - def unpermitted_parameters!(params); end - - class << self - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#135 - def action_on_unpermitted_parameters; end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#135 - def action_on_unpermitted_parameters=(val); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#243 - def always_permitted_parameters; end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#243 - def always_permitted_parameters=(val); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#889 - def hook_into_yaml_loading; end - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#246 - def nested_attribute?(key, value); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#133 - def permit_all_parameters; end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#133 - def permit_all_parameters=(val); end - end -end - -# source://actionpack//lib/action_controller/metal/strong_parameters.rb#1086 -ActionController::Parameters::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_controller/metal/strong_parameters.rb#1087 -ActionController::Parameters::EMPTY_HASH = T.let(T.unsafe(nil), Hash) - -# This is a list of permitted scalar types that includes the ones -# supported in XML and JSON requests. -# -# This list is in particular used to filter ordinary requests, String goes -# as first element to quickly short-circuit the common case. -# -# If you modify this collection please update the API of +permit+ above. -# -# source://actionpack//lib/action_controller/metal/strong_parameters.rb#1031 -ActionController::Parameters::PERMITTED_SCALAR_TYPES = T.let(T.unsafe(nil), Array) - -# Wraps the parameters hash into a nested hash. This will allow clients to -# submit requests without having to specify any root elements. -# -# This functionality is enabled by default for JSON, and can be customized by -# setting the format array: -# -# class ApplicationController < ActionController::Base -# wrap_parameters format: [:json, :xml] -# end -# -# You could also turn it on per controller: -# -# class UsersController < ApplicationController -# wrap_parameters format: [:json, :xml, :url_encoded_form, :multipart_form] -# end -# -# If you enable +ParamsWrapper+ for +:json+ format, instead of having to -# send JSON parameters like this: -# -# {"user": {"name": "Konata"}} -# -# You can send parameters like this: -# -# {"name": "Konata"} -# -# And it will be wrapped into a nested hash with the key name matching the -# controller's name. For example, if you're posting to +UsersController+, -# your new +params+ hash will look like this: -# -# {"name" => "Konata", "user" => {"name" => "Konata"}} -# -# You can also specify the key in which the parameters should be wrapped to, -# and also the list of attributes it should wrap by using either +:include+ or -# +:exclude+ options like this: -# -# class UsersController < ApplicationController -# wrap_parameters :person, include: [:username, :password] -# end -# -# On Active Record models with no +:include+ or +:exclude+ option set, -# it will only wrap the parameters returned by the class method -# attribute_names. -# -# If you're going to pass the parameters to an +ActiveModel+ object (such as -# User.new(params[:user])), you might consider passing the model class to -# the method instead. The +ParamsWrapper+ will actually try to determine the -# list of attribute names from the model and only wrap those attributes: -# -# class UsersController < ApplicationController -# wrap_parameters Person -# end -# -# You still could pass +:include+ and +:exclude+ to set the list of attributes -# you want to wrap. -# -# By default, if you don't specify the key in which the parameters would be -# wrapped to, +ParamsWrapper+ will actually try to determine if there's -# a model related to it or not. This controller, for example: -# -# class Admin::UsersController < ApplicationController -# end -# -# will try to check if Admin::User or +User+ model exists, and use it to -# determine the wrapper key respectively. If both models don't exist, -# it will then fallback to use +user+ as the key. -# -# To disable this functionality for a controller: -# -# class UsersController < ApplicationController -# wrap_parameters false -# end -# -# source://actionpack//lib/action_controller/metal/params_wrapper.rb#80 -module ActionController::ParamsWrapper - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::ActionController::ParamsWrapper::ClassMethods - - private - - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#277 - def _extract_parameters(parameters); end - - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#299 - def _perform_parameter_wrapping; end - - # Returns the list of parameters which will be selected for wrapped. - # - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#273 - def _wrap_parameters(parameters); end - - # Checks if we should perform parameters wrapping. - # - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#289 - def _wrapper_enabled?; end - - # Returns the list of enabled formats. - # - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#268 - def _wrapper_formats; end - - # Returns the wrapper key which will be used to store wrapped parameters. - # - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#263 - def _wrapper_key; end - - # Performs parameters wrapping upon the request. Called automatically - # by the metal call stack. - # - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#257 - def process_action(*_arg0); end - - module GeneratedClassMethods - def _wrapper_options; end - def _wrapper_options=(value); end - def _wrapper_options?; end - end - - module GeneratedInstanceMethods - def _wrapper_options; end - def _wrapper_options=(value); end - def _wrapper_options?; end - end -end - -# source://actionpack//lib/action_controller/metal/params_wrapper.rb#188 -module ActionController::ParamsWrapper::ClassMethods - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#189 - def _set_wrapper_options(options); end - - # Sets the default wrapper key or model which will be used to determine - # wrapper key and attribute names. Called automatically when the - # module is inherited. - # - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#244 - def inherited(klass); end - - # Sets the name of the wrapper key, or the model which +ParamsWrapper+ - # would use to determine the attribute names from. - # - # ==== Examples - # wrap_parameters format: :xml - # # enables the parameter wrapper for XML format - # - # wrap_parameters :person - # # wraps parameters into +params[:person]+ hash - # - # wrap_parameters Person - # # wraps parameters by determining the wrapper key from Person class - # # (+person+, in this case) and the list of attribute names - # - # wrap_parameters include: [:username, :title] - # # wraps only +:username+ and +:title+ attributes from parameters. - # - # wrap_parameters false - # # disables parameters wrapping for this controller altogether. - # - # ==== Options - # * :format - The list of formats in which the parameters wrapper - # will be enabled. - # * :include - The list of attribute names which parameters wrapper - # will wrap into a nested hash. - # * :exclude - The list of attribute names which parameters wrapper - # will exclude from a nested hash. - # - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#220 - def wrap_parameters(name_or_model_or_options, options = T.unsafe(nil)); end -end - -# source://actionpack//lib/action_controller/metal/params_wrapper.rb#83 -ActionController::ParamsWrapper::EXCLUDE_PARAMETERS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_controller/metal/params_wrapper.rb#87 -class ActionController::ParamsWrapper::Options < ::Struct - include ::Mutex_m - - # @return [Options] a new instance of Options - # - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#98 - def initialize(name, format, include, exclude, klass, model); end - - # Returns the value of attribute include - # - # @return [Object] the current value of include - # - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#108 - def include; end - - # source://mutex_m/0.1.0/mutex_m.rb#92 - def lock; end - - # source://mutex_m/0.1.0/mutex_m.rb#82 - def locked?; end - - # Returns the value of attribute model - # - # @return [Object] the current value of model - # - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#104 - def model; end - - # Returns the value of attribute name - # - # @return [Object] the current value of name - # - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#141 - def name; end - - # source://mutex_m/0.1.0/mutex_m.rb#77 - def synchronize(&block); end - - # source://mutex_m/0.1.0/mutex_m.rb#87 - def try_lock; end - - # source://mutex_m/0.1.0/mutex_m.rb#97 - def unlock; end - - private - - # Determine the wrapper model from the controller's name. By convention, - # this could be done by trying to find the defined model that has the - # same singular name as the controller. For example, +UsersController+ - # will try to find if the +User+ model exists. - # - # This method also does namespace lookup. Foo::Bar::UsersController will - # try to find Foo::Bar::User, Foo::User and finally User. - # - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#165 - def _default_wrap_model; end - - class << self - # source://actionpack//lib/action_controller/metal/params_wrapper.rb#90 - def from_hash(hash); end - end -end - -# source://actionpack//lib/action_controller/metal/permissions_policy.rb#4 -module ActionController::PermissionsPolicy - extend ::ActiveSupport::Concern - - mixes_in_class_methods ::ActionController::PermissionsPolicy::ClassMethods -end - -# source://actionpack//lib/action_controller/metal/permissions_policy.rb#7 -module ActionController::PermissionsPolicy::ClassMethods - # Overrides parts of the globally configured Feature-Policy - # header: - # - # class PagesController < ApplicationController - # permissions_policy do |policy| - # policy.geolocation "https://example.com" - # end - # end - # - # Options can be passed similar to +before_action+. For example, pass - # only: :index to override the header on the index action only: - # - # class PagesController < ApplicationController - # permissions_policy(only: :index) do |policy| - # policy.camera :self - # end - # end - # - # source://actionpack//lib/action_controller/metal/permissions_policy.rb#26 - def permissions_policy(**options, &block); end -end - -# source://actionpack//lib/action_controller/railtie.rb#11 -class ActionController::Railtie < ::Rails::Railtie; end - -# source://actionpack//lib/action_controller/railties/helpers.rb#4 -module ActionController::Railties; end - -# source://actionpack//lib/action_controller/railties/helpers.rb#5 -module ActionController::Railties::Helpers - # source://actionpack//lib/action_controller/railties/helpers.rb#6 - def inherited(klass); end -end - -# source://actionpack//lib/action_controller/metal/redirecting.rb#4 -module ActionController::Redirecting - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - include ::ActiveSupport::Benchmarkable - include ::AbstractController::Logger - include ::ActionDispatch::Routing::UrlFor - include ::AbstractController::UrlFor - include ::ActionController::UrlFor - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods - - # source://actionpack//lib/action_controller/metal/redirecting.rb#130 - def _compute_redirect_to_location(request, options); end - - # Soft deprecated alias for #redirect_back_or_to where the +fallback_location+ location is supplied as a keyword argument instead - # of the first positional argument. - # - # source://actionpack//lib/action_controller/metal/redirecting.rb#95 - def redirect_back(fallback_location:, allow_other_host: T.unsafe(nil), **args); end - - # Redirects the browser to the page that issued the request (the referrer) - # if possible, otherwise redirects to the provided default fallback - # location. - # - # The referrer information is pulled from the HTTP +Referer+ (sic) header on - # the request. This is an optional header and its presence on the request is - # subject to browser security settings and user preferences. If the request - # is missing this header, the fallback_location will be used. - # - # redirect_back_or_to({ action: "show", id: 5 }) - # redirect_back_or_to @post - # redirect_back_or_to "http://www.rubyonrails.org" - # redirect_back_or_to "/images/screenshot.jpg" - # redirect_back_or_to posts_url - # redirect_back_or_to proc { edit_post_url(@post) } - # redirect_back_or_to '/', allow_other_host: false - # - # ==== Options - # * :allow_other_host - Allow or disallow redirection to the host that is different to the current host, defaults to true. - # - # All other options that can be passed to #redirect_to are accepted as - # options, and the behavior is identical. - # - # source://actionpack//lib/action_controller/metal/redirecting.rb#121 - def redirect_back_or_to(fallback_location, allow_other_host: T.unsafe(nil), **options); end - - # Redirects the browser to the target specified in +options+. This parameter can be any one of: - # - # * Hash - The URL will be generated by calling url_for with the +options+. - # * Record - The URL will be generated by calling url_for with the +options+, which will reference a named URL for that record. - # * String starting with protocol:// (like http://) or a protocol relative reference (like //) - Is passed straight through as the target for redirection. - # * String not containing a protocol - The current protocol and host is prepended to the string. - # * Proc - A block that will be executed in the controller's context. Should return any option accepted by +redirect_to+. - # - # === Examples: - # - # redirect_to action: "show", id: 5 - # redirect_to @post - # redirect_to "http://www.rubyonrails.org" - # redirect_to "/images/screenshot.jpg" - # redirect_to posts_url - # redirect_to proc { edit_post_url(@post) } - # - # The redirection happens as a 302 Found header unless otherwise specified using the :status option: - # - # redirect_to post_url(@post), status: :found - # redirect_to action: 'atom', status: :moved_permanently - # redirect_to post_url(@post), status: 301 - # redirect_to action: 'atom', status: 302 - # - # The status code can either be a standard {HTTP Status code}[https://www.iana.org/assignments/http-status-codes] as an - # integer, or a symbol representing the downcased, underscored and symbolized description. - # Note that the status code must be a 3xx HTTP code, or redirection will not occur. - # - # If you are using XHR requests other than GET or POST and redirecting after the - # request then some browsers will follow the redirect using the original request - # method. This may lead to undesirable behavior such as a double DELETE. To work - # around this you can return a 303 See Other status code which will be - # followed using a GET request. - # - # redirect_to posts_url, status: :see_other - # redirect_to action: 'index', status: 303 - # - # It is also possible to assign a flash message as part of the redirection. There are two special accessors for the commonly used flash names - # +alert+ and +notice+ as well as a general purpose +flash+ bucket. - # - # redirect_to post_url(@post), alert: "Watch it, mister!" - # redirect_to post_url(@post), status: :found, notice: "Pay attention to the road" - # redirect_to post_url(@post), status: 301, flash: { updated_post_id: @post.id } - # redirect_to({ action: 'atom' }, alert: "Something serious happened") - # - # Statements after +redirect_to+ in our controller get executed, so +redirect_to+ doesn't stop the execution of the function. - # To terminate the execution of the function immediately after the +redirect_to+, use return. - # - # redirect_to post_url(@post) and return - # - # === Open Redirect protection - # - # By default, Rails protects against redirecting to external hosts for your app's safety, so called open redirects. - # Note: this was a new default in Rails 7.0, after upgrading opt-in by uncommenting the line with +raise_on_open_redirects+ in config/initializers/new_framework_defaults_7_0.rb - # - # Here #redirect_to automatically validates the potentially-unsafe URL: - # - # redirect_to params[:redirect_url] - # - # Raises UnsafeRedirectError in the case of an unsafe redirect. - # - # To allow any external redirects pass allow_other_host: true, though using a user-provided param in that case is unsafe. - # - # redirect_to "https://rubyonrails.org", allow_other_host: true - # - # See #url_from for more information on what an internal and safe URL is, or how to fall back to an alternate redirect URL in the unsafe case. - # - # @raise [ActionControllerError] - # - # source://actionpack//lib/action_controller/metal/redirecting.rb#82 - def redirect_to(options = T.unsafe(nil), response_options = T.unsafe(nil)); end - - # Verifies the passed +location+ is an internal URL that's safe to redirect to and returns it, or nil if not. - # Useful to wrap a params provided redirect URL and fallback to an alternate URL to redirect to: - # - # redirect_to url_from(params[:redirect_url]) || root_url - # - # The +location+ is considered internal, and safe, if it's on the same host as request.host: - # - # # If request.host is example.com: - # url_from("https://example.com/profile") # => "https://example.com/profile" - # url_from("http://example.com/profile") # => "http://example.com/profile" - # url_from("http://evil.com/profile") # => nil - # - # Subdomains are considered part of the host: - # - # # If request.host is on https://example.com or https://app.example.com, you'd get: - # url_from("https://dev.example.com/profile") # => nil - # - # NOTE: there's a similarity with {url_for}[rdoc-ref:ActionDispatch::Routing::UrlFor#url_for], which generates an internal URL from various options from within the app, e.g. url_for(@post). - # However, #url_from is meant to take an external parameter to verify as in url_from(params[:redirect_url]). - # - # source://actionpack//lib/action_controller/metal/redirecting.rb#169 - def url_from(location); end - - private - - # source://actionpack//lib/action_controller/metal/redirecting.rb#175 - def _allow_other_host; end - - # source://actionpack//lib/action_controller/metal/redirecting.rb#189 - def _enforce_open_redirect_protection(location, allow_other_host:); end - - # source://actionpack//lib/action_controller/metal/redirecting.rb#179 - def _extract_redirect_to_status(options, response_options); end - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/metal/redirecting.rb#197 - def _url_host_allowed?(url); end - - class << self - # source://actionpack//lib/action_controller/metal/redirecting.rb#130 - def _compute_redirect_to_location(request, options); end - end - - module GeneratedClassMethods - def default_url_options; end - def default_url_options=(value); end - def default_url_options?; end - end - - module GeneratedInstanceMethods - def default_url_options; end - def default_url_options=(value); end - def default_url_options?; end - end -end - -# source://actionpack//lib/action_controller/metal/redirecting.rb#10 -class ActionController::Redirecting::UnsafeRedirectError < ::StandardError; end - -# source://actionpack//lib/action_controller/metal/exceptions.rb#14 -class ActionController::RenderError < ::ActionController::ActionControllerError; end - -# ActionController::Renderer allows you to render arbitrary templates -# without requirement of being in controller actions. -# -# You get a concrete renderer class by invoking ActionController::Base#renderer. -# For example: -# -# ApplicationController.renderer -# -# It allows you to call method #render directly. -# -# ApplicationController.renderer.render template: '...' -# -# You can use this shortcut in a controller, instead of the previous example: -# -# ApplicationController.render template: '...' -# -# #render allows you to use the same options that you can use when rendering in a controller. -# For example: -# -# FooController.render :action, locals: { ... }, assigns: { ... } -# -# The template will be rendered in a Rack environment which is accessible through -# ActionController::Renderer#env. You can set it up in two ways: -# -# * by changing renderer defaults, like -# -# ApplicationController.renderer.defaults # => hash with default Rack environment -# -# * by initializing an instance of renderer by passing it a custom environment. -# -# ApplicationController.renderer.new(method: 'post', https: true) -# -# source://actionpack//lib/action_controller/renderer.rb#36 -class ActionController::Renderer - # Accepts a custom Rack environment to render templates in. - # It will be merged with the default Rack environment defined by - # +ActionController::Renderer::DEFAULTS+. - # - # @return [Renderer] a new instance of Renderer - # - # source://actionpack//lib/action_controller/renderer.rb#65 - def initialize(controller, env, defaults); end - - # Returns the value of attribute controller. - # - # source://actionpack//lib/action_controller/renderer.rb#37 - def controller; end - - # Returns the value of attribute defaults. - # - # source://actionpack//lib/action_controller/renderer.rb#37 - def defaults; end - - # Create a new renderer for the same controller but with a new env. - # - # source://actionpack//lib/action_controller/renderer.rb#53 - def new(env = T.unsafe(nil)); end - - # Render templates with any options from ActionController::Base#render_to_string. - # - # The primary options are: - # * :partial - See ActionView::PartialRenderer for details. - # * :file - Renders an explicit template file. Add :locals to pass in, if so desired. - # It shouldn’t be used directly with unsanitized user input due to lack of validation. - # * :inline - Renders an ERB template string. - # * :plain - Renders provided text and sets the content type as text/plain. - # * :html - Renders the provided HTML safe string, otherwise - # performs HTML escape on the string first. Sets the content type as text/html. - # * :json - Renders the provided hash or object in JSON. You don't - # need to call .to_json on the object you want to render. - # * :body - Renders provided text and sets content type of text/plain. - # - # If no options hash is passed or if :update is specified, then: - # - # If an object responding to +render_in+ is passed, +render_in+ is called on the object, - # passing in the current view context. - # - # Otherwise, a partial is rendered using the second parameter as the locals hash. - # - # source://actionpack//lib/action_controller/renderer.rb#91 - def render(*args); end - - # Render templates with any options from ActionController::Base#render_to_string. - # - # The primary options are: - # * :partial - See ActionView::PartialRenderer for details. - # * :file - Renders an explicit template file. Add :locals to pass in, if so desired. - # It shouldn’t be used directly with unsanitized user input due to lack of validation. - # * :inline - Renders an ERB template string. - # * :plain - Renders provided text and sets the content type as text/plain. - # * :html - Renders the provided HTML safe string, otherwise - # performs HTML escape on the string first. Sets the content type as text/html. - # * :json - Renders the provided hash or object in JSON. You don't - # need to call .to_json on the object you want to render. - # * :body - Renders provided text and sets content type of text/plain. - # - # If no options hash is passed or if :update is specified, then: - # - # If an object responding to +render_in+ is passed, +render_in+ is called on the object, - # passing in the current view context. - # - # Otherwise, a partial is rendered using the second parameter as the locals hash. - # - # source://actionpack//lib/action_controller/renderer.rb#91 - def render_to_string(*args); end - - # Create a new renderer for the same controller but with new defaults. - # - # source://actionpack//lib/action_controller/renderer.rb#58 - def with_defaults(defaults); end - - private - - # source://actionpack//lib/action_controller/renderer.rb#105 - def normalize_keys(defaults, env); end - - # source://actionpack//lib/action_controller/renderer.rb#126 - def rack_key_for(key); end - - # source://actionpack//lib/action_controller/renderer.rb#130 - def rack_value_for(key, value); end - - class << self - # Create a new renderer instance for a specific controller class. - # - # source://actionpack//lib/action_controller/renderer.rb#48 - def for(controller, env = T.unsafe(nil), defaults = T.unsafe(nil)); end - end -end - -# source://actionpack//lib/action_controller/renderer.rb#39 -ActionController::Renderer::DEFAULTS = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_controller/renderer.rb#118 -ActionController::Renderer::RACK_KEY_TRANSLATION = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_controller/metal/renderers.rb#23 -module ActionController::Renderers - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::ActionController::Renderers::ClassMethods - - # source://actionpack//lib/action_controller/metal/renderers.rb#144 - def _render_to_body_with_renderer(options); end - - # source://actionpack//lib/action_controller/metal/renderers.rb#170 - def _render_with_renderer_js(js, options); end - - # source://actionpack//lib/action_controller/metal/renderers.rb#155 - def _render_with_renderer_json(json, options); end - - # source://actionpack//lib/action_controller/metal/renderers.rb#175 - def _render_with_renderer_xml(xml, options); end - - # Called by +render+ in AbstractController::Rendering - # which sets the return value as the +response_body+. - # - # If no renderer is found, +super+ returns control to - # ActionView::Rendering.render_to_body, if present. - # - # source://actionpack//lib/action_controller/metal/renderers.rb#140 - def render_to_body(options); end - - class << self - # source://actionpack//lib/action_controller/metal/renderers.rb#90 - def _render_with_renderer_method_name(key); end - - # Adds a new renderer to call within controller actions. - # A renderer is invoked by passing its name as an option to - # AbstractController::Rendering#render. To create a renderer - # pass it a name and a block. The block takes two arguments, the first - # is the value paired with its key and the second is the remaining - # hash of options passed to +render+. - # - # Create a csv renderer: - # - # ActionController::Renderers.add :csv do |obj, options| - # filename = options[:filename] || 'data' - # str = obj.respond_to?(:to_csv) ? obj.to_csv : obj.to_s - # send_data str, type: Mime[:csv], - # disposition: "attachment; filename=#{filename}.csv" - # end - # - # Note that we used Mime[:csv] for the csv mime type as it comes with Rails. - # For a custom renderer, you'll need to register a mime type with - # Mime::Type.register. - # - # To use the csv renderer in a controller action: - # - # def show - # @csvable = Csvable.find(params[:id]) - # respond_to do |format| - # format.html - # format.csv { render csv: @csvable, filename: @csvable.name } - # end - # end - # - # source://actionpack//lib/action_controller/metal/renderers.rb#74 - def add(key, &block); end - - # This method is the opposite of add method. - # - # To remove a csv renderer: - # - # ActionController::Renderers.remove(:csv) - # - # source://actionpack//lib/action_controller/metal/renderers.rb#84 - def remove(key); end - end - - module GeneratedClassMethods - def _renderers; end - def _renderers=(value); end - def _renderers?; end - end - - module GeneratedInstanceMethods - def _renderers; end - def _renderers=(value); end - def _renderers?; end - end -end - -# Used in ActionController::Base and ActionController::API to include all -# renderers by default. -# -# source://actionpack//lib/action_controller/metal/renderers.rb#36 -module ActionController::Renderers::All - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - include ::ActionController::Renderers - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::ActionController::Renderers::ClassMethods - - module GeneratedClassMethods - def _renderers; end - def _renderers=(value); end - def _renderers?; end - end - - module GeneratedInstanceMethods - def _renderers; end - def _renderers=(value); end - def _renderers?; end - end -end - -# source://actionpack//lib/action_controller/metal/renderers.rb#94 -module ActionController::Renderers::ClassMethods - # Adds, by name, a renderer or renderers to the +_renderers+ available - # to call within controller actions. - # - # It is useful when rendering from an ActionController::Metal controller or - # otherwise to add an available renderer proc to a specific controller. - # - # Both ActionController::Base and ActionController::API - # include ActionController::Renderers::All, making all renderers - # available in the controller. See Renderers::RENDERERS and Renderers.add. - # - # Since ActionController::Metal controllers cannot render, the controller - # must include AbstractController::Rendering, ActionController::Rendering, - # and ActionController::Renderers, and have at least one renderer. - # - # Rather than including ActionController::Renderers::All and including all renderers, - # you may specify which renderers to include by passing the renderer name or names to - # +use_renderers+. For example, a controller that includes only the :json renderer - # (+_render_with_renderer_json+) might look like: - # - # class MetalRenderingController < ActionController::Metal - # include AbstractController::Rendering - # include ActionController::Rendering - # include ActionController::Renderers - # - # use_renderers :json - # - # def show - # render json: record - # end - # end - # - # You must specify a +use_renderer+, else the +controller.renderer+ and - # +controller._renderers+ will be nil, and the action will fail. - # - # source://actionpack//lib/action_controller/metal/renderers.rb#128 - def use_renderer(*args); end - - # Adds, by name, a renderer or renderers to the +_renderers+ available - # to call within controller actions. - # - # It is useful when rendering from an ActionController::Metal controller or - # otherwise to add an available renderer proc to a specific controller. - # - # Both ActionController::Base and ActionController::API - # include ActionController::Renderers::All, making all renderers - # available in the controller. See Renderers::RENDERERS and Renderers.add. - # - # Since ActionController::Metal controllers cannot render, the controller - # must include AbstractController::Rendering, ActionController::Rendering, - # and ActionController::Renderers, and have at least one renderer. - # - # Rather than including ActionController::Renderers::All and including all renderers, - # you may specify which renderers to include by passing the renderer name or names to - # +use_renderers+. For example, a controller that includes only the :json renderer - # (+_render_with_renderer_json+) might look like: - # - # class MetalRenderingController < ActionController::Metal - # include AbstractController::Rendering - # include ActionController::Rendering - # include ActionController::Renderers - # - # use_renderers :json - # - # def show - # render json: record - # end - # end - # - # You must specify a +use_renderer+, else the +controller.renderer+ and - # +controller._renderers+ will be nil, and the action will fail. - # - # source://actionpack//lib/action_controller/metal/renderers.rb#128 - def use_renderers(*args); end -end - -# A Set containing renderer names that correspond to available renderer procs. -# Default values are :json, :js, :xml. -# -# source://actionpack//lib/action_controller/metal/renderers.rb#28 -ActionController::Renderers::RENDERERS = T.let(T.unsafe(nil), Set) - -# source://actionpack//lib/action_controller/metal/rendering.rb#4 -module ActionController::Rendering - extend ::ActiveSupport::Concern - - mixes_in_class_methods ::ActionController::Rendering::ClassMethods - - # Check for double render errors and set the content_type after rendering. - # - # @raise [::AbstractController::DoubleRenderError] - # - # source://actionpack//lib/action_controller/metal/rendering.rb#28 - def render(*args); end - - # source://actionpack//lib/action_controller/metal/rendering.rb#45 - def render_to_body(options = T.unsafe(nil)); end - - # Override render_to_string because body can now be set to a Rack body. - # - # source://actionpack//lib/action_controller/metal/rendering.rb#34 - def render_to_string(*_arg0); end - - private - - # Normalize arguments by catching blocks and setting them on :update. - # - # source://actionpack//lib/action_controller/metal/rendering.rb#87 - def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil), &blk); end - - # Normalize both text and status options. - # - # source://actionpack//lib/action_controller/metal/rendering.rb#94 - def _normalize_options(options); end - - # source://actionpack//lib/action_controller/metal/rendering.rb#108 - def _normalize_text(options); end - - # Process controller specific options, as status, content-type and location. - # - # source://actionpack//lib/action_controller/metal/rendering.rb#117 - def _process_options(options); end - - # source://actionpack//lib/action_controller/metal/rendering.rb#56 - def _process_variant(options); end - - # source://actionpack//lib/action_controller/metal/rendering.rb#62 - def _render_in_priorities(options); end - - # source://actionpack//lib/action_controller/metal/rendering.rb#70 - def _set_html_content_type; end - - # source://actionpack//lib/action_controller/metal/rendering.rb#74 - def _set_rendered_content_type(format); end - - # source://actionpack//lib/action_controller/metal/rendering.rb#80 - def _set_vary_header; end - - # Before processing, set the request formats in current controller formats. - # - # source://actionpack//lib/action_controller/metal/rendering.rb#51 - def process_action(*_arg0); end -end - -# source://actionpack//lib/action_controller/metal/rendering.rb#9 -module ActionController::Rendering::ClassMethods - # source://actionpack//lib/action_controller/metal/rendering.rb#21 - def inherited(klass); end - - # source://actionpack//lib/action_controller/metal/rendering.rb#11 - def render(*_arg0, &_arg1); end - - # Returns a renderer instance (inherited from ActionController::Renderer) - # for the controller. - # - # source://actionpack//lib/action_controller/metal/rendering.rb#15 - def renderer; end - - # source://actionpack//lib/action_controller/metal/rendering.rb#17 - def setup_renderer!; end -end - -# source://actionpack//lib/action_controller/metal/rendering.rb#7 -ActionController::Rendering::RENDER_FORMATS_IN_PRIORITY = T.let(T.unsafe(nil), Array) - -# Controller actions are protected from Cross-Site Request Forgery (CSRF) attacks -# by including a token in the rendered HTML for your application. This token is -# stored as a random string in the session, to which an attacker does not have -# access. When a request reaches your application, \Rails verifies the received -# token with the token in the session. All requests are checked except GET requests -# as these should be idempotent. Keep in mind that all session-oriented requests -# are CSRF protected by default, including JavaScript and HTML requests. -# -# Since HTML and JavaScript requests are typically made from the browser, we -# need to ensure to verify request authenticity for the web browser. We can -# use session-oriented authentication for these types of requests, by using -# the protect_from_forgery method in our controllers. -# -# GET requests are not protected since they don't have side effects like writing -# to the database and don't leak sensitive information. JavaScript requests are -# an exception: a third-party site can use a -# -# The first two characters (">) are required in case the exception happens -# while rendering attributes for a given tag. You can check the real cause -# for the exception in your logger. -# -# == Web server support -# -# Not all web servers support streaming out-of-the-box. You need to check -# the instructions for each of them. -# -# ==== Unicorn -# -# Unicorn supports streaming but it needs to be configured. For this, you -# need to create a config file as follow: -# -# # unicorn.config.rb -# listen 3000, tcp_nopush: false -# -# And use it on initialization: -# -# unicorn_rails --config-file unicorn.config.rb -# -# You may also want to configure other parameters like :tcp_nodelay. -# Please check its documentation for more information: https://bogomips.org/unicorn/Unicorn/Configurator.html#method-i-listen -# -# If you are using Unicorn with NGINX, you may need to tweak NGINX. -# Streaming should work out of the box on Rainbows. -# -# ==== Passenger -# -# To be described. -# -# source://actionpack//lib/action_controller/metal/streaming.rb#195 -module ActionController::Streaming - private - - # Set proper cache control and transfer encoding when streaming - # - # source://actionpack//lib/action_controller/metal/streaming.rb#198 - def _process_options(options); end - - # Call render_body if we are streaming instead of usual +render+. - # - # source://actionpack//lib/action_controller/metal/streaming.rb#212 - def _render_template(options); end -end - -# == Strong \Parameters -# -# It provides an interface for protecting attributes from end-user -# assignment. This makes Action Controller parameters forbidden -# to be used in Active Model mass assignment until they have been explicitly -# enumerated. -# -# In addition, parameters can be marked as required and flow through a -# predefined raise/rescue flow to end up as a 400 Bad Request with no -# effort. -# -# class PeopleController < ActionController::Base -# # Using "Person.create(params[:person])" would raise an -# # ActiveModel::ForbiddenAttributesError exception because it'd -# # be using mass assignment without an explicit permit step. -# # This is the recommended form: -# def create -# Person.create(person_params) -# end -# -# # This will pass with flying colors as long as there's a person key in the -# # parameters, otherwise it'll raise an ActionController::ParameterMissing -# # exception, which will get caught by ActionController::Base and turned -# # into a 400 Bad Request reply. -# def update -# redirect_to current_account.people.find(params[:id]).tap { |person| -# person.update!(person_params) -# } -# end -# -# private -# # Using a private method to encapsulate the permissible parameters is -# # a good pattern since you'll be able to reuse the same permit -# # list between create and update. Also, you can specialize this method -# # with per-user checking of permissible attributes. -# def person_params -# params.require(:person).permit(:name, :age) -# end -# end -# -# In order to use accepts_nested_attributes_for with Strong \Parameters, you -# will need to specify which nested attributes should be permitted. You might want -# to allow +:id+ and +:_destroy+, see ActiveRecord::NestedAttributes for more information. -# -# class Person -# has_many :pets -# accepts_nested_attributes_for :pets -# end -# -# class PeopleController < ActionController::Base -# def create -# Person.create(person_params) -# end -# -# ... -# -# private -# -# def person_params -# # It's mandatory to specify the nested attributes that should be permitted. -# # If you use `permit` with just the key that points to the nested attributes hash, -# # it will return an empty hash. -# params.require(:person).permit(:name, :age, pets_attributes: [ :id, :name, :category ]) -# end -# end -# -# See ActionController::Parameters.require and ActionController::Parameters.permit -# for more information. -# -# source://actionpack//lib/action_controller/metal/strong_parameters.rb#1221 -module ActionController::StrongParameters - # Returns a new ActionController::Parameters object that - # has been instantiated with the request.parameters. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1224 - def params; end - - # Assigns the given +value+ to the +params+ hash. If +value+ - # is a Hash, this will create an ActionController::Parameters - # object that has been instantiated with the given +value+ hash. - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1239 - def params=(value); end -end - -# source://actionpack//lib/action_controller/template_assertions.rb#4 -module ActionController::TemplateAssertions - # @raise [NoMethodError] - # - # source://actionpack//lib/action_controller/template_assertions.rb#5 - def assert_template(options = T.unsafe(nil), message = T.unsafe(nil)); end -end - -# Superclass for ActionController functional tests. Functional tests allow you to -# test a single controller action per test method. -# -# == Use integration style controller tests over functional style controller tests. -# -# Rails discourages the use of functional tests in favor of integration tests -# (use ActionDispatch::IntegrationTest). -# -# New Rails applications no longer generate functional style controller tests and they should -# only be used for backward compatibility. Integration style controller tests perform actual -# requests, whereas functional style controller tests merely simulate a request. Besides, -# integration tests are as fast as functional tests and provide lot of helpers such as +as+, -# +parsed_body+ for effective testing of controller actions including even API endpoints. -# -# == Basic example -# -# Functional tests are written as follows: -# 1. First, one uses the +get+, +post+, +patch+, +put+, +delete+, or +head+ method to simulate -# an HTTP request. -# 2. Then, one asserts whether the current state is as expected. "State" can be anything: -# the controller's HTTP response, the database contents, etc. -# -# For example: -# -# class BooksControllerTest < ActionController::TestCase -# def test_create -# # Simulate a POST response with the given HTTP parameters. -# post(:create, params: { book: { title: "Love Hina" }}) -# -# # Asserts that the controller tried to redirect us to -# # the created book's URI. -# assert_response :found -# -# # Asserts that the controller really put the book in the database. -# assert_not_nil Book.find_by(title: "Love Hina") -# end -# end -# -# You can also send a real document in the simulated HTTP request. -# -# def test_create -# json = {book: { title: "Love Hina" }}.to_json -# post :create, body: json -# end -# -# == Special instance variables -# -# ActionController::TestCase will also automatically provide the following instance -# variables for use in the tests: -# -# @controller:: -# The controller instance that will be tested. -# @request:: -# An ActionController::TestRequest, representing the current HTTP -# request. You can modify this object before sending the HTTP request. For example, -# you might want to set some session properties before sending a GET request. -# @response:: -# An ActionDispatch::TestResponse object, representing the response -# of the last HTTP response. In the above example, @response becomes valid -# after calling +post+. If the various assert methods are not sufficient, then you -# may use this object to inspect the HTTP response in detail. -# -# == Controller is automatically inferred -# -# ActionController::TestCase will automatically infer the controller under test -# from the test class name. If the controller cannot be inferred from the test -# class name, you can explicitly set it with +tests+. -# -# class SpecialEdgeCaseWidgetsControllerTest < ActionController::TestCase -# tests WidgetController -# end -# -# == \Testing controller internals -# -# In addition to these specific assertions, you also have easy access to various collections that the regular test/unit assertions -# can be used against. These collections are: -# -# * session: Objects being saved in the session. -# * flash: The flash objects currently in the session. -# * cookies: \Cookies being sent to the user on this request. -# -# These collections can be used just like any other hash: -# -# assert_equal "Dave", cookies[:name] # makes sure that a cookie called :name was set as "Dave" -# assert flash.empty? # makes sure that there's nothing in the flash -# -# On top of the collections, you have the complete URL that a given action redirected to available in redirect_to_url. -# -# For redirects within the same controller, you can even call follow_redirect and the redirect will be followed, triggering another -# action call which can then be asserted against. -# -# == Manipulating session and cookie variables -# -# Sometimes you need to set up the session and cookie variables for a test. -# To do this just assign a value to the session or cookie collection: -# -# session[:key] = "value" -# cookies[:key] = "value" -# -# To clear the cookies for a test just clear the cookie collection: -# -# cookies.clear -# -# == \Testing named routes -# -# If you're using named routes, they can be easily tested using the original named routes' methods straight in the test case. -# -# assert_redirected_to page_url(title: 'foo') -# -# source://actionpack//lib/action_controller/test_case.rb#335 -class ActionController::TestCase < ::ActiveSupport::TestCase - include ::ActiveSupport::Testing::ConstantLookup - include ::ActionDispatch::Assertions::ResponseAssertions - include ::ActionDispatch::Assertions::RoutingAssertions - include ::Rails::Dom::Testing::Assertions::DomAssertions - include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable - include ::Rails::Dom::Testing::Assertions::SelectorAssertions - include ::Rails::Dom::Testing::Assertions - include ::ActionDispatch::TestProcess::FixtureFile - include ::ActionDispatch::TestProcess - include ::ActionController::TestCase::Behavior - include ::ActionController::TemplateAssertions - include ::ActionDispatch::Assertions - extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods - extend ::ActionController::TestCase::Behavior::ClassMethods - - # source://actionpack//lib/action_controller/test_case.rb#561 - def _controller_class; end - - # source://actionpack//lib/action_controller/test_case.rb#561 - def _controller_class=(_arg0); end - - # source://actionpack//lib/action_controller/test_case.rb#561 - def _controller_class?; end - - class << self - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks; end - - # source://actionpack//lib/action_controller/test_case.rb#561 - def _controller_class; end - - # source://actionpack//lib/action_controller/test_case.rb#561 - def _controller_class=(value); end - - # source://actionpack//lib/action_controller/test_case.rb#561 - def _controller_class?; end - - # source://actionpack//lib/action_controller/test_case.rb#336 - def executor_around_each_request; end - - # source://actionpack//lib/action_controller/test_case.rb#336 - def executor_around_each_request=(_arg0); end - end -end - -# source://actionpack//lib/action_controller/test_case.rb#338 -module ActionController::TestCase::Behavior - include ::ActionDispatch::TestProcess::FixtureFile - include ::ActionDispatch::TestProcess - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - include ::ActiveSupport::Testing::ConstantLookup - include ::Rails::Dom::Testing::Assertions - include ::ActionController::TemplateAssertions - include ::ActionDispatch::Assertions - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods - mixes_in_class_methods ::ActionController::TestCase::Behavior::ClassMethods - - # source://actionpack//lib/action_controller/test_case.rb#554 - def build_response(klass); end - - # source://actionpack//lib/action_controller/test_case.rb#514 - def controller_class_name; end - - # Simulate a DELETE request with the given parameters and set/volley the response. - # See +get+ for more details. - # - # source://actionpack//lib/action_controller/test_case.rb#429 - def delete(action, **args); end - - # source://actionpack//lib/action_controller/test_case.rb#518 - def generated_path(generated_extras); end - - # Simulate a GET request with the given parameters. - # - # - +action+: The controller action to call. - # - +params+: The hash with HTTP parameters that you want to pass. This may be +nil+. - # - +body+: The request body with a string that is appropriately encoded - # (application/x-www-form-urlencoded or multipart/form-data). - # - +session+: A hash of parameters to store in the session. This may be +nil+. - # - +flash+: A hash of parameters to store in the flash. This may be +nil+. - # - # You can also simulate POST, PATCH, PUT, DELETE, and HEAD requests with - # +post+, +patch+, +put+, +delete+, and +head+. - # Example sending parameters, session, and setting a flash message: - # - # get :show, - # params: { id: 7 }, - # session: { user_id: 1 }, - # flash: { notice: 'This is flash message' } - # - # Note that the request method is not verified. The different methods are - # available to make the tests more expressive. - # - # source://actionpack//lib/action_controller/test_case.rb#403 - def get(action, **args); end - - # Simulate a HEAD request with the given parameters and set/volley the response. - # See +get+ for more details. - # - # source://actionpack//lib/action_controller/test_case.rb#435 - def head(action, **args); end - - # Simulate a PATCH request with the given parameters and set/volley the response. - # See +get+ for more details. - # - # source://actionpack//lib/action_controller/test_case.rb#417 - def patch(action, **args); end - - # Simulate a POST request with the given parameters and set/volley the response. - # See +get+ for more details. - # - # source://actionpack//lib/action_controller/test_case.rb#411 - def post(action, **args); end - - # Simulate an HTTP request to +action+ by specifying request method, - # parameters and set/volley the response. - # - # - +action+: The controller action to call. - # - +method+: Request method used to send the HTTP request. Possible values - # are +GET+, +POST+, +PATCH+, +PUT+, +DELETE+, +HEAD+. Defaults to +GET+. Can be a symbol. - # - +params+: The hash with HTTP parameters that you want to pass. This may be +nil+. - # - +body+: The request body with a string that is appropriately encoded - # (application/x-www-form-urlencoded or multipart/form-data). - # - +session+: A hash of parameters to store in the session. This may be +nil+. - # - +flash+: A hash of parameters to store in the flash. This may be +nil+. - # - +format+: Request format. Defaults to +nil+. Can be string or symbol. - # - +as+: Content type. Defaults to +nil+. Must be a symbol that corresponds - # to a mime type. - # - # Example calling +create+ action and sending two params: - # - # process :create, - # method: 'POST', - # params: { - # user: { name: 'Gaurish Sharma', email: 'user@example.com' } - # }, - # session: { user_id: 1 }, - # flash: { notice: 'This is flash message' } - # - # To simulate +GET+, +POST+, +PATCH+, +PUT+, +DELETE+, and +HEAD+ requests - # prefer using #get, #post, #patch, #put, #delete and #head methods - # respectively which will make tests more expressive. - # - # It's not recommended to make more than one request in the same test. Instance - # variables that are set in one request will not persist to the next request, - # but it's not guaranteed that all Rails internal state will be reset. Prefer - # ActionDispatch::IntegrationTest for making multiple requests in the same test. - # - # Note that the request method is not verified. - # - # source://actionpack//lib/action_controller/test_case.rb#474 - def process(action, method: T.unsafe(nil), params: T.unsafe(nil), session: T.unsafe(nil), body: T.unsafe(nil), flash: T.unsafe(nil), format: T.unsafe(nil), xhr: T.unsafe(nil), as: T.unsafe(nil)); end - - # Simulate a PUT request with the given parameters and set/volley the response. - # See +get+ for more details. - # - # source://actionpack//lib/action_controller/test_case.rb#423 - def put(action, **args); end - - # source://actionpack//lib/action_controller/test_case.rb#522 - def query_parameter_names(generated_extras); end - - # Returns the value of attribute request. - # - # source://actionpack//lib/action_controller/test_case.rb#344 - def request; end - - # Returns the value of attribute response. - # - # source://actionpack//lib/action_controller/test_case.rb#344 - def response; end - - # source://actionpack//lib/action_controller/test_case.rb#526 - def setup_controller_request_and_response; end - - private - - # source://actionpack//lib/action_controller/test_case.rb#646 - def check_required_ivars; end - - # source://actionpack//lib/action_controller/test_case.rb#642 - def document_root_element; end - - # source://actionpack//lib/action_controller/test_case.rb#597 - def process_controller_response(action, cookies, xhr); end - - # source://actionpack//lib/action_controller/test_case.rb#632 - def scrub_env!(env); end - - # source://actionpack//lib/action_controller/test_case.rb#567 - def setup_request(controller_class_name, action, parameters, session, flash, xhr); end - - # source://actionpack//lib/action_controller/test_case.rb#589 - def wrap_execution(&block); end - - module GeneratedClassMethods - def _controller_class; end - def _controller_class=(value); end - def _controller_class?; end - end - - module GeneratedInstanceMethods - def _controller_class; end - def _controller_class=(value); end - def _controller_class?; end - end -end - -# source://actionpack//lib/action_controller/test_case.rb#346 -module ActionController::TestCase::Behavior::ClassMethods - # source://actionpack//lib/action_controller/test_case.rb#368 - def controller_class; end - - # source://actionpack//lib/action_controller/test_case.rb#364 - def controller_class=(new_class); end - - # source://actionpack//lib/action_controller/test_case.rb#376 - def determine_default_controller_class(name); end - - # Sets the controller class name. Useful if the name can't be inferred from test class. - # Normalizes +controller_class+ before using. - # - # tests WidgetController - # tests :widget - # tests 'widget' - # - # source://actionpack//lib/action_controller/test_case.rb#353 - def tests(controller_class); end -end - -# ActionController::TestCase will be deprecated and moved to a gem in the future. -# Please use ActionDispatch::IntegrationTest going forward. -# -# source://actionpack//lib/action_controller/test_case.rb#34 -class ActionController::TestRequest < ::ActionDispatch::TestRequest - # @return [TestRequest] a new instance of TestRequest - # - # source://actionpack//lib/action_controller/test_case.rb#57 - def initialize(env, session, controller_class); end - - # source://actionpack//lib/action_controller/test_case.rb#76 - def assign_parameters(routes, controller_path, action, parameters, generated_path, query_string_keys); end - - # source://actionpack//lib/action_controller/test_case.rb#72 - def content_type=(type); end - - # Returns the value of attribute controller_class. - # - # source://actionpack//lib/action_controller/test_case.rb#42 - def controller_class; end - - # source://actionpack//lib/action_controller/test_case.rb#68 - def query_string=(string); end - - private - - # source://actionpack//lib/action_controller/test_case.rb#164 - def params_parsers; end - - class << self - # Create a new test request with default `env` values. - # - # source://actionpack//lib/action_controller/test_case.rb#45 - def create(controller_class); end - - # source://actionpack//lib/action_controller/test_case.rb#38 - def new_session; end - - private - - # source://actionpack//lib/action_controller/test_case.rb#52 - def default_env; end - end -end - -# source://actionpack//lib/action_controller/test_case.rb#35 -ActionController::TestRequest::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_controller/test_case.rb#136 -ActionController::TestRequest::ENCODER = T.let(T.unsafe(nil), T.untyped) - -# Methods #destroy and #load! are overridden to avoid calling methods on the -# -# source://actionpack//lib/action_controller/test_case.rb#182 -class ActionController::TestSession < ::Rack::Session::Abstract::PersistedSecure::SecureSessionHash - # @return [TestSession] a new instance of TestSession - # - # source://actionpack//lib/action_controller/test_case.rb#185 - def initialize(session = T.unsafe(nil)); end - - # source://actionpack//lib/action_controller/test_case.rb#204 - def destroy; end - - # source://actionpack//lib/action_controller/test_case.rb#208 - def dig(*keys); end - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/test_case.rb#217 - def enabled?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_controller/test_case.rb#192 - def exists?; end - - # source://actionpack//lib/action_controller/test_case.rb#213 - def fetch(key, *args, &block); end - - # source://actionpack//lib/action_controller/test_case.rb#196 - def keys; end - - # source://actionpack//lib/action_controller/test_case.rb#200 - def values; end - - private - - # source://actionpack//lib/action_controller/test_case.rb#222 - def load!; end -end - -# source://actionpack//lib/action_controller/test_case.rb#183 -ActionController::TestSession::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_controller/metal/testing.rb#4 -module ActionController::Testing; end - -# Behavior specific to functional tests -# -# source://actionpack//lib/action_controller/metal/testing.rb#6 -module ActionController::Testing::Functional - # source://actionpack//lib/action_controller/metal/testing.rb#7 - def clear_instance_variables_between_requests; end - - # source://actionpack//lib/action_controller/metal/testing.rb#16 - def recycle!; end -end - -# Raised when a Parameters instance is not marked as permitted and -# an operation to transform it to hash is called. -# -# params = ActionController::Parameters.new(a: "123", b: "456") -# params.to_h -# # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash -# -# source://actionpack//lib/action_controller/metal/strong_parameters.rb#61 -class ActionController::UnfilteredParameters < ::ArgumentError - # @return [UnfilteredParameters] a new instance of UnfilteredParameters - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#62 - def initialize; end -end - -# source://actionpack//lib/action_controller/metal/exceptions.rb#73 -class ActionController::UnknownFormat < ::ActionController::ActionControllerError; end - -# source://actionpack//lib/action_controller/metal/exceptions.rb#70 -class ActionController::UnknownHttpMethod < ::ActionController::ActionControllerError; end - -# Raised when a supplied parameter is not expected and -# ActionController::Parameters.action_on_unpermitted_parameters -# is set to :raise. -# -# params = ActionController::Parameters.new(a: "123", b: "456") -# params.permit(:c) -# # => ActionController::UnpermittedParameters: found unpermitted parameters: :a, :b -# -# source://actionpack//lib/action_controller/metal/strong_parameters.rb#46 -class ActionController::UnpermittedParameters < ::IndexError - # @return [UnpermittedParameters] a new instance of UnpermittedParameters - # - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#49 - def initialize(params); end - - # source://actionpack//lib/action_controller/metal/strong_parameters.rb#47 - def params; end -end - -# Includes +url_for+ into the host class. The class has to provide a +RouteSet+ by implementing -# the _routes method. Otherwise, an exception will be raised. -# -# In addition to AbstractController::UrlFor, this module accesses the HTTP layer to define -# URL options like the +host+. In order to do so, this module requires the host class -# to implement +env+ which needs to be Rack-compatible and +request+ -# which is either an instance of ActionDispatch::Request or an object -# that responds to the +host+, +optional_port+, +protocol+, and -# +symbolized_path_parameter+ methods. -# -# class RootUrl -# include ActionController::UrlFor -# include Rails.application.routes.url_helpers -# -# delegate :env, :request, to: :controller -# -# def initialize(controller) -# @controller = controller -# @url = root_path # named route from the application. -# end -# end -# -# source://actionpack//lib/action_controller/metal/url_for.rb#25 -module ActionController::UrlFor - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - include ::ActionDispatch::Routing::UrlFor - include ::AbstractController::UrlFor - - mixes_in_class_methods GeneratedClassMethods - mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods - - # source://actionpack//lib/action_controller/metal/url_for.rb#30 - def url_options; end - - module GeneratedClassMethods - def default_url_options; end - def default_url_options=(value); end - def default_url_options?; end - end - - module GeneratedInstanceMethods - def default_url_options; end - def default_url_options=(value); end - def default_url_options?; end - end -end - -# source://actionpack//lib/action_controller/metal/exceptions.rb#25 -class ActionController::UrlGenerationError < ::ActionController::ActionControllerError - include ::DidYouMean::Correctable - - # @return [UrlGenerationError] a new instance of UrlGenerationError - # - # source://actionpack//lib/action_controller/metal/exceptions.rb#28 - def initialize(message, routes = T.unsafe(nil), route_name = T.unsafe(nil), method_name = T.unsafe(nil)); end - - # source://actionpack//lib/action_controller/metal/exceptions.rb#39 - def corrections; end - - # Returns the value of attribute method_name. - # - # source://actionpack//lib/action_controller/metal/exceptions.rb#26 - def method_name; end - - # Returns the value of attribute route_name. - # - # source://actionpack//lib/action_controller/metal/exceptions.rb#26 - def route_name; end - - # Returns the value of attribute routes. - # - # source://actionpack//lib/action_controller/metal/exceptions.rb#26 - def routes; end -end - -# source://actionpack//lib/action_dispatch.rb#37 -module ActionDispatch - extend ::ActiveSupport::Autoload - - # source://actionpack//lib/action_dispatch.rb#99 - def test_app; end - - # source://actionpack//lib/action_dispatch.rb#99 - def test_app=(val); end - - class << self - # source://actionpack//lib/action_dispatch.rb#99 - def test_app; end - - # source://actionpack//lib/action_dispatch.rb#99 - def test_app=(val); end - end -end - -# source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#8 -class ActionDispatch::ActionableExceptions - # @return [ActionableExceptions] a new instance of ActionableExceptions - # - # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#11 - def initialize(app); end - - # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#15 - def call(env); end - - # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#9 - def endpoint; end - - # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#9 - def endpoint=(val); end - - private - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#25 - def actionable_request?(request); end - - # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#29 - def redirect_to(location); end - - class << self - # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#9 - def endpoint; end - - # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#9 - def endpoint=(val); end - end -end - -# This is a class that abstracts away an asserted response. It purposely -# does not inherit from Response because it doesn't need it. That means it -# does not have headers or a body. -# -# source://actionpack//lib/action_dispatch/testing/assertion_response.rb#7 -class ActionDispatch::AssertionResponse - # Accepts a specific response status code as an Integer (404) or String - # ('404') or a response status range as a Symbol pseudo-code (:success, - # indicating any 200-299 status code). - # - # @raise [ArgumentError] - # @return [AssertionResponse] a new instance of AssertionResponse - # - # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#20 - def initialize(code_or_name); end - - # Returns the value of attribute code. - # - # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#8 - def code; end - - # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#33 - def code_and_name; end - - # Returns the value of attribute name. - # - # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#8 - def name; end - - private - - # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#38 - def code_from_name(name); end - - # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#42 - def name_from_code(code); end -end - -# source://actionpack//lib/action_dispatch/testing/assertion_response.rb#10 -ActionDispatch::AssertionResponse::GENERIC_RESPONSE_CODES = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_dispatch/testing/assertions/response.rb#4 -module ActionDispatch::Assertions - include ::ActionDispatch::Assertions::ResponseAssertions - include ::ActionDispatch::Assertions::RoutingAssertions - include ::Rails::Dom::Testing::Assertions::DomAssertions - include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable - include ::Rails::Dom::Testing::Assertions::SelectorAssertions - include ::Rails::Dom::Testing::Assertions - - # source://actionpack//lib/action_dispatch/testing/assertions.rb#13 - def html_document; end -end - -# A small suite of assertions that test responses from \Rails applications. -# -# source://actionpack//lib/action_dispatch/testing/assertions/response.rb#6 -module ActionDispatch::Assertions::ResponseAssertions - # Asserts that the response is a redirect to a URL matching the given options. - # - # # Asserts that the redirection was to the "index" action on the WeblogController - # assert_redirected_to controller: "weblog", action: "index" - # - # # Asserts that the redirection was to the named route login_url - # assert_redirected_to login_url - # - # # Asserts that the redirection was to the URL for @customer - # assert_redirected_to @customer - # - # # Asserts that the redirection matches the regular expression - # assert_redirected_to %r(\Ahttp://example.org) - # - # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#53 - def assert_redirected_to(options = T.unsafe(nil), message = T.unsafe(nil)); end - - # Asserts that the response is one of the following types: - # - # * :success - Status code was in the 200-299 range - # * :redirect - Status code was in the 300-399 range - # * :missing - Status code was 404 - # * :error - Status code was in the 500-599 range - # - # You can also pass an explicit status number like assert_response(501) - # or its symbolic equivalent assert_response(:not_implemented). - # See Rack::Utils::SYMBOL_TO_STATUS_CODE for a full list. - # - # # Asserts that the response was a redirection - # assert_response :redirect - # - # # Asserts that the response code was status code 401 (unauthorized) - # assert_response 401 - # - # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#30 - def assert_response(type, message = T.unsafe(nil)); end - - private - - # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#95 - def code_with_name(code_or_name); end - - # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#79 - def generate_response_message(expected, actual = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#89 - def location_if_redirected; end - - # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#70 - def normalize_argument_to_redirection(fragment); end - - # Proxy to to_param if the object will respond to it. - # - # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#66 - def parameterize(value); end - - # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#84 - def response_body_if_short; end -end - -# source://actionpack//lib/action_dispatch/testing/assertions/response.rb#7 -ActionDispatch::Assertions::ResponseAssertions::RESPONSE_PREDICATES = T.let(T.unsafe(nil), Hash) - -# Suite of assertions to test routes generated by \Rails and the handling of requests made to them. -# -# source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#11 -module ActionDispatch::Assertions::RoutingAssertions - # Asserts that the provided options can be used to generate the provided path. This is the inverse of +assert_recognizes+. - # The +extras+ parameter is used to tell the request the names and values of additional request parameters that would be in - # a query string. The +message+ parameter allows you to specify a custom error message for assertion failures. - # - # The +defaults+ parameter is unused. - # - # # Asserts that the default action is generated for a route with no action - # assert_generates "/items", controller: "items", action: "index" - # - # # Tests that the list action is properly routed - # assert_generates "/items/list", controller: "items", action: "list" - # - # # Tests the generation of a route with a parameter - # assert_generates "/items/list/1", { controller: "items", action: "list", id: "1" } - # - # # Asserts that the generated route gives us our custom route - # assert_generates "changesets/12", { controller: 'scm', action: 'show_diff', revision: "12" } - # - # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#85 - def assert_generates(expected_path, options, defaults = T.unsafe(nil), extras = T.unsafe(nil), message = T.unsafe(nil)); end - - # Asserts that the routing of the given +path+ was handled correctly and that the parsed options (given in the +expected_options+ hash) - # match +path+. Basically, it asserts that \Rails recognizes the route given by +expected_options+. - # - # Pass a hash in the second argument (+path+) to specify the request method. This is useful for routes - # requiring a specific HTTP method. The hash should contain a +:path+ with the incoming request path - # and a +:method+ containing the required HTTP verb. - # - # # Asserts that POSTing to /items will call the create action on ItemsController - # assert_recognizes({controller: 'items', action: 'create'}, {path: 'items', method: :post}) - # - # You can also pass in +extras+ with a hash containing URL parameters that would normally be in the query string. This can be used - # to assert that values in the query string will end up in the params hash correctly. To test query strings you must use the extras - # argument because appending the query string on the path directly will not work. For example: - # - # # Asserts that a path of '/items/list/1?view=print' returns the correct options - # assert_recognizes({controller: 'items', action: 'list', id: '1', view: 'print'}, 'items/list/1', { view: "print" }) - # - # The +message+ parameter allows you to pass in an error message that is displayed upon failure. - # - # # Check the default route (i.e., the index action) - # assert_recognizes({controller: 'items', action: 'index'}, 'items') - # - # # Test a specific action - # assert_recognizes({controller: 'items', action: 'list'}, 'items/list') - # - # # Test an action with a parameter - # assert_recognizes({controller: 'items', action: 'destroy', id: '1'}, 'items/destroy/1') - # - # # Test a custom route - # assert_recognizes({controller: 'items', action: 'show', id: '1'}, 'view/item1') - # - # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#47 - def assert_recognizes(expected_options, path, extras = T.unsafe(nil), msg = T.unsafe(nil)); end - - # Asserts that path and options match both ways; in other words, it verifies that path generates - # options and then that options generates path. This essentially combines +assert_recognizes+ - # and +assert_generates+ into one step. - # - # The +extras+ hash allows you to specify options that would normally be provided as a query string to the action. The - # +message+ parameter allows you to specify a custom error message to display upon failure. - # - # # Asserts a basic route: a controller with the default action (index) - # assert_routing '/home', controller: 'home', action: 'index' - # - # # Test a route generated with a specific controller, action, and parameter (id) - # assert_routing '/entries/show/23', controller: 'entries', action: 'show', id: 23 - # - # # Asserts a basic route (controller + default action), with an error message if it fails - # assert_routing '/store', { controller: 'store', action: 'index' }, {}, {}, 'Route for store index not generated properly' - # - # # Tests a route, providing a defaults hash - # assert_routing 'controller/action/9', {id: "9", item: "square"}, {controller: "controller", action: "action"}, {}, {item: "square"} - # - # # Tests a route with an HTTP method - # assert_routing({ method: 'put', path: '/product/321' }, { controller: "product", action: "update", id: "321" }) - # - # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#128 - def assert_routing(path, options, defaults = T.unsafe(nil), extras = T.unsafe(nil), message = T.unsafe(nil)); end - - # ROUTES TODO: These assertions should really work in an integration context - # - # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#183 - def method_missing(selector, *args, &block); end - - # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#12 - def setup; end - - # A helper to make it easier to test different route configurations. - # This method temporarily replaces @routes with a new RouteSet instance. - # - # The new instance is yielded to the passed block. Typically the block - # will create some routes using set.draw { match ... }: - # - # with_routing do |set| - # set.draw do - # resources :users - # end - # assert_equal "/users", users_path - # end - # - # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#153 - def with_routing; end - - private - - # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#228 - def fail_on(exception_class, message); end - - # Recognizes the route for a given path. - # - # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#194 - def recognized_request_for(path, extras = T.unsafe(nil), msg); end -end - -# Provides callbacks to be executed before and after dispatching the request. -# -# source://actionpack//lib/action_dispatch/middleware/callbacks.rb#5 -class ActionDispatch::Callbacks - include ::ActiveSupport::Callbacks - extend ::ActiveSupport::Callbacks::ClassMethods - extend ::ActiveSupport::DescendantsTracker - - # @return [Callbacks] a new instance of Callbacks - # - # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#20 - def initialize(app); end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks?; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#940 - def _call_callbacks; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#928 - def _run_call_callbacks(&block); end - - # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#24 - def call(env); end - - class << self - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks=(value); end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#68 - def __callbacks?; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#932 - def _call_callbacks; end - - # source://activesupport/7.0.4/lib/active_support/callbacks.rb#936 - def _call_callbacks=(value); end - - # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#15 - def after(*args, &block); end - - # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#11 - def before(*args, &block); end - end -end - -# Configures the HTTP -# {Content-Security-Policy}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy] -# response header to help protect against XSS and injection attacks. -# -# Example global policy: -# -# Rails.application.config.content_security_policy do |policy| -# policy.default_src :self, :https -# policy.font_src :self, :https, :data -# policy.img_src :self, :https, :data -# policy.object_src :none -# policy.script_src :self, :https -# policy.style_src :self, :https -# -# # Specify URI for violation reports -# policy.report_uri "/csp-violation-report-endpoint" -# end -# -# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#24 -class ActionDispatch::ContentSecurityPolicy - # @return [ContentSecurityPolicy] a new instance of ContentSecurityPolicy - # @yield [_self] - # @yieldparam _self [ActionDispatch::ContentSecurityPolicy] the object that the method was called on - # - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#169 - def initialize; end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def base_uri(*sources); end - - # Specify whether to prevent the user agent from loading any assets over - # HTTP when the page uses HTTPS: - # - # policy.block_all_mixed_content - # - # Pass +false+ to allow it again: - # - # policy.block_all_mixed_content false - # - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#197 - def block_all_mixed_content(enabled = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#286 - def build(context = T.unsafe(nil), nonce = T.unsafe(nil), nonce_directives = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def child_src(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def connect_src(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def default_src(*sources); end - - # Returns the value of attribute directives. - # - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#167 - def directives; end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def font_src(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def form_action(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def frame_ancestors(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def frame_src(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def img_src(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def manifest_src(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def media_src(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def object_src(*sources); end - - # Restricts the set of plugins that can be embedded: - # - # policy.plugin_types "application/x-shockwave-flash" - # - # Leave empty to allow all plugins: - # - # policy.plugin_types - # - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#213 - def plugin_types(*types); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def prefetch_src(*sources); end - - # Enable the {report-uri}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-uri] - # directive. Violation reports will be sent to the specified URI: - # - # policy.report_uri "/csp-violation-report-endpoint" - # - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#226 - def report_uri(uri); end - - # Specify asset types for which {Subresource Integrity}[https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity] - # is required: - # - # policy.require_sri_for :script, :style - # - # Leave empty to not require Subresource Integrity: - # - # policy.require_sri_for - # - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#239 - def require_sri_for(*types); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def require_trusted_types_for(*sources); end - - # Specify whether a {sandbox}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/sandbox] - # should be enabled for the requested resource: - # - # policy.sandbox - # - # Values can be passed as arguments: - # - # policy.sandbox "allow-scripts", "allow-modals" - # - # Pass +false+ to disable the sandbox: - # - # policy.sandbox false - # - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#260 - def sandbox(*values); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def script_src(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def script_src_attr(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def script_src_elem(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def style_src(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def style_src_attr(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def style_src_elem(*sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def trusted_types(*sources); end - - # Specify whether user agents should treat any assets over HTTP as HTTPS: - # - # policy.upgrade_insecure_requests - # - # Pass +false+ to disable it: - # - # policy.upgrade_insecure_requests false - # - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#278 - def upgrade_insecure_requests(enabled = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#179 - def worker_src(*sources); end - - private - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#305 - def apply_mapping(source); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#292 - def apply_mappings(sources); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#327 - def build_directive(sources, context); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#311 - def build_directives(context, nonce, nonce_directives); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#174 - def initialize_copy(other); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#349 - def nonce_directive?(directive, nonce_directives); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#331 - def resolve_source(source, context); end -end - -# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#163 -ActionDispatch::ContentSecurityPolicy::DEFAULT_NONCE_DIRECTIVES = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#138 -ActionDispatch::ContentSecurityPolicy::DIRECTIVES = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#119 -ActionDispatch::ContentSecurityPolicy::MAPPINGS = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#25 -class ActionDispatch::ContentSecurityPolicy::Middleware - # @return [Middleware] a new instance of Middleware - # - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#30 - def initialize(app); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#34 - def call(env); end - - private - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#51 - def header_name(request); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#59 - def policy_present?(headers); end -end - -# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#26 -ActionDispatch::ContentSecurityPolicy::Middleware::CONTENT_TYPE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#27 -ActionDispatch::ContentSecurityPolicy::Middleware::POLICY = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#28 -ActionDispatch::ContentSecurityPolicy::Middleware::POLICY_REPORT_ONLY = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#64 -module ActionDispatch::ContentSecurityPolicy::Request - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#71 - def content_security_policy; end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#75 - def content_security_policy=(policy); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#103 - def content_security_policy_nonce; end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#95 - def content_security_policy_nonce_directives; end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#99 - def content_security_policy_nonce_directives=(generator); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#87 - def content_security_policy_nonce_generator; end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#91 - def content_security_policy_nonce_generator=(generator); end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#79 - def content_security_policy_report_only; end - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#83 - def content_security_policy_report_only=(value); end - - private - - # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#114 - def generate_content_security_policy_nonce; end -end - -# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#68 -ActionDispatch::ContentSecurityPolicy::Request::NONCE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#69 -ActionDispatch::ContentSecurityPolicy::Request::NONCE_DIRECTIVES = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#67 -ActionDispatch::ContentSecurityPolicy::Request::NONCE_GENERATOR = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#65 -ActionDispatch::ContentSecurityPolicy::Request::POLICY = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#66 -ActionDispatch::ContentSecurityPolicy::Request::POLICY_REPORT_ONLY = T.let(T.unsafe(nil), String) - -# Read and write data to cookies through ActionController::Base#cookies. -# -# When reading cookie data, the data is read from the HTTP request header, Cookie. -# When writing cookie data, the data is sent out in the HTTP response header, Set-Cookie. -# -# Examples of writing: -# -# # Sets a simple session cookie. -# # This cookie will be deleted when the user's browser is closed. -# cookies[:user_name] = "david" -# -# # Cookie values are String-based. Other data types need to be serialized. -# cookies[:lat_lon] = JSON.generate([47.68, -122.37]) -# -# # Sets a cookie that expires in 1 hour. -# cookies[:login] = { value: "XJ-122", expires: 1.hour } -# -# # Sets a cookie that expires at a specific time. -# cookies[:login] = { value: "XJ-122", expires: Time.utc(2020, 10, 15, 5) } -# -# # Sets a signed cookie, which prevents users from tampering with its value. -# # It can be read using the signed method `cookies.signed[:name]` -# cookies.signed[:user_id] = current_user.id -# -# # Sets an encrypted cookie value before sending it to the client which -# # prevent users from reading and tampering with its value. -# # It can be read using the encrypted method `cookies.encrypted[:name]` -# cookies.encrypted[:discount] = 45 -# -# # Sets a "permanent" cookie (which expires in 20 years from now). -# cookies.permanent[:login] = "XJ-122" -# -# # You can also chain these methods: -# cookies.signed.permanent[:login] = "XJ-122" -# -# Examples of reading: -# -# cookies[:user_name] # => "david" -# cookies.size # => 2 -# JSON.parse(cookies[:lat_lon]) # => [47.68, -122.37] -# cookies.signed[:login] # => "XJ-122" -# cookies.encrypted[:discount] # => 45 -# -# Example for deleting: -# -# cookies.delete :user_name -# -# Please note that if you specify a +:domain+ when setting a cookie, you must also specify the domain when deleting the cookie: -# -# cookies[:name] = { -# value: 'a yummy cookie', -# expires: 1.year, -# domain: 'domain.com' -# } -# -# cookies.delete(:name, domain: 'domain.com') -# -# The option symbols for setting cookies are: -# -# * :value - The cookie's value. -# * :path - The path for which this cookie applies. Defaults to the root -# of the application. -# * :domain - The domain for which this cookie applies so you can -# restrict to the domain level. If you use a schema like www.example.com -# and want to share session with user.example.com set :domain -# to :all. To support multiple domains, provide an array, and -# the first domain matching request.host will be used. Make -# sure to specify the :domain option with :all or -# Array again when deleting cookies. -# -# domain: nil # Does not set cookie domain. (default) -# domain: :all # Allow the cookie for the top most level -# # domain and subdomains. -# domain: %w(.example.com .example.org) # Allow the cookie -# # for concrete domain names. -# -# * :tld_length - When using :domain => :all, this option can be used to explicitly -# set the TLD length when using a short (<= 3 character) domain that is being interpreted as part of a TLD. -# For example, to share cookies between user1.lvh.me and user2.lvh.me, set :tld_length to 2. -# * :expires - The time at which this cookie expires, as a \Time or ActiveSupport::Duration object. -# * :secure - Whether this cookie is only transmitted to HTTPS servers. -# Default is +false+. -# * :httponly - Whether this cookie is accessible via scripting or -# only HTTP. Defaults to +false+. -# * :same_site - The value of the +SameSite+ cookie attribute, which -# determines how this cookie should be restricted in cross-site contexts. -# Possible values are +:none+, +:lax+, and +:strict+. Defaults to +:lax+. -# -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#182 -class ActionDispatch::Cookies - # @return [Cookies] a new instance of Cookies - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#689 - def initialize(app); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#693 - def call(env); end -end - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#188 -ActionDispatch::Cookies::AUTHENTICATED_ENCRYPTED_COOKIE_SALT = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#477 -class ActionDispatch::Cookies::AbstractCookieJar - include ::ActionDispatch::Cookies::ChainedCookieJars - - # @return [AbstractCookieJar] a new instance of AbstractCookieJar - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#480 - def initialize(parent_jar); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#484 - def [](name); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#496 - def []=(name, options); end - - protected - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#508 - def request; end - - private - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#526 - def commit(name, options); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#519 - def cookie_metadata(name, options); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#511 - def expiry_options(options); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#525 - def parse(name, data, purpose: T.unsafe(nil)); end -end - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#194 -ActionDispatch::Cookies::COOKIES_DIGEST = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#195 -ActionDispatch::Cookies::COOKIES_ROTATIONS = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#196 -ActionDispatch::Cookies::COOKIES_SAME_SITE_PROTECTION = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#193 -ActionDispatch::Cookies::COOKIES_SERIALIZER = T.let(T.unsafe(nil), String) - -# Include in a cookie jar to allow chaining, e.g. +cookies.permanent.signed+. -# -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#206 -module ActionDispatch::Cookies::ChainedCookieJars - # Returns a jar that'll automatically encrypt cookie values before sending them to the client and will decrypt them for read. - # If the cookie was tampered with by the user (or a 3rd party), +nil+ will be returned. - # - # If +config.action_dispatch.encrypted_cookie_salt+ and +config.action_dispatch.encrypted_signed_cookie_salt+ - # are both set, legacy cookies encrypted with HMAC AES-256-CBC will be transparently upgraded. - # - # This jar requires that you set a suitable secret for the verification on your app's +secret_key_base+. - # - # Example: - # - # cookies.encrypted[:discount] = 45 - # # => Set-Cookie: discount=DIQ7fw==--K3n//8vvnSbGq9dA--7Xh91HfLpwzbj1czhBiwOg==; path=/ - # - # cookies.encrypted[:discount] # => 45 - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#252 - def encrypted; end - - # Returns a jar that'll automatically set the assigned cookies to have an expiration date 20 years from now. Example: - # - # cookies.permanent[:prefers_open_id] = true - # # => Set-Cookie: prefers_open_id=true; path=/; expires=Sun, 16-Dec-2029 03:24:16 GMT - # - # This jar is only meant for writing. You'll read permanent cookies through the regular accessor. - # - # This jar allows chaining with the signed jar as well, so you can set permanent, signed cookies. Examples: - # - # cookies.permanent.signed[:remember_me] = current_user.id - # # => Set-Cookie: remember_me=BAhU--848956038e692d7046deab32b7131856ab20e14e; path=/; expires=Sun, 16-Dec-2029 03:24:16 GMT - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#218 - def permanent; end - - # Returns a jar that'll automatically generate a signed representation of cookie value and verify it when reading from - # the cookie again. This is useful for creating cookies with values that the user is not supposed to change. If a signed - # cookie was tampered with by the user (or a 3rd party), +nil+ will be returned. - # - # This jar requires that you set a suitable secret for the verification on your app's +secret_key_base+. - # - # Example: - # - # cookies.signed[:discount] = 45 - # # => Set-Cookie: discount=BAhpMg==--2c1c6906c90a3bc4fd54a51ffb41dffa4bf6b5f7; path=/ - # - # cookies.signed[:discount] # => 45 - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#234 - def signed; end - - # Returns the +signed+ or +encrypted+ jar, preferring +encrypted+ if +secret_key_base+ is set. - # Used by ActionDispatch::Session::CookieStore to avoid the need to introduce new cookie stores. - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#258 - def signed_or_encrypted; end - - private - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#281 - def encrypted_cookie_cipher; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#275 - def prepare_upgrade_legacy_hmac_aes_cbc_cookies?; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#285 - def signed_cookie_digest; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#268 - def upgrade_legacy_hmac_aes_cbc_cookies?; end -end - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#290 -class ActionDispatch::Cookies::CookieJar - include ::ActionDispatch::Cookies::ChainedCookieJars - include ::Enumerable - - # @return [CookieJar] a new instance of CookieJar - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#315 - def initialize(request); end - - # Returns the value of the cookie by +name+, or +nil+ if no such cookie exists. - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#336 - def [](name); end - - # Sets the cookie named +name+. The second argument may be the cookie's - # value or a hash of options as documented above. - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#370 - def []=(name, options); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#424 - def always_write_cookie; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#424 - def always_write_cookie=(val); end - - # Removes all cookies on the client machine by calling delete for each cookie. - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#414 - def clear(options = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#325 - def commit!; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#323 - def committed?; end - - # Removes the cookie on the client machine by setting the value to an empty string - # and the expiration date in the past. Like []=, you can pass in - # an options hash to delete cookies with extra data such as a :path. - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#393 - def delete(name, options = T.unsafe(nil)); end - - # Whether the given cookie is to be deleted by this CookieJar. - # Like []=, you can pass in an options hash to test if a - # deletion applies to a specific :path, :domain etc. - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#407 - def deleted?(name, options = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#331 - def each(&block); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#340 - def fetch(name, *args, &block); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#344 - def has_key?(name); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#344 - def key?(name); end - - # Returns the value of attribute request. - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#313 - def request; end - - # Returns the cookies as Hash. - def to_hash(*_arg0); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#364 - def to_header; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#352 - def update(other_hash); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#357 - def update_cookies_from_jar; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#418 - def write(headers); end - - private - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#427 - def escape(string); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#448 - def handle_options(options); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#431 - def make_set_cookie_header(header); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#444 - def write_cookie?(cookie); end - - class << self - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#424 - def always_write_cookie; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#424 - def always_write_cookie=(val); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#307 - def build(req, cookies); end - end -end - -# This regular expression is used to split the levels of a domain. -# The top level domain can be any string without a period or -# **.**, ***.** style TLDs like co.uk or com.au -# -# www.example.co.uk gives: -# $& => example.co.uk -# -# example.com gives: -# $& => example.com -# -# lots.of.subdomains.example.local gives: -# $& => example.local -# -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#305 -ActionDispatch::Cookies::CookieJar::DOMAIN_REGEXP = T.let(T.unsafe(nil), Regexp) - -# Raised when storing more than 4K of session data. -# -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#203 -class ActionDispatch::Cookies::CookieOverflow < ::StandardError; end - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#190 -ActionDispatch::Cookies::ENCRYPTED_COOKIE_CIPHER = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#186 -ActionDispatch::Cookies::ENCRYPTED_COOKIE_SALT = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#187 -ActionDispatch::Cookies::ENCRYPTED_SIGNED_COOKIE_SALT = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#637 -class ActionDispatch::Cookies::EncryptedKeyRotatingCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar - include ::ActionDispatch::Cookies::SerializedCookieJars - - # @return [EncryptedKeyRotatingCookieJar] a new instance of EncryptedKeyRotatingCookieJar - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#640 - def initialize(parent_jar); end - - private - - # @raise [CookieOverflow] - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#682 - def commit(name, options); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#674 - def parse(name, encrypted_message, purpose: T.unsafe(nil)); end -end - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#184 -ActionDispatch::Cookies::GENERATOR_KEY = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#183 -ActionDispatch::Cookies::HTTP_HEADER = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#548 -class ActionDispatch::Cookies::JsonSerializer - class << self - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#553 - def dump(value); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#549 - def load(value); end - end -end - -# Cookies can typically store 4096 bytes. -# -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#200 -ActionDispatch::Cookies::MAX_COOKIE_SIZE = T.let(T.unsafe(nil), Integer) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#536 -class ActionDispatch::Cookies::MarshalWithJsonFallback - class << self - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#543 - def dump(value); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#537 - def load(value); end - end -end - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#529 -class ActionDispatch::Cookies::PermanentCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar - private - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#531 - def commit(name, options); end -end - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#192 -ActionDispatch::Cookies::SECRET_KEY_BASE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#191 -ActionDispatch::Cookies::SIGNED_COOKIE_DIGEST = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#185 -ActionDispatch::Cookies::SIGNED_COOKIE_SALT = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#558 -module ActionDispatch::Cookies::SerializedCookieJars - protected - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#571 - def deserialize(name); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#603 - def digest; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#563 - def needs_migration?(value); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#567 - def serialize(value); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#591 - def serializer; end -end - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#559 -ActionDispatch::Cookies::SerializedCookieJars::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#560 -ActionDispatch::Cookies::SerializedCookieJars::SERIALIZER = ActiveSupport::MessageEncryptor::NullSerializer - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#608 -class ActionDispatch::Cookies::SignedKeyRotatingCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar - include ::ActionDispatch::Cookies::SerializedCookieJars - - # @return [SignedKeyRotatingCookieJar] a new instance of SignedKeyRotatingCookieJar - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#611 - def initialize(parent_jar); end - - private - - # @raise [CookieOverflow] - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#630 - def commit(name, options); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#624 - def parse(name, signed_message, purpose: T.unsafe(nil)); end -end - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#189 -ActionDispatch::Cookies::USE_AUTHENTICATED_COOKIE_ENCRYPTION = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#197 -ActionDispatch::Cookies::USE_COOKIES_WITH_METADATA = T.let(T.unsafe(nil), String) - -# This middleware is responsible for logging exceptions and -# showing a debugging page in case the request is local. -# -# source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#11 -class ActionDispatch::DebugExceptions - # @return [DebugExceptions] a new instance of DebugExceptions - # - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#19 - def initialize(app, routes_app = T.unsafe(nil), response_format = T.unsafe(nil), interceptors = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#26 - def call(env); end - - private - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#176 - def api_request?(content_type); end - - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#114 - def create_template(request, wrapper); end - - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#43 - def invoke_interceptors(request, exception); end - - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#152 - def log_array(logger, lines); end - - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#133 - def log_error(request, wrapper); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#180 - def log_rescued_responses?(request); end - - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#162 - def logger(request); end - - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#129 - def render(status, body, format); end - - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#54 - def render_exception(request, exception); end - - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#90 - def render_for_api_request(content_type, wrapper); end - - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#76 - def render_for_browser_request(request, wrapper); end - - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#170 - def routes_inspector(exception); end - - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#166 - def stderr_logger; end - - class << self - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#12 - def interceptors; end - - # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#14 - def register_interceptor(object = T.unsafe(nil), &block); end - end -end - -# This middleware can be used to diagnose deadlocks in the autoload interlock. -# -# To use it, insert it near the top of the middleware stack, using -# config/application.rb: -# -# config.middleware.insert_before Rack::Sendfile, ActionDispatch::DebugLocks -# -# After restarting the application and re-triggering the deadlock condition, -# the route /rails/locks will show a summary of all threads currently -# known to the interlock, which lock level they are holding or awaiting, and -# their current backtrace. -# -# Generally a deadlock will be caused by the interlock conflicting with some -# other external lock or blocking I/O call. These cannot be automatically -# identified, but should be visible in the displayed backtraces. -# -# NOTE: The formatting and content of this middleware's output is intended for -# human consumption, and should be expected to change between releases. -# -# This middleware exposes operational details of the server, with no access -# control. It should only be enabled when in use, and removed thereafter. -# -# source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#25 -class ActionDispatch::DebugLocks - # @return [DebugLocks] a new instance of DebugLocks - # - # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#26 - def initialize(app, path = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#31 - def call(env); end - - private - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#103 - def blocked_by?(victim, blocker, all_threads); end - - # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#45 - def render_details(req); end -end - -# source://actionpack//lib/action_dispatch/middleware/debug_view.rb#9 -class ActionDispatch::DebugView < ::ActionView::Base - # @return [DebugView] a new instance of DebugView - # - # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#12 - def initialize(assigns); end - - # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#18 - def compiled_method_container; end - - # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#42 - def debug_hash(object); end - - # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#34 - def debug_headers(headers); end - - # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#22 - def debug_params(params); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#60 - def params_valid?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#56 - def protect_against_forgery?; end - - # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#46 - def render(*_arg0); end -end - -# source://actionpack//lib/action_dispatch/middleware/debug_view.rb#10 -ActionDispatch::DebugView::RESCUES_TEMPLATE_PATH = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#7 -class ActionDispatch::ExceptionWrapper - # @return [ExceptionWrapper] a new instance of ExceptionWrapper - # - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#46 - def initialize(backtrace_cleaner, exception); end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#77 - def application_trace; end - - # Returns the value of attribute backtrace_cleaner. - # - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 - def backtrace_cleaner; end - - # Returns the value of attribute exception. - # - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 - def exception; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#71 - def exception_trace; end - - # Returns the value of attribute file. - # - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 - def file; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#81 - def framework_trace; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#85 - def full_trace; end - - # Returns the value of attribute line_number. - # - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 - def line_number; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#121 - def rescue_response?; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#8 - def rescue_responses; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#8 - def rescue_responses=(val); end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#63 - def rescue_template; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#26 - def rescue_templates; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#26 - def rescue_templates=(val); end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#39 - def silent_exceptions; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#39 - def silent_exceptions=(val); end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#125 - def source_extracts; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#144 - def source_to_show_id; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#67 - def status_code; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#136 - def trace_to_show; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#89 - def traces; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#55 - def unwrapped_exception; end - - # Returns the value of attribute wrapped_causes. - # - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 - def wrapped_causes; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#35 - def wrapper_exceptions; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#35 - def wrapper_exceptions=(val); end - - private - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#149 - def backtrace; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#153 - def causes_for(exception); end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#163 - def clean_backtrace(*args); end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#190 - def expand_backtrace; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#183 - def extract_file_and_line_number(trace); end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#171 - def source_fragment(path, line); end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#159 - def wrapped_causes_for(exception, backtrace_cleaner); end - - class << self - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#8 - def rescue_responses; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#8 - def rescue_responses=(val); end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#26 - def rescue_templates; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#26 - def rescue_templates=(val); end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#39 - def silent_exceptions; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#39 - def silent_exceptions=(val); end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#117 - def status_code_for_exception(class_name); end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#35 - def wrapper_exceptions; end - - # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#35 - def wrapper_exceptions=(val); end - end -end - -# source://actionpack//lib/action_dispatch/middleware/executor.rb#6 -class ActionDispatch::Executor - # @return [Executor] a new instance of Executor - # - # source://actionpack//lib/action_dispatch/middleware/executor.rb#7 - def initialize(app, executor); end - - # source://actionpack//lib/action_dispatch/middleware/executor.rb#11 - def call(env); end -end - -# This endpoint serves static files from disk using Rack::File. -# -# URL paths are matched with static files according to expected -# conventions: +path+, +path+.html, +path+/index.html. -# -# Precompressed versions of these files are checked first. Brotli (.br) -# and gzip (.gz) files are supported. If +path+.br exists, this -# endpoint returns that file with a Content-Encoding: br header. -# -# If no matching file is found, this endpoint responds 404 Not Found. -# -# Pass the +root+ directory to search for matching files, an optional -# index: "index" to change the default +path+/index.html, and optional -# additional response headers. -# -# source://actionpack//lib/action_dispatch/middleware/static.rb#41 -class ActionDispatch::FileHandler - # @return [FileHandler] a new instance of FileHandler - # - # source://actionpack//lib/action_dispatch/middleware/static.rb#49 - def initialize(root, index: T.unsafe(nil), headers: T.unsafe(nil), precompressed: T.unsafe(nil), compressible_content_types: T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/middleware/static.rb#63 - def attempt(env); end - - # source://actionpack//lib/action_dispatch/middleware/static.rb#59 - def call(env); end - - private - - # source://actionpack//lib/action_dispatch/middleware/static.rb#179 - def clean_path(path_info); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/static.rb#143 - def compressible?(content_type); end - - # @yield [path, content_type || "text/plain"] - # - # source://actionpack//lib/action_dispatch/middleware/static.rb#156 - def each_candidate_filepath(path_info); end - - # source://actionpack//lib/action_dispatch/middleware/static.rb#147 - def each_precompressed_filepath(filepath); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/static.rb#138 - def file_readable?(path); end - - # Match a URI path to a static file to be served. - # - # Used by the +Static+ class to negotiate a servable file in the - # +public/+ directory (see Static#call). - # - # Checks for +path+, +path+.html, and +path+/index.html files, - # in that order, including .br and .gzip compressed extensions. - # - # If a matching file is found, the path and necessary response headers - # (Content-Type, Content-Encoding) are returned. - # - # source://actionpack//lib/action_dispatch/middleware/static.rb#98 - def find_file(path_info, accept_encoding:); end - - # source://actionpack//lib/action_dispatch/middleware/static.rb#74 - def serve(request, filepath, content_headers); end - - # source://actionpack//lib/action_dispatch/middleware/static.rb#106 - def try_files(filepath, content_type, accept_encoding:); end - - # source://actionpack//lib/action_dispatch/middleware/static.rb#116 - def try_precompressed_files(filepath, headers, accept_encoding:); end -end - -# Accept-Encoding value -> file extension -# -# source://actionpack//lib/action_dispatch/middleware/static.rb#43 -ActionDispatch::FileHandler::PRECOMPRESSED = T.let(T.unsafe(nil), Hash) - -# The flash provides a way to pass temporary primitive-types (String, Array, Hash) between actions. Anything you place in the flash will be exposed -# to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create -# action that sets flash[:notice] = "Post successfully created" before redirecting to a display action that can -# then expose the flash to its template. Actually, that exposure is automatically done. -# -# class PostsController < ActionController::Base -# def create -# # save post -# flash[:notice] = "Post successfully created" -# redirect_to @post -# end -# -# def show -# # doesn't need to assign the flash notice to the template, that's done automatically -# end -# end -# -# Then in +show.html.erb+: -# -# <% if flash[:notice] %> -#
<%= flash[:notice] %>
-# <% end %> -# -# Since the +notice+ and +alert+ keys are a common idiom, convenience accessors are available: -# -# flash.alert = "You must be logged in" -# flash.notice = "Post successfully created" -# -# This example places a string in the flash. And of course, you can put as many as you like at a time too. If you want to pass -# non-primitive types, you will have to handle that in your application. Example: To show messages with links, you will have to -# use sanitize helper. -# -# Just remember: They'll be gone by the time the next action has been performed. -# -# See docs on the FlashHash class for more details about the flash. -# -# source://actionpack//lib/action_dispatch/middleware/flash.rb#41 -class ActionDispatch::Flash - class << self - # source://actionpack//lib/action_dispatch/middleware/flash.rb#293 - def new(app); end - end -end - -# source://actionpack//lib/action_dispatch/middleware/flash.rb#110 -class ActionDispatch::Flash::FlashHash - include ::Enumerable - - # @return [FlashHash] a new instance of FlashHash - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#140 - def initialize(flashes = T.unsafe(nil), discard = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#160 - def [](k); end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#154 - def []=(k, v); end - - # Convenience accessor for flash[:alert]. - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#261 - def alert; end - - # Convenience accessor for flash[:alert]=. - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#266 - def alert=(message); end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#193 - def clear; end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#178 - def delete(key); end - - # Marks the entire flash or a single flash entry to be discarded by the end of the current action: - # - # flash.discard # discard the entire flash at the end of the current action - # flash.discard(:warning) # discard only the "warning" entry at the end of the current action - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#246 - def discard(k = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#198 - def each(&block); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#189 - def empty?; end - - # Keeps either the entire current flash or a specific flash entry available for the next action: - # - # flash.keep # keeps the entire flash - # flash.keep(:notice) # keeps only the "notice" entry, the rest of the flash is discarded - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#236 - def keep(k = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#174 - def key?(name); end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#170 - def keys; end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#164 - def merge!(h); end - - # Convenience accessor for flash[:notice]. - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#271 - def notice; end - - # Convenience accessor for flash[:notice]=. - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#276 - def notice=(message); end - - # Sets a flash that will not be available to the next action, only to the current. - # - # flash.now[:message] = "Hello current action" - # - # This method enables you to use the flash as a central messaging system in your app. - # When you need to pass an object to the next action, you use the standard flash assign ([]=). - # When you need to pass an object to the current action, you use now, and your object will - # vanish when the current action is done. - # - # Entries set via now are accessed the same way as standard entries: flash['my-key']. - # - # Also, brings two convenience accessors: - # - # flash.now.alert = "Beware now!" - # # Equivalent to flash.now[:alert] = "Beware now!" - # - # flash.now.notice = "Good luck now!" - # # Equivalent to flash.now[:notice] = "Good luck now!" - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#228 - def now; end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#204 - def replace(h); end - - # 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. - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#255 - def sweep; end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#185 - def to_hash; end - - # Builds a hash containing the flashes to keep for the next request. - # If there are none to keep, returns +nil+. - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#134 - def to_session_value; end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#164 - def update(h); end - - protected - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#281 - def now_is_loaded?; end - - private - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#146 - def initialize_copy(other); end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#286 - def stringify_array(array); end - - class << self - # source://actionpack//lib/action_dispatch/middleware/flash.rb#113 - def from_session_value(value); end - end -end - -# source://actionpack//lib/action_dispatch/middleware/flash.rb#81 -class ActionDispatch::Flash::FlashNow - # @return [FlashNow] a new instance of FlashNow - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#84 - def initialize(flash); end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#95 - def [](k); end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#88 - def []=(k, v); end - - # Convenience accessor for flash.now[:alert]=. - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#100 - def alert=(message); end - - # Returns the value of attribute flash. - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#82 - def flash; end - - # Sets the attribute flash - # - # @param value the value to set the attribute flash to. - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#82 - def flash=(_arg0); end - - # Convenience accessor for flash.now[:notice]=. - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#105 - def notice=(message); end -end - -# source://actionpack//lib/action_dispatch/middleware/flash.rb#42 -ActionDispatch::Flash::KEY = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/flash.rb#44 -module ActionDispatch::Flash::RequestMethods - # source://actionpack//lib/action_dispatch/middleware/flash.rb#62 - def commit_flash; end - - # Access the contents of the flash. Returns a ActionDispatch::Flash::FlashHash. - # - # See ActionDispatch::Flash for example usage. - # - # source://actionpack//lib/action_dispatch/middleware/flash.rb#48 - def flash; end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#54 - def flash=(flash); end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#58 - def flash_hash; end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#75 - def reset_session; end -end - -# This middleware guards from DNS rebinding attacks by explicitly permitting -# the hosts a request can be sent to, and is passed the options set in -# +config.host_authorization+. -# -# Requests can opt-out of Host Authorization with +exclude+: -# -# config.host_authorization = { exclude: ->(request) { request.path =~ /healthcheck/ } } -# -# When a request comes to an unauthorized host, the +response_app+ -# application will be executed and rendered. If no +response_app+ is given, a -# default one will run. -# The default response app logs blocked host info with level 'error' and -# responds with 403 Forbidden. The body of the response contains debug info -# if +config.consider_all_requests_local+ is set to true, otherwise the body is empty. -# -# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#18 -class ActionDispatch::HostAuthorization - # @return [HostAuthorization] a new instance of HostAuthorization - # - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#122 - def initialize(app, hosts, exclude: T.unsafe(nil), response_app: T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#130 - def call(env); end - - private - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#144 - def authorized?(request); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#151 - def excluded?(request); end - - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#155 - def mark_as_authorized(request); end -end - -# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#19 -ActionDispatch::HostAuthorization::ALLOWED_HOSTS_IN_DEVELOPMENT = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#83 -class ActionDispatch::HostAuthorization::DefaultResponseApp - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#86 - def call(env); end - - private - - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#117 - def available_logger(request); end - - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#109 - def log_error(request); end - - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#102 - def response(format, body); end - - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#95 - def response_body(request); end -end - -# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#84 -ActionDispatch::HostAuthorization::DefaultResponseApp::RESPONSE_STATUS = T.let(T.unsafe(nil), Integer) - -# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#21 -ActionDispatch::HostAuthorization::IPV4_HOSTNAME = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#22 -ActionDispatch::HostAuthorization::IPV6_HOSTNAME = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#23 -ActionDispatch::HostAuthorization::IPV6_HOSTNAME_WITH_PORT = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#20 -ActionDispatch::HostAuthorization::PORT_REGEX = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#30 -class ActionDispatch::HostAuthorization::Permissions - # @return [Permissions] a new instance of Permissions - # - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#31 - def initialize(hosts); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#39 - def allows?(host); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#35 - def empty?; end - - private - - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#78 - def extract_hostname(host); end - - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#56 - def sanitize_hosts(hosts); end - - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#66 - def sanitize_regexp(host); end - - # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#70 - def sanitize_string(host); end -end - -# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#24 -ActionDispatch::HostAuthorization::VALID_IP_HOSTNAME = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch.rb#80 -module ActionDispatch::Http - extend ::ActiveSupport::Autoload -end - -# source://actionpack//lib/action_dispatch/http/cache.rb#5 -module ActionDispatch::Http::Cache; end - -# source://actionpack//lib/action_dispatch/http/cache.rb#6 -module ActionDispatch::Http::Cache::Request - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/cache.rb#28 - def etag_matches?(etag); end - - # Check response freshness (Last-Modified and ETag) against request - # If-Modified-Since and If-None-Match conditions. If both headers are - # supplied, both must match, or the request is not considered fresh. - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/cache.rb#38 - def fresh?(response); end - - # source://actionpack//lib/action_dispatch/http/cache.rb#10 - def if_modified_since; end - - # source://actionpack//lib/action_dispatch/http/cache.rb#16 - def if_none_match; end - - # source://actionpack//lib/action_dispatch/http/cache.rb#20 - def if_none_match_etags; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/cache.rb#24 - def not_modified?(modified_at); end -end - -# source://actionpack//lib/action_dispatch/http/cache.rb#7 -ActionDispatch::Http::Cache::Request::HTTP_IF_MODIFIED_SINCE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/cache.rb#8 -ActionDispatch::Http::Cache::Request::HTTP_IF_NONE_MATCH = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/cache.rb#51 -module ActionDispatch::Http::Cache::Response - # Returns the value of attribute cache_control. - # - # source://actionpack//lib/action_dispatch/http/cache.rb#52 - def cache_control; end - - # source://actionpack//lib/action_dispatch/http/cache.rb#68 - def date; end - - # source://actionpack//lib/action_dispatch/http/cache.rb#78 - def date=(utc_time); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/cache.rb#74 - def date?; end - - # This method sets a weak ETag validator on the response so browsers - # and proxies may cache the response, keyed on the ETag. On subsequent - # requests, the If-None-Match header is set to the cached ETag. If it - # matches the current ETag, we can return a 304 Not Modified response - # with no body, letting the browser or proxy know that their cache is - # current. Big savings in request time and network bandwidth. - # - # Weak ETags are considered to be semantically equivalent but not - # byte-for-byte identical. This is perfect for browser caching of HTML - # pages where we don't care about exact equality, just what the user - # is viewing. - # - # Strong ETags are considered byte-for-byte identical. They allow a - # browser or proxy cache to support Range requests, useful for paging - # through a PDF file or scrubbing through a video. Some CDNs only - # support strong ETags and will ignore weak ETags entirely. - # - # Weak ETags are what we almost always need, so they're the default. - # Check out #strong_etag= to provide a strong ETag validator. - # - # source://actionpack//lib/action_dispatch/http/cache.rb#101 - def etag=(weak_validators); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/cache.rb#113 - def etag?; end - - # source://actionpack//lib/action_dispatch/http/cache.rb#54 - def last_modified; end - - # source://actionpack//lib/action_dispatch/http/cache.rb#64 - def last_modified=(utc_time); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/cache.rb#60 - def last_modified?; end - - # source://actionpack//lib/action_dispatch/http/cache.rb#109 - def strong_etag=(strong_validators); end - - # True if an ETag is set and it isn't a weak validator (not preceded with W/) - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/cache.rb#121 - def strong_etag?; end - - # source://actionpack//lib/action_dispatch/http/cache.rb#105 - def weak_etag=(weak_validators); end - - # True if an ETag is set and it's a weak validator (preceded with W/) - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/cache.rb#116 - def weak_etag?; end - - private - - # source://actionpack//lib/action_dispatch/http/cache.rb#146 - def cache_control_headers; end - - # source://actionpack//lib/action_dispatch/http/cache.rb#138 - def cache_control_segments; end - - # source://actionpack//lib/action_dispatch/http/cache.rb#134 - def generate_strong_etag(validators); end - - # source://actionpack//lib/action_dispatch/http/cache.rb#130 - def generate_weak_etag(validators); end - - # source://actionpack//lib/action_dispatch/http/cache.rb#175 - def handle_conditional_get!; end - - # source://actionpack//lib/action_dispatch/http/cache.rb#185 - def merge_and_normalize_cache_control!(cache_control); end - - # source://actionpack//lib/action_dispatch/http/cache.rb#164 - def prepare_cache_control!; end -end - -# source://actionpack//lib/action_dispatch/http/cache.rb#126 -ActionDispatch::Http::Cache::Response::DATE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/cache.rb#168 -ActionDispatch::Http::Cache::Response::DEFAULT_CACHE_CONTROL = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/cache.rb#127 -ActionDispatch::Http::Cache::Response::LAST_MODIFIED = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/cache.rb#173 -ActionDispatch::Http::Cache::Response::MUST_REVALIDATE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/cache.rb#170 -ActionDispatch::Http::Cache::Response::NO_CACHE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/cache.rb#169 -ActionDispatch::Http::Cache::Response::NO_STORE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/cache.rb#172 -ActionDispatch::Http::Cache::Response::PRIVATE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/cache.rb#171 -ActionDispatch::Http::Cache::Response::PUBLIC = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/cache.rb#128 -ActionDispatch::Http::Cache::Response::SPECIAL_KEYS = T.let(T.unsafe(nil), Set) - -# source://actionpack//lib/action_dispatch/http/content_disposition.rb#5 -class ActionDispatch::Http::ContentDisposition - # @return [ContentDisposition] a new instance of ContentDisposition - # - # source://actionpack//lib/action_dispatch/http/content_disposition.rb#12 - def initialize(disposition:, filename:); end - - # source://actionpack//lib/action_dispatch/http/content_disposition.rb#19 - def ascii_filename; end - - # Returns the value of attribute disposition. - # - # source://actionpack//lib/action_dispatch/http/content_disposition.rb#10 - def disposition; end - - # Returns the value of attribute filename. - # - # source://actionpack//lib/action_dispatch/http/content_disposition.rb#10 - def filename; end - - # source://actionpack//lib/action_dispatch/http/content_disposition.rb#29 - def to_s; end - - # source://actionpack//lib/action_dispatch/http/content_disposition.rb#25 - def utf8_filename; end - - private - - # source://actionpack//lib/action_dispatch/http/content_disposition.rb#38 - def percent_escape(string, pattern); end - - class << self - # source://actionpack//lib/action_dispatch/http/content_disposition.rb#6 - def format(disposition:, filename:); end - end -end - -# source://actionpack//lib/action_dispatch/http/content_disposition.rb#23 -ActionDispatch::Http::ContentDisposition::RFC_5987_ESCAPED_CHAR = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/http/content_disposition.rb#17 -ActionDispatch::Http::ContentDisposition::TRADITIONAL_ESCAPED_CHAR = T.let(T.unsafe(nil), Regexp) - -# Allows you to specify sensitive parameters which will be replaced from -# the request log by looking in the query string of the request and all -# sub-hashes of the params hash to filter. Filtering only certain sub-keys -# from a hash is possible by using the dot notation: 'credit_card.number'. -# If a block is given, each key and value of the params hash and all -# sub-hashes are passed to it, where the value or the key can be replaced using -# String#replace or similar methods. -# -# env["action_dispatch.parameter_filter"] = [:password] -# => replaces the value to all keys matching /password/i with "[FILTERED]" -# -# env["action_dispatch.parameter_filter"] = [:foo, "bar"] -# => replaces the value to all keys matching /foo|bar/i with "[FILTERED]" -# -# env["action_dispatch.parameter_filter"] = [ /\Apin\z/i, /\Apin_/i ] -# => replaces the value for the exact (case-insensitive) key 'pin' and all -# (case-insensitive) keys beginning with 'pin_', with "[FILTERED]" -# Does not match keys with 'pin' as a substring, such as 'shipping_id'. -# -# env["action_dispatch.parameter_filter"] = [ "credit_card.code" ] -# => replaces { credit_card: {code: "xxxx"} } with "[FILTERED]", does not -# change { file: { code: "xxxx"} } -# -# env["action_dispatch.parameter_filter"] = -> (k, v) do -# v.reverse! if k.match?(/secret/i) -# end -# => reverses the value to all keys matching /secret/i -# -# source://actionpack//lib/action_dispatch/http/filter_parameters.rb#34 -module ActionDispatch::Http::FilterParameters - # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#39 - def initialize; end - - # Returns a hash of request.env with all sensitive data replaced. - # - # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#54 - def filtered_env; end - - # Returns a hash of parameters with all sensitive data replaced. - # - # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#47 - def filtered_parameters; end - - # Reconstructs a path with all sensitive GET parameters replaced. - # - # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#59 - def filtered_path; end - - private - - # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#70 - def env_filter; end - - # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#83 - def filtered_query_string; end - - # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#64 - def parameter_filter; end - - # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#77 - def parameter_filter_for(filters); end -end - -# source://actionpack//lib/action_dispatch/http/filter_parameters.rb#35 -ActionDispatch::Http::FilterParameters::ENV_MATCH = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/http/filter_parameters.rb#81 -ActionDispatch::Http::FilterParameters::KV_RE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/filter_parameters.rb#37 -ActionDispatch::Http::FilterParameters::NULL_ENV_FILTER = T.let(T.unsafe(nil), ActiveSupport::ParameterFilter) - -# source://actionpack//lib/action_dispatch/http/filter_parameters.rb#36 -ActionDispatch::Http::FilterParameters::NULL_PARAM_FILTER = T.let(T.unsafe(nil), ActiveSupport::ParameterFilter) - -# source://actionpack//lib/action_dispatch/http/filter_parameters.rb#82 -ActionDispatch::Http::FilterParameters::PAIR_RE = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/http/filter_redirect.rb#5 -module ActionDispatch::Http::FilterRedirect - # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#8 - def filtered_location; end - - private - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#25 - def location_filter_match?; end - - # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#17 - def location_filters; end -end - -# source://actionpack//lib/action_dispatch/http/filter_redirect.rb#6 -ActionDispatch::Http::FilterRedirect::FILTERED = T.let(T.unsafe(nil), String) - -# Provides access to the request's HTTP headers from the environment. -# -# env = { "CONTENT_TYPE" => "text/plain", "HTTP_USER_AGENT" => "curl/7.43.0" } -# headers = ActionDispatch::Http::Headers.from_hash(env) -# headers["Content-Type"] # => "text/plain" -# headers["User-Agent"] # => "curl/7.43.0" -# -# Also note that when headers are mapped to CGI-like variables by the Rack -# server, both dashes and underscores are converted to underscores. This -# ambiguity cannot be resolved at this stage anymore. Both underscores and -# dashes have to be interpreted as if they were originally sent as dashes. -# -# # GET / HTTP/1.1 -# # ... -# # User-Agent: curl/7.43.0 -# # X_Custom_Header: token -# -# headers["X_Custom_Header"] # => nil -# headers["X-Custom-Header"] # => "token" -# -# source://actionpack//lib/action_dispatch/http/headers.rb#24 -class ActionDispatch::Http::Headers - include ::Enumerable - - # @return [Headers] a new instance of Headers - # - # source://actionpack//lib/action_dispatch/http/headers.rb#54 - def initialize(request); end - - # Returns the value for the given key mapped to @env. - # - # source://actionpack//lib/action_dispatch/http/headers.rb#59 - def [](key); end - - # Sets the given value for the key mapped to @env. - # - # source://actionpack//lib/action_dispatch/http/headers.rb#64 - def []=(key, value); end - - # Add a value to a multivalued header like Vary or Accept-Encoding. - # - # source://actionpack//lib/action_dispatch/http/headers.rb#69 - def add(key, value); end - - # source://actionpack//lib/action_dispatch/http/headers.rb#95 - def each(&block); end - - # source://actionpack//lib/action_dispatch/http/headers.rb#116 - def env; end - - # Returns the value for the given key mapped to @env. - # - # If the key is not found and an optional code block is not provided, - # raises a KeyError exception. - # - # If the code block is provided, then it will be run and - # its result returned. - # - # source://actionpack//lib/action_dispatch/http/headers.rb#87 - def fetch(key, default = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/headers.rb#73 - def include?(key); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/headers.rb#73 - def key?(key); end - - # Returns a new Http::Headers instance containing the contents of - # headers_or_env and the original instance. - # - # source://actionpack//lib/action_dispatch/http/headers.rb#101 - def merge(headers_or_env); end - - # Adds the contents of headers_or_env to original instance - # entries; duplicate keys are overwritten with the values from - # headers_or_env. - # - # source://actionpack//lib/action_dispatch/http/headers.rb#110 - def merge!(headers_or_env); end - - private - - # Converts an HTTP header name to an environment variable name if it is - # not contained within the headers hash. - # - # source://actionpack//lib/action_dispatch/http/headers.rb#121 - def env_name(key); end - - class << self - # source://actionpack//lib/action_dispatch/http/headers.rb#50 - def from_hash(hash); end - end -end - -# source://actionpack//lib/action_dispatch/http/headers.rb#25 -ActionDispatch::Http::Headers::CGI_VARIABLES = T.let(T.unsafe(nil), Set) - -# source://actionpack//lib/action_dispatch/http/headers.rb#78 -ActionDispatch::Http::Headers::DEFAULT = T.let(T.unsafe(nil), Object) - -# source://actionpack//lib/action_dispatch/http/headers.rb#46 -ActionDispatch::Http::Headers::HTTP_HEADER = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#7 -module ActionDispatch::Http::MimeNegotiation - extend ::ActiveSupport::Concern - - # Returns the accepted MIME type for the request. - # - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#54 - def accepts; end - - # The MIME type of the HTTP request, such as Mime[:xml]. - # - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#23 - def content_mime_type; end - - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#36 - def content_type; end - - # Returns the MIME type for the \format used in the request. - # - # GET /posts/5.xml | request.format => Mime[:xml] - # GET /posts/5.xhtml | request.format => Mime[:html] - # GET /posts/5 | request.format => Mime[:html] or Mime[:js], or request.accepts.first - # - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#75 - def format(view_path = T.unsafe(nil)); end - - # Sets the \format by string extension, which can be used to force custom formats - # that are not controlled by the extension. - # - # class ApplicationController < ActionController::Base - # before_action :adjust_format_for_iphone - # - # private - # def adjust_format_for_iphone - # request.format = :iphone if request.env["HTTP_USER_AGENT"][/iPhone/] - # end - # end - # - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#127 - def format=(extension); end - - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#79 - def formats; end - - # Sets the \formats by string extensions. This differs from #format= by allowing you - # to set multiple, ordered formats, which is useful when you want to have a fallback. - # - # In this example, the +:iphone+ format will be used if it's available, otherwise it'll fallback - # to the +:html+ format. - # - # class ApplicationController < ActionController::Base - # before_action :adjust_format_for_iphone_with_html_fallback - # - # private - # def adjust_format_for_iphone_with_html_fallback - # request.formats = [ :iphone, :html ] if request.env["HTTP_USER_AGENT"][/iPhone/] - # end - # end - # - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#146 - def formats=(extensions); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#49 - def has_content_type?; end - - # Returns the first MIME type that matches the provided array of MIME types. - # - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#154 - def negotiate_mime(order); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#166 - def should_apply_vary_header?; end - - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#112 - def variant; end - - # Sets the \variant for template. - # - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#102 - def variant=(variant); end - - private - - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#190 - def format_from_path_extension; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#175 - def params_readable?; end - - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#186 - def use_accept_header; end - - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#181 - def valid_accept_header; end -end - -# We use normal content negotiation unless you include */* in your list, -# in which case we assume you're a browser and send HTML. -# -# source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#173 -ActionDispatch::Http::MimeNegotiation::BROWSER_LIKE_ACCEPTS = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#10 -class ActionDispatch::Http::MimeNegotiation::InvalidType < ::Mime::Type::InvalidMimeType; end - -# source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#12 -ActionDispatch::Http::MimeNegotiation::RESCUABLE_MIME_FORMAT_ERRORS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/http/parameters.rb#5 -module ActionDispatch::Http::Parameters - extend ::ActiveSupport::Concern - - mixes_in_class_methods ::ActionDispatch::Http::Parameters::ClassMethods - - # Returns both GET and POST \parameters in a single hash. - # - # source://actionpack//lib/action_dispatch/http/parameters.rb#50 - def parameters; end - - # Returns both GET and POST \parameters in a single hash. - # - # source://actionpack//lib/action_dispatch/http/parameters.rb#50 - def params; end - - # Returns a hash with the \parameters used to form the \path of the request. - # Returned hash keys are strings: - # - # { action: "my_action", controller: "my_controller" } - # - # source://actionpack//lib/action_dispatch/http/parameters.rb#82 - def path_parameters; end - - # source://actionpack//lib/action_dispatch/http/parameters.rb#65 - def path_parameters=(parameters); end - - private - - # source://actionpack//lib/action_dispatch/http/parameters.rb#100 - def log_parse_error_once; end - - # source://actionpack//lib/action_dispatch/http/parameters.rb#112 - def params_parsers; end - - # source://actionpack//lib/action_dispatch/http/parameters.rb#87 - def parse_formatted_parameters(parsers); end -end - -# source://actionpack//lib/action_dispatch/http/parameters.rb#34 -module ActionDispatch::Http::Parameters::ClassMethods - # Configure the parameter parser for a given MIME type. - # - # It accepts a hash where the key is the symbol of the MIME type - # and the value is a proc. - # - # original_parsers = ActionDispatch::Request.parameter_parsers - # xml_parser = -> (raw_post) { Hash.from_xml(raw_post) || {} } - # new_parsers = original_parsers.merge(xml: xml_parser) - # ActionDispatch::Request.parameter_parsers = new_parsers - # - # source://actionpack//lib/action_dispatch/http/parameters.rb#44 - def parameter_parsers=(parsers); end -end - -# source://actionpack//lib/action_dispatch/http/parameters.rb#10 -ActionDispatch::Http::Parameters::DEFAULT_PARSERS = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_dispatch/http/parameters.rb#8 -ActionDispatch::Http::Parameters::PARAMETERS_KEY = T.let(T.unsafe(nil), String) - -# Raised when raw data from the request cannot be parsed by the parser -# defined for request's content MIME type. -# -# source://actionpack//lib/action_dispatch/http/parameters.rb#19 -class ActionDispatch::Http::Parameters::ParseError < ::StandardError - # @return [ParseError] a new instance of ParseError - # - # source://actionpack//lib/action_dispatch/http/parameters.rb#20 - def initialize(message = T.unsafe(nil)); end -end - -# source://actionpack//lib/action_dispatch/http/url.rb#7 -module ActionDispatch::Http::URL - # source://actionpack//lib/action_dispatch/http/url.rb#179 - def initialize; end - - # Returns the \domain part of a \host, such as "rubyonrails.org" in "www.rubyonrails.org". You can specify - # a different tld_length, such as 2 to catch rubyonrails.co.uk in "www.rubyonrails.co.uk". - # - # source://actionpack//lib/action_dispatch/http/url.rb#321 - def domain(tld_length = T.unsafe(nil)); end - - # Returns the host for this request, such as "example.com". - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' - # req.host # => "example.com" - # - # source://actionpack//lib/action_dispatch/http/url.rb#226 - def host; end - - # Returns a \host:\port string for this request, such as "example.com" or - # "example.com:8080". Port is only included if it is not a default port - # (80 or 443) - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' - # req.host_with_port # => "example.com" - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' - # req.host_with_port # => "example.com" - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' - # req.host_with_port # => "example.com:8080" - # - # source://actionpack//lib/action_dispatch/http/url.rb#242 - def host_with_port; end - - # Returns a number \port suffix like 8080 if the \port number of this request - # is not the default HTTP \port 80 or HTTPS \port 443. - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' - # req.optional_port # => nil - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' - # req.optional_port # => 8080 - # - # source://actionpack//lib/action_dispatch/http/url.rb#292 - def optional_port; end - - # Returns the port number of this request as an integer. - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' - # req.port # => 80 - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' - # req.port # => 8080 - # - # source://actionpack//lib/action_dispatch/http/url.rb#253 - def port; end - - # Returns a string \port suffix, including colon, like ":8080" if the \port - # number of this request is not the default HTTP \port 80 or HTTPS \port 443. - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' - # req.port_string # => "" - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' - # req.port_string # => ":8080" - # - # source://actionpack//lib/action_dispatch/http/url.rb#304 - def port_string; end - - # Returns 'https://' if this is an SSL request and 'http://' otherwise. - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' - # req.protocol # => "http://" - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com', 'HTTPS' => 'on' - # req.protocol # => "https://" - # - # source://actionpack//lib/action_dispatch/http/url.rb#200 - def protocol; end - - # Returns the \host and port for this request, such as "example.com:8080". - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' - # req.raw_host_with_port # => "example.com" - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' - # req.raw_host_with_port # => "example.com:80" - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' - # req.raw_host_with_port # => "example.com:8080" - # - # source://actionpack//lib/action_dispatch/http/url.rb#214 - def raw_host_with_port; end - - # source://actionpack//lib/action_dispatch/http/url.rb#12 - def secure_protocol; end - - # source://actionpack//lib/action_dispatch/http/url.rb#12 - def secure_protocol=(val); end - - # Returns the requested port, such as 8080, based on SERVER_PORT - # - # req = ActionDispatch::Request.new 'SERVER_PORT' => '80' - # req.server_port # => 80 - # - # req = ActionDispatch::Request.new 'SERVER_PORT' => '8080' - # req.server_port # => 8080 - # - # source://actionpack//lib/action_dispatch/http/url.rb#315 - def server_port; end - - # Returns the standard \port number for this request's protocol. - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' - # req.standard_port # => 80 - # - # source://actionpack//lib/action_dispatch/http/url.rb#265 - def standard_port; end - - # Returns whether this request is using the standard port - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' - # req.standard_port? # => true - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' - # req.standard_port? # => false - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/url.rb#280 - def standard_port?; end - - # Returns all the \subdomains as a string, so "dev.www" would be - # returned for "dev.www.rubyonrails.org". You can specify a different tld_length, - # such as 2 to catch "www" instead of "www.rubyonrails" - # in "www.rubyonrails.co.uk". - # - # source://actionpack//lib/action_dispatch/http/url.rb#337 - def subdomain(tld_length = T.unsafe(nil)); end - - # Returns all the \subdomains as an array, so ["dev", "www"] would be - # returned for "dev.www.rubyonrails.org". You can specify a different tld_length, - # such as 2 to catch ["www"] instead of ["www", "rubyonrails"] - # in "www.rubyonrails.co.uk". - # - # source://actionpack//lib/action_dispatch/http/url.rb#329 - def subdomains(tld_length = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/http/url.rb#13 - def tld_length; end - - # source://actionpack//lib/action_dispatch/http/url.rb#13 - def tld_length=(val); end - - # Returns the complete URL used for this request. - # - # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' - # req.url # => "http://example.com" - # - # source://actionpack//lib/action_dispatch/http/url.rb#189 - def url; end - - class << self - # Returns the domain part of a host given the domain level. - # - # # Top-level domain example - # extract_domain('www.example.com', 1) # => "example.com" - # # Second-level domain example - # extract_domain('dev.www.example.co.uk', 2) # => "example.co.uk" - # - # source://actionpack//lib/action_dispatch/http/url.rb#22 - def extract_domain(host, tld_length); end - - # Returns the subdomains of a host as a String given the domain level. - # - # # Top-level domain example - # extract_subdomain('www.example.com', 1) # => "www" - # # Second-level domain example - # extract_subdomain('dev.www.example.co.uk', 2) # => "dev.www" - # - # source://actionpack//lib/action_dispatch/http/url.rb#46 - def extract_subdomain(host, tld_length); end - - # Returns the subdomains of a host as an Array given the domain level. - # - # # Top-level domain example - # extract_subdomains('www.example.com', 1) # => ["www"] - # # Second-level domain example - # extract_subdomains('dev.www.example.co.uk', 2) # => ["dev", "www"] - # - # source://actionpack//lib/action_dispatch/http/url.rb#32 - def extract_subdomains(host, tld_length); end - - # source://actionpack//lib/action_dispatch/http/url.rb#58 - def full_url_for(options); end - - # source://actionpack//lib/action_dispatch/http/url.rb#70 - def path_for(options); end - - # source://actionpack//lib/action_dispatch/http/url.rb#12 - def secure_protocol; end - - # source://actionpack//lib/action_dispatch/http/url.rb#12 - def secure_protocol=(val); end - - # source://actionpack//lib/action_dispatch/http/url.rb#13 - def tld_length; end - - # source://actionpack//lib/action_dispatch/http/url.rb#13 - def tld_length=(val); end - - # source://actionpack//lib/action_dispatch/http/url.rb#50 - def url_for(options); end - - private - - # source://actionpack//lib/action_dispatch/http/url.rb#90 - def add_anchor(path, anchor); end - - # source://actionpack//lib/action_dispatch/http/url.rb#83 - def add_params(path, params); end - - # source://actionpack//lib/action_dispatch/http/url.rb#105 - def build_host_url(host, port, protocol, options, path); end - - # source://actionpack//lib/action_dispatch/http/url.rb#96 - def extract_domain_from(host, tld_length); end - - # source://actionpack//lib/action_dispatch/http/url.rb#100 - def extract_subdomains_from(host, tld_length); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/url.rb#129 - def named_host?(host); end - - # source://actionpack//lib/action_dispatch/http/url.rb#146 - def normalize_host(_host, options); end - - # source://actionpack//lib/action_dispatch/http/url.rb#166 - def normalize_port(port, protocol); end - - # source://actionpack//lib/action_dispatch/http/url.rb#133 - def normalize_protocol(protocol); end - end -end - -# source://actionpack//lib/action_dispatch/http/url.rb#9 -ActionDispatch::Http::URL::HOST_REGEXP = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/http/url.rb#8 -ActionDispatch::Http::URL::IP_HOST_REGEXP = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/http/url.rb#10 -ActionDispatch::Http::URL::PROTOCOL_REGEXP = T.let(T.unsafe(nil), Regexp) - -# Models uploaded files. -# -# The actual file is accessible via the +tempfile+ accessor, though some -# of its interface is available directly for convenience. -# -# Uploaded files are temporary files whose lifespan is one request. When -# the object is finalized Ruby unlinks the file, so there is no need to -# clean them with a separate maintenance task. -# -# source://actionpack//lib/action_dispatch/http/upload.rb#13 -class ActionDispatch::Http::UploadedFile - # @raise [ArgumentError] - # @return [UploadedFile] a new instance of UploadedFile - # - # source://actionpack//lib/action_dispatch/http/upload.rb#27 - def initialize(hash); end - - # Shortcut for +tempfile.close+. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#58 - def close(unlink_now = T.unsafe(nil)); end - - # A string with the MIME type of the file. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#18 - def content_type; end - - # A string with the MIME type of the file. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#18 - def content_type=(_arg0); end - - # Shortcut for +tempfile.eof?+. - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/upload.rb#83 - def eof?; end - - # A string with the headers of the multipart request. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#25 - def headers; end - - # A string with the headers of the multipart request. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#25 - def headers=(_arg0); end - - # Shortcut for +tempfile.open+. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#53 - def open; end - - # The basename of the file in the client. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#15 - def original_filename; end - - # The basename of the file in the client. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#15 - def original_filename=(_arg0); end - - # Shortcut for +tempfile.path+. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#63 - def path; end - - # Shortcut for +tempfile.read+. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#48 - def read(length = T.unsafe(nil), buffer = T.unsafe(nil)); end - - # Shortcut for +tempfile.rewind+. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#73 - def rewind; end - - # Shortcut for +tempfile.size+. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#78 - def size; end - - # A +Tempfile+ object with the actual uploaded file. Note that some of - # its interface is available directly. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#22 - def tempfile; end - - # A +Tempfile+ object with the actual uploaded file. Note that some of - # its interface is available directly. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#22 - def tempfile=(_arg0); end - - # source://actionpack//lib/action_dispatch/http/upload.rb#87 - def to_io; end - - # Shortcut for +tempfile.to_path+. - # - # source://actionpack//lib/action_dispatch/http/upload.rb#68 - def to_path; end -end - -# source://actionpack//lib/action_dispatch.rb#40 -class ActionDispatch::IllegalStateError < ::StandardError; end - -# source://actionpack//lib/action_dispatch/testing/integration.rb#11 -module ActionDispatch::Integration; end - -# source://actionpack//lib/action_dispatch/testing/integration.rb#12 -module ActionDispatch::Integration::RequestHelpers - # Performs a DELETE request with the given parameters. See ActionDispatch::Integration::Session#process - # for more details. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#39 - def delete(path, **args); end - - # Follow a single redirect response. If the last response was not a - # redirect, an exception will be raised. Otherwise, the redirect is - # performed on the location header. If the redirection is a 307 or 308 redirect, - # the same HTTP verb will be used when redirecting, otherwise a GET request - # will be performed. Any arguments are passed to the - # underlying request. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#61 - def follow_redirect!(**args); end - - # Performs a GET request with the given parameters. See ActionDispatch::Integration::Session#process - # for more details. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#15 - def get(path, **args); end - - # Performs a HEAD request with the given parameters. See ActionDispatch::Integration::Session#process - # for more details. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#45 - def head(path, **args); end - - # Performs an OPTIONS request with the given parameters. See ActionDispatch::Integration::Session#process - # for more details. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#51 - def options(path, **args); end - - # Performs a PATCH request with the given parameters. See ActionDispatch::Integration::Session#process - # for more details. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#27 - def patch(path, **args); end - - # Performs a POST request with the given parameters. See ActionDispatch::Integration::Session#process - # for more details. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#21 - def post(path, **args); end - - # Performs a PUT request with the given parameters. See ActionDispatch::Integration::Session#process - # for more details. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#33 - def put(path, **args); end -end - -# source://actionpack//lib/action_dispatch/testing/integration.rb#316 -module ActionDispatch::Integration::Runner - include ::ActionDispatch::Assertions::ResponseAssertions - include ::ActionDispatch::Assertions::RoutingAssertions - include ::Rails::Dom::Testing::Assertions::DomAssertions - include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable - include ::Rails::Dom::Testing::Assertions::SelectorAssertions - include ::Rails::Dom::Testing::Assertions - include ::ActionDispatch::Assertions - - # source://actionpack//lib/action_dispatch/testing/integration.rb#324 - def initialize(*args, &blk); end - - # Returns the value of attribute app. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#321 - def app; end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#395 - def assertions; end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#399 - def assertions=(assertions); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#367 - def assigns(*_arg0, &_arg1); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#329 - def before_setup; end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#367 - def cookies(*_arg0, &_arg1); end - - # Copy the instance variables from the current session instance into the - # test instance. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#405 - def copy_session_variables!; end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#344 - def create_session(app); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#411 - def default_url_options; end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#415 - def default_url_options=(options); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#367 - def delete(*_arg0, &_arg1); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#367 - def follow_redirect!(*_arg0, &_arg1); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#367 - def get(*_arg0, &_arg1); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#367 - def head(*_arg0, &_arg1); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#334 - def integration_session; end - - # Open a new session instance. If a block is given, the new session is - # yielded to the block before being returned. - # - # session = open_session do |sess| - # sess.extend(CustomAssertions) - # end - # - # By default, a single session is automatically created for you, but you - # can use this method to open multiple sessions that ought to be tested - # simultaneously. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#387 - def open_session; end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#367 - def patch(*_arg0, &_arg1); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#367 - def post(*_arg0, &_arg1); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#367 - def put(*_arg0, &_arg1); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#356 - def remove!; end - - # Reset the current session. This is useful for testing multiple sessions - # in a single test case. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#340 - def reset!; end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#322 - def root_session; end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#322 - def root_session=(_arg0); end - - private - - # Delegate unhandled messages to the current session instance. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#425 - def method_missing(method, *args, &block); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#420 - def respond_to_missing?(method, _); end -end - -# source://actionpack//lib/action_dispatch/testing/integration.rb#319 -ActionDispatch::Integration::Runner::APP_SESSIONS = T.let(T.unsafe(nil), Hash) - -# An instance of this class represents a set of requests and responses -# performed sequentially by a test process. Because you can instantiate -# multiple sessions and run them side-by-side, you can also mimic (to some -# limited extent) multiple simultaneous users interacting with your system. -# -# Typically, you will instantiate a new session using -# IntegrationTest#open_session, rather than instantiating -# Integration::Session directly. -# -# source://actionpack//lib/action_dispatch/testing/integration.rb#84 -class ActionDispatch::Integration::Session - include ::Minitest::Assertions - include ::ActionDispatch::Assertions::ResponseAssertions - include ::ActionDispatch::Assertions::RoutingAssertions - include ::Rails::Dom::Testing::Assertions::DomAssertions - include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable - include ::Rails::Dom::Testing::Assertions::SelectorAssertions - include ::Rails::Dom::Testing::Assertions - include ::ActionDispatch::Assertions - include ::ActionDispatch::Integration::RequestHelpers - include ::ActionDispatch::TestProcess::FixtureFile - include ::ActionDispatch::TestProcess - include ::ActionDispatch::Routing::PolymorphicRoutes - include ::ActionDispatch::Routing::UrlFor - - # Create and initialize a new Session instance. - # - # @return [Session] a new instance of Session - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#126 - def initialize(app); end - - # The Accept header to send. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#103 - def accept; end - - # The Accept header to send. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#103 - def accept=(_arg0); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#90 - def body(*_arg0, &_arg1); end - - # A reference to the controller instance used by the last request. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#112 - def controller; end - - # A map of the cookies returned by the last response, and which will be - # sent with the next request. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#107 - def cookies; end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options; end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options=(_arg0); end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options?; end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#90 - def headers(*_arg0, &_arg1); end - - # The hostname used in the last request. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#94 - def host; end - - # Sets the attribute host - # Set the host name to use in the next request. - # - # session.host! "www.example.com" - # - # @param value the value to set the attribute host to. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#97 - def host!(_arg0); end - - # Sets the attribute host - # - # @param value the value to set the attribute host to. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#97 - def host=(_arg0); end - - # Specify whether or not the session should mimic a secure HTTPS request. - # - # session.https! - # session.https!(false) - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#174 - def https!(flag = T.unsafe(nil)); end - - # Returns +true+ if the session is mimicking a secure HTTPS request. - # - # if session.https? - # ... - # end - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#183 - def https?; end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#91 - def path(*_arg0, &_arg1); end - - # Performs the actual request. - # - # - +method+: The HTTP method (GET, POST, PATCH, PUT, DELETE, HEAD, OPTIONS) - # as a symbol. - # - +path+: The URI (as a String) on which you want to perform the - # request. - # - +params+: The HTTP parameters that you want to pass. This may - # be +nil+, - # a Hash, or a String that is appropriately encoded - # (application/x-www-form-urlencoded or - # multipart/form-data). - # - +headers+: Additional headers to pass, as a Hash. The headers will be - # merged into the Rack env hash. - # - +env+: Additional env to pass, as a Hash. The headers will be - # merged into the Rack env hash. - # - +xhr+: Set to +true+ if you want to make an Ajax request. - # Adds request headers characteristic of XMLHttpRequest e.g. HTTP_X_REQUESTED_WITH. - # The headers will be merged into the Rack env hash. - # - +as+: Used for encoding the request with different content type. - # Supports +:json+ by default and will set the appropriate request headers. - # The headers will be merged into the Rack env hash. - # - # This method is rarely used directly. Use +#get+, +#post+, or other standard - # HTTP methods in integration tests. +#process+ is only required when using a - # request method that doesn't have a method defined in the integration tests. - # - # This method returns the response status, after performing the request. - # Furthermore, if this method was called from an ActionDispatch::IntegrationTest object, - # then that object's @response instance variable will point to a Response object - # which one can use to inspect the details of the response. - # - # Example: - # process :get, '/author', params: { since: 201501011400 } - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#220 - def process(method, path, params: T.unsafe(nil), headers: T.unsafe(nil), env: T.unsafe(nil), xhr: T.unsafe(nil), as: T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#90 - def redirect?(*_arg0, &_arg1); end - - # The remote_addr used in the last request. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#100 - def remote_addr; end - - # The remote_addr used in the last request. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#100 - def remote_addr=(_arg0); end - - # A reference to the request instance used by the last request. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#115 - def request; end - - # A running counter of the number of requests processed. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#121 - def request_count; end - - # A running counter of the number of requests processed. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#121 - def request_count=(_arg0); end - - # Resets the instance. This can be used to reset the state information - # in an existing session instance, so it can be used from a clean-slate - # condition. - # - # session.reset! - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#150 - def reset!; end - - # A reference to the response instance used by the last request. - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#118 - def response; end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#90 - def status(*_arg0, &_arg1); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#90 - def status_message(*_arg0, &_arg1); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#133 - def url_options; end - - private - - # source://actionpack//lib/action_dispatch/testing/integration.rb#300 - def _mock_session; end - - # @yield [location] - # - # source://actionpack//lib/action_dispatch/testing/integration.rb#308 - def build_expanded_path(path); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#304 - def build_full_uri(path, env); end - - class << self - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options; end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options=(value); end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options?; end - end -end - -# source://actionpack//lib/action_dispatch/testing/integration.rb#85 -ActionDispatch::Integration::Session::DEFAULT_HOST = T.let(T.unsafe(nil), String) - -# An integration test spans multiple controllers and actions, -# tying them all together to ensure they work together as expected. It tests -# more completely than either unit or functional tests do, exercising the -# entire stack, from the dispatcher to the database. -# -# At its simplest, you simply extend IntegrationTest and write your tests -# using the get/post methods: -# -# require "test_helper" -# -# class ExampleTest < ActionDispatch::IntegrationTest -# fixtures :people -# -# def test_login -# # get the login page -# get "/login" -# assert_equal 200, status -# -# # post the login and follow through to the home page -# post "/login", params: { username: people(:jamis).username, -# password: people(:jamis).password } -# follow_redirect! -# assert_equal 200, status -# assert_equal "/home", path -# end -# end -# -# However, you can also have multiple session instances open per test, and -# even extend those instances with assertions and methods to create a very -# powerful testing DSL that is specific for your application. You can even -# reference any named routes you happen to have defined. -# -# require "test_helper" -# -# class AdvancedTest < ActionDispatch::IntegrationTest -# fixtures :people, :rooms -# -# def test_login_and_speak -# jamis, david = login(:jamis), login(:david) -# room = rooms(:office) -# -# jamis.enter(room) -# jamis.speak(room, "anybody home?") -# -# david.enter(room) -# david.speak(room, "hello!") -# end -# -# private -# -# module CustomAssertions -# def enter(room) -# # reference a named route, for maximum internal consistency! -# get(room_url(id: room.id)) -# assert(...) -# ... -# end -# -# def speak(room, message) -# post "/say/#{room.id}", xhr: true, params: { message: message } -# assert(...) -# ... -# end -# end -# -# def login(who) -# open_session do |sess| -# sess.extend(CustomAssertions) -# who = people(who) -# sess.post "/login", params: { username: who.username, -# password: who.password } -# assert(...) -# end -# end -# end -# -# Another longer example would be: -# -# A simple integration test that exercises multiple controllers: -# -# require "test_helper" -# -# class UserFlowsTest < ActionDispatch::IntegrationTest -# test "login and browse site" do -# # login via https -# https! -# get "/login" -# assert_response :success -# -# post "/login", params: { username: users(:david).username, password: users(:david).password } -# follow_redirect! -# assert_equal '/welcome', path -# assert_equal 'Welcome david!', flash[:notice] -# -# https!(false) -# get "/articles/all" -# assert_response :success -# assert_select 'h1', 'Articles' -# end -# end -# -# As you can see the integration test involves multiple controllers and -# exercises the entire stack from database to dispatcher. In addition you can -# have multiple session instances open simultaneously in a test and extend -# those instances with assertion methods to create a very powerful testing -# DSL (domain-specific language) just for your application. -# -# Here's an example of multiple sessions and custom DSL in an integration test -# -# require "test_helper" -# -# class UserFlowsTest < ActionDispatch::IntegrationTest -# test "login and browse site" do -# # User david logs in -# david = login(:david) -# # User guest logs in -# guest = login(:guest) -# -# # Both are now available in different sessions -# assert_equal 'Welcome david!', david.flash[:notice] -# assert_equal 'Welcome guest!', guest.flash[:notice] -# -# # User david can browse site -# david.browses_site -# # User guest can browse site as well -# guest.browses_site -# -# # Continue with other assertions -# end -# -# private -# -# module CustomDsl -# def browses_site -# get "/products/all" -# assert_response :success -# assert_select 'h1', 'Products' -# end -# end -# -# def login(user) -# open_session do |sess| -# sess.extend(CustomDsl) -# u = users(user) -# sess.https! -# sess.post "/login", params: { username: u.username, password: u.password } -# assert_equal '/welcome', sess.path -# sess.https!(false) -# end -# end -# end -# -# See the {request helpers documentation}[rdoc-ref:ActionDispatch::Integration::RequestHelpers] for help on how to -# use +get+, etc. -# -# === Changing the request encoding -# -# You can also test your JSON API easily by setting what the request should -# be encoded as: -# -# require "test_helper" -# -# class ApiTest < ActionDispatch::IntegrationTest -# test "creates articles" do -# assert_difference -> { Article.count } do -# post articles_path, params: { article: { title: "Ahoy!" } }, as: :json -# end -# -# assert_response :success -# assert_equal({ id: Article.last.id, title: "Ahoy!" }, response.parsed_body) -# end -# end -# -# The +as+ option passes an "application/json" Accept header (thereby setting -# the request format to JSON unless overridden), sets the content type to -# "application/json" and encodes the parameters as JSON. -# -# Calling +parsed_body+ on the response parses the response body based on the -# last response MIME type. -# -# Out of the box, only :json is supported. But for any custom MIME -# types you've registered, you can add your own encoders with: -# -# ActionDispatch::IntegrationTest.register_encoder :wibble, -# param_encoder: -> params { params.to_wibble }, -# response_parser: -> body { body } -# -# Where +param_encoder+ defines how the params should be encoded and -# +response_parser+ defines how the response body should be parsed through -# +parsed_body+. -# -# Consult the Rails Testing Guide for more. -# -# source://actionpack//lib/action_dispatch/testing/integration.rb#631 -class ActionDispatch::IntegrationTest < ::ActiveSupport::TestCase - include ::ActionDispatch::TestProcess::FixtureFile - include ::ActionDispatch::Assertions::ResponseAssertions - include ::ActionDispatch::Assertions::RoutingAssertions - include ::Rails::Dom::Testing::Assertions::DomAssertions - include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable - include ::Rails::Dom::Testing::Assertions::SelectorAssertions - include ::Rails::Dom::Testing::Assertions - include ::ActionDispatch::Assertions - include ::ActionDispatch::Integration::Runner - include ::ActionController::TemplateAssertions - include ::ActionDispatch::IntegrationTest::Behavior - include ::ActionDispatch::Routing::PolymorphicRoutes - include ::ActionDispatch::Routing::UrlFor - include ::ActionDispatch::IntegrationTest::UrlOptions - extend ::ActionDispatch::IntegrationTest::Behavior::ClassMethods -end - -# source://actionpack//lib/action_dispatch/testing/integration.rb#641 -module ActionDispatch::IntegrationTest::Behavior - include ::ActionDispatch::Assertions::ResponseAssertions - include ::ActionDispatch::Assertions::RoutingAssertions - include ::Rails::Dom::Testing::Assertions::DomAssertions - include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable - include ::Rails::Dom::Testing::Assertions::SelectorAssertions - include ::Rails::Dom::Testing::Assertions - include ::ActionDispatch::Assertions - include ::ActionDispatch::Integration::Runner - include ::ActionController::TemplateAssertions - extend ::ActiveSupport::Concern - include ::ActionDispatch::Routing::UrlFor - include ::ActionDispatch::IntegrationTest::UrlOptions - - mixes_in_class_methods ::ActionDispatch::IntegrationTest::Behavior::ClassMethods - - # source://actionpack//lib/action_dispatch/testing/integration.rb#672 - def app; end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#676 - def document_root_element; end -end - -# source://actionpack//lib/action_dispatch/testing/integration.rb#654 -module ActionDispatch::IntegrationTest::Behavior::ClassMethods - # source://actionpack//lib/action_dispatch/testing/integration.rb#655 - def app; end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#663 - def app=(app); end - - # source://actionpack//lib/action_dispatch/testing/integration.rb#667 - def register_encoder(*args, **options); end -end - -# source://actionpack//lib/action_dispatch/testing/integration.rb#634 -module ActionDispatch::IntegrationTest::UrlOptions - extend ::ActiveSupport::Concern - - # source://actionpack//lib/action_dispatch/testing/integration.rb#636 - def url_options; end -end - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#4 -module ActionDispatch::Journey; end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#7 -class ActionDispatch::Journey::Ast - # @return [Ast] a new instance of Ast - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#11 - def initialize(tree, formatted); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#37 - def glob?; end - - # Returns the value of attribute names. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#8 - def names; end - - # Returns the value of attribute path_params. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#8 - def path_params; end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#23 - def requirements=(requirements); end - - # Returns the value of attribute tree. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#8 - def root; end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#33 - def route=(route); end - - # Returns the value of attribute terminals. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#8 - def terminals; end - - # Returns the value of attribute tree. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#8 - def tree; end - - # Returns the value of attribute wildcard_options. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#8 - def wildcard_options; end - - private - - # Returns the value of attribute stars. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#42 - def stars; end - - # Returns the value of attribute symbols. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#42 - def symbols; end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#44 - def visit_tree(formatted); end -end - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#6 -class ActionDispatch::Journey::Format - # @return [Format] a new instance of Format - # - # source://actionpack//lib/action_dispatch/journey/visitors.rb#22 - def initialize(parts); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#37 - def evaluate(hash); end - - class << self - # source://actionpack//lib/action_dispatch/journey/visitors.rb#14 - def required_path(symbol); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#18 - def required_segment(symbol); end - end -end - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#7 -ActionDispatch::Journey::Format::ESCAPE_PATH = T.let(T.unsafe(nil), Proc) - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#8 -ActionDispatch::Journey::Format::ESCAPE_SEGMENT = T.let(T.unsafe(nil), Proc) - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#10 -class ActionDispatch::Journey::Format::Parameter < ::Struct - # source://actionpack//lib/action_dispatch/journey/visitors.rb#11 - def escape(value); end - - # Returns the value of attribute escaper - # - # @return [Object] the current value of escaper - def escaper; end - - # Sets the attribute escaper - # - # @param value [Object] the value to set the attribute escaper to. - # @return [Object] the newly set value - # - # source://actionpack//lib/action_dispatch/journey/visitors.rb#10 - def escaper=(_); end - - # Returns the value of attribute name - # - # @return [Object] the current value of name - def name; end - - # Sets the attribute name - # - # @param value [Object] the value to set the attribute name to. - # @return [Object] the newly set value - # - # source://actionpack//lib/action_dispatch/journey/visitors.rb#10 - def name=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def members; end - def new(*_arg0); end - end -end - -# The Formatter class is used for formatting URLs. For example, parameters -# passed to +url_for+ in Rails will eventually call Formatter#generate. -# -# source://actionpack//lib/action_dispatch/journey/formatter.rb#10 -class ActionDispatch::Journey::Formatter - # @return [Formatter] a new instance of Formatter - # - # source://actionpack//lib/action_dispatch/journey/formatter.rb#13 - def initialize(routes); end - - # source://actionpack//lib/action_dispatch/journey/formatter.rb#97 - def clear; end - - # source://actionpack//lib/action_dispatch/journey/formatter.rb#59 - def generate(name, options, path_parameters); end - - # Returns the value of attribute routes. - # - # source://actionpack//lib/action_dispatch/journey/formatter.rb#11 - def routes; end - - private - - # source://actionpack//lib/action_dispatch/journey/formatter.rb#196 - def build_cache; end - - # source://actionpack//lib/action_dispatch/journey/formatter.rb#207 - def cache; end - - # source://actionpack//lib/action_dispatch/journey/formatter.rb#102 - def extract_parameterized_parts(route, options, recall); end - - # source://actionpack//lib/action_dispatch/journey/formatter.rb#129 - def match_route(name, options); end - - # Returns an array populated with missing keys if any are present. - # - # source://actionpack//lib/action_dispatch/journey/formatter.rb#168 - def missing_keys(route, parts); end - - # source://actionpack//lib/action_dispatch/journey/formatter.rb#125 - def named_routes; end - - # source://actionpack//lib/action_dispatch/journey/formatter.rb#151 - def non_recursive(cache, options); end - - # source://actionpack//lib/action_dispatch/journey/formatter.rb#188 - def possibles(cache, options, depth = T.unsafe(nil)); end -end - -# source://actionpack//lib/action_dispatch/journey/formatter.rb#32 -class ActionDispatch::Journey::Formatter::MissingRoute - # @return [MissingRoute] a new instance of MissingRoute - # - # source://actionpack//lib/action_dispatch/journey/formatter.rb#35 - def initialize(constraints, missing_keys, unmatched_keys, routes, name); end - - # Returns the value of attribute constraints. - # - # source://actionpack//lib/action_dispatch/journey/formatter.rb#33 - def constraints; end - - # source://actionpack//lib/action_dispatch/journey/formatter.rb#51 - def message; end - - # Returns the value of attribute missing_keys. - # - # source://actionpack//lib/action_dispatch/journey/formatter.rb#33 - def missing_keys; end - - # Returns the value of attribute name. - # - # source://actionpack//lib/action_dispatch/journey/formatter.rb#33 - def name; end - - # source://actionpack//lib/action_dispatch/journey/formatter.rb#47 - def params; end - - # @raise [ActionController::UrlGenerationError] - # - # source://actionpack//lib/action_dispatch/journey/formatter.rb#43 - def path(method_name); end - - # Returns the value of attribute routes. - # - # source://actionpack//lib/action_dispatch/journey/formatter.rb#33 - def routes; end - - # Returns the value of attribute unmatched_keys. - # - # source://actionpack//lib/action_dispatch/journey/formatter.rb#33 - def unmatched_keys; end -end - -# source://actionpack//lib/action_dispatch/journey/formatter.rb#18 -class ActionDispatch::Journey::Formatter::RouteWithParams - # @return [RouteWithParams] a new instance of RouteWithParams - # - # source://actionpack//lib/action_dispatch/journey/formatter.rb#21 - def initialize(route, parameterized_parts, params); end - - # Returns the value of attribute params. - # - # source://actionpack//lib/action_dispatch/journey/formatter.rb#19 - def params; end - - # source://actionpack//lib/action_dispatch/journey/formatter.rb#27 - def path(_); end -end - -# source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#7 -module ActionDispatch::Journey::GTG; end - -# source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#8 -class ActionDispatch::Journey::GTG::Builder - # @return [Builder] a new instance of Builder - # - # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#13 - def initialize(root); end - - # Returns the value of attribute ast. - # - # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#11 - def ast; end - - # Returns the value of attribute endpoints. - # - # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#11 - def endpoints; end - - # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#86 - def firstpos(node); end - - # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#107 - def lastpos(node); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#64 - def nullable?(node); end - - # Returns the value of attribute root. - # - # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#11 - def root; end - - # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#19 - def transition_table; end - - private - - # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#129 - def build_followpos; end - - # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#142 - def symbol(edge); end -end - -# source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#9 -ActionDispatch::Journey::GTG::Builder::DUMMY_END_NODE = T.let(T.unsafe(nil), ActionDispatch::Journey::Nodes::Dummy) - -# source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#8 -class ActionDispatch::Journey::GTG::MatchData - # @return [MatchData] a new instance of MatchData - # - # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#11 - def initialize(memos); end - - # Returns the value of attribute memos. - # - # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#9 - def memos; end -end - -# source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#16 -class ActionDispatch::Journey::GTG::Simulator - # @return [Simulator] a new instance of Simulator - # - # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#21 - def initialize(transition_table); end - - # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#25 - def memos(string); end - - # Returns the value of attribute tt. - # - # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#19 - def tt; end -end - -# source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#17 -ActionDispatch::Journey::GTG::Simulator::INITIAL_STATE = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#8 -class ActionDispatch::Journey::GTG::TransitionTable - include ::ActionDispatch::Journey::NFA::Dot - - # @return [TransitionTable] a new instance of TransitionTable - # - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#16 - def initialize; end - - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#163 - def []=(from, to, sym); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#32 - def accepting?(state); end - - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#28 - def accepting_states; end - - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#24 - def add_accepting(state); end - - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#36 - def add_memo(idx, memo); end - - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#98 - def as_json(options = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#44 - def eclosure(t); end - - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#40 - def memo(idx); end - - # Returns the value of attribute memos. - # - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#11 - def memos; end - - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#48 - def move(t, full_string, start_index, end_index); end - - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#180 - def states; end - - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#115 - def to_svg; end - - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#187 - def transitions; end - - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#125 - def visualizer(paths, title = T.unsafe(nil)); end - - private - - # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#198 - def states_hash_for(sym); end -end - -# source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#13 -ActionDispatch::Journey::GTG::TransitionTable::DEFAULT_EXP = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#14 -ActionDispatch::Journey::GTG::TransitionTable::DEFAULT_EXP_ANCHORED = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/journey/nfa/dot.rb#5 -module ActionDispatch::Journey::NFA; end - -# source://actionpack//lib/action_dispatch/journey/nfa/dot.rb#6 -module ActionDispatch::Journey::NFA::Dot - # source://actionpack//lib/action_dispatch/journey/nfa/dot.rb#7 - def to_dot; end -end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#67 -module ActionDispatch::Journey::Nodes; end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#180 -class ActionDispatch::Journey::Nodes::Binary < ::ActionDispatch::Journey::Nodes::Node - # @return [Binary] a new instance of Binary - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#183 - def initialize(left, right); end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#188 - def children; end - - # Returns the value of attribute right. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#181 - def right; end - - # Sets the attribute right - # - # @param value the value to set the attribute right to. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#181 - def right=(_arg0); end -end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#191 -class ActionDispatch::Journey::Nodes::Cat < ::ActionDispatch::Journey::Nodes::Binary - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#192 - def cat?; end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#193 - def type; end -end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#132 -class ActionDispatch::Journey::Nodes::Dot < ::ActionDispatch::Journey::Nodes::Terminal - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#133 - def type; end -end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#120 -class ActionDispatch::Journey::Nodes::Dummy < ::ActionDispatch::Journey::Nodes::Literal - # @return [Dummy] a new instance of Dummy - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#121 - def initialize(x = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#125 - def literal?; end -end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#157 -class ActionDispatch::Journey::Nodes::Group < ::ActionDispatch::Journey::Nodes::Unary - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#159 - def group?; end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#158 - def type; end -end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#115 -class ActionDispatch::Journey::Nodes::Literal < ::ActionDispatch::Journey::Nodes::Terminal - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#116 - def literal?; end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#117 - def type; end -end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#68 -class ActionDispatch::Journey::Nodes::Node - include ::Enumerable - - # @return [Node] a new instance of Node - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#73 - def initialize(left); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#106 - def cat?; end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#78 - def each(&block); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#107 - def group?; end - - # Returns the value of attribute left. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#71 - def left; end - - # Sets the attribute left - # - # @param value the value to set the attribute left to. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#71 - def left=(_arg0); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#103 - def literal?; end - - # Returns the value of attribute memo. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#71 - def memo; end - - # Sets the attribute memo - # - # @param value the value to set the attribute memo to. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#71 - def memo=(_arg0); end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#94 - def name; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#105 - def star?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#102 - def symbol?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#104 - def terminal?; end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#86 - def to_dot; end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#82 - def to_s; end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#90 - def to_sym; end - - # @raise [NotImplementedError] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#98 - def type; end -end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#196 -class ActionDispatch::Journey::Nodes::Or < ::ActionDispatch::Journey::Nodes::Node - # @return [Or] a new instance of Or - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#199 - def initialize(children); end - - # Returns the value of attribute children. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#197 - def children; end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#203 - def type; end -end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#128 -class ActionDispatch::Journey::Nodes::Slash < ::ActionDispatch::Journey::Nodes::Terminal - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#129 - def type; end -end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#162 -class ActionDispatch::Journey::Nodes::Star < ::ActionDispatch::Journey::Nodes::Unary - # @return [Star] a new instance of Star - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#165 - def initialize(left); end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#175 - def name; end - - # Returns the value of attribute regexp. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#163 - def regexp; end - - # Sets the attribute regexp - # - # @param value the value to set the attribute regexp to. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#163 - def regexp=(_arg0); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#172 - def star?; end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#173 - def type; end -end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#136 -class ActionDispatch::Journey::Nodes::Symbol < ::ActionDispatch::Journey::Nodes::Terminal - # @return [Symbol] a new instance of Symbol - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#143 - def initialize(left, regexp = T.unsafe(nil)); end - - # Returns the value of attribute name. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#139 - def name; end - - # Returns the value of attribute regexp. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#137 - def regexp; end - - # Sets the attribute regexp - # - # @param value the value to set the attribute regexp to. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#137 - def regexp=(_arg0); end - - # Returns the value of attribute regexp. - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#137 - def symbol; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#150 - def symbol?; end - - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#149 - def type; end -end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#141 -ActionDispatch::Journey::Nodes::Symbol::DEFAULT_EXP = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#142 -ActionDispatch::Journey::Nodes::Symbol::GREEDY_EXP = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#110 -class ActionDispatch::Journey::Nodes::Terminal < ::ActionDispatch::Journey::Nodes::Node - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#71 - def symbol; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#112 - def terminal?; end -end - -# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#153 -class ActionDispatch::Journey::Nodes::Unary < ::ActionDispatch::Journey::Nodes::Node - # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#154 - def children; end -end - -# source://actionpack//lib/action_dispatch/journey/parser_extras.rb#9 -class ActionDispatch::Journey::Parser < ::Racc::Parser - include ::ActionDispatch::Journey::Nodes - - # @return [Parser] a new instance of Parser - # - # source://actionpack//lib/action_dispatch/journey/parser_extras.rb#16 - def initialize; end - - # reduce 0 omitted - # - # source://actionpack//lib/action_dispatch/journey/parser.rb#137 - def _reduce_1(val, _values); end - - # source://actionpack//lib/action_dispatch/journey/parser.rb#165 - def _reduce_10(val, _values); end - - # reduce 14 omitted - # - # source://actionpack//lib/action_dispatch/journey/parser.rb#177 - def _reduce_15(val, _values); end - - # source://actionpack//lib/action_dispatch/journey/parser.rb#181 - def _reduce_16(val, _values); end - - # source://actionpack//lib/action_dispatch/journey/parser.rb#185 - def _reduce_17(val, _values); end - - # source://actionpack//lib/action_dispatch/journey/parser.rb#189 - def _reduce_18(val, _values); end - - # source://actionpack//lib/action_dispatch/journey/parser.rb#141 - def _reduce_2(val, _values); end - - # reduce 6 omitted - # - # source://actionpack//lib/action_dispatch/journey/parser.rb#153 - def _reduce_7(val, _values); end - - # source://actionpack//lib/action_dispatch/journey/parser.rb#157 - def _reduce_8(val, _values); end - - # source://actionpack//lib/action_dispatch/journey/parser.rb#161 - def _reduce_9(val, _values); end - - # source://actionpack//lib/action_dispatch/journey/parser.rb#193 - def _reduce_none(val, _values); end - - # source://actionpack//lib/action_dispatch/journey/parser_extras.rb#25 - def next_token; end - - # source://actionpack//lib/action_dispatch/journey/parser_extras.rb#20 - def parse(string); end - - class << self - # source://actionpack//lib/action_dispatch/journey/parser_extras.rb#12 - def parse(string); end - end -end - -# source://actionpack//lib/action_dispatch/journey/parser.rb#92 -ActionDispatch::Journey::Parser::Racc_arg = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/journey/parser.rb#131 -ActionDispatch::Journey::Parser::Racc_debug_parser = T.let(T.unsafe(nil), FalseClass) - -# source://actionpack//lib/action_dispatch/journey/parser.rb#108 -ActionDispatch::Journey::Parser::Racc_token_to_s_table = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#5 -module ActionDispatch::Journey::Path; end - -# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#6 -class ActionDispatch::Journey::Path::Pattern - # @return [Pattern] a new instance of Pattern - # - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#9 - def initialize(ast, requirements, separators, anchored); end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#156 - def =~(other); end - - # Returns the value of attribute anchored. - # - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#7 - def anchored; end - - # Returns the value of attribute ast. - # - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#7 - def ast; end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#23 - def build_formatter; end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#27 - def eager_load!; end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#156 - def match(other); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#162 - def match?(other); end - - # Returns the value of attribute names. - # - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#7 - def names; end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#59 - def optional_names; end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#55 - def required_names; end - - # Returns the value of attribute requirements. - # - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#7 - def requirements; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#34 - def requirements_anchored?; end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#174 - def requirements_for_missing_keys_check; end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#166 - def source; end - - # Returns the value of attribute spec. - # - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#7 - def spec; end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#170 - def to_regexp; end - - private - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#185 - def offsets; end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#181 - def regexp_visitor; end -end - -# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#65 -class ActionDispatch::Journey::Path::Pattern::AnchoredRegexp < ::ActionDispatch::Journey::Visitors::Visitor - # @return [AnchoredRegexp] a new instance of AnchoredRegexp - # - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#66 - def initialize(separator, matchers); end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#73 - def accept(node); end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#77 - def visit_CAT(node); end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#94 - def visit_DOT(node); end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#90 - def visit_GROUP(node); end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#94 - def visit_LITERAL(node); end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#108 - def visit_OR(node); end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#99 - def visit_SLASH(node); end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#103 - def visit_STAR(node); end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#81 - def visit_SYMBOL(node); end -end - -# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#121 -class ActionDispatch::Journey::Path::Pattern::MatchData - # @return [MatchData] a new instance of MatchData - # - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#124 - def initialize(names, offsets, match); end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#138 - def [](x); end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#130 - def captures; end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#143 - def length; end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#134 - def named_captures; end - - # Returns the value of attribute names. - # - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#122 - def names; end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#147 - def post_match; end - - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#151 - def to_s; end -end - -# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#114 -class ActionDispatch::Journey::Path::Pattern::UnanchoredRegexp < ::ActionDispatch::Journey::Path::Pattern::AnchoredRegexp - # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#115 - def accept(node); end -end - -# source://actionpack//lib/action_dispatch/journey/route.rb#6 -class ActionDispatch::Journey::Route - # +path+ is a path constraint. - # +constraints+ is a hash of constraints to be applied to this route. - # - # @return [Route] a new instance of Route - # - # source://actionpack//lib/action_dispatch/journey/route.rb#56 - def initialize(name:, path:, app: T.unsafe(nil), constraints: T.unsafe(nil), required_defaults: T.unsafe(nil), defaults: T.unsafe(nil), request_method_match: T.unsafe(nil), precedence: T.unsafe(nil), scope_options: T.unsafe(nil), internal: T.unsafe(nil)); end - - # Returns the value of attribute app. - # - # source://actionpack//lib/action_dispatch/journey/route.rb#7 - def app; end - - # Returns the value of attribute ast. - # - # source://actionpack//lib/action_dispatch/journey/route.rb#7 - def ast; end - - # Returns the value of attribute constraints. - # - # source://actionpack//lib/action_dispatch/journey/route.rb#7 - def conditions; end - - # Returns the value of attribute constraints. - # - # source://actionpack//lib/action_dispatch/journey/route.rb#7 - def constraints; end - - # Returns the value of attribute defaults. - # - # source://actionpack//lib/action_dispatch/journey/route.rb#7 - def defaults; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/route.rb#141 - def dispatcher?; end - - # source://actionpack//lib/action_dispatch/journey/route.rb#77 - def eager_load!; end - - # source://actionpack//lib/action_dispatch/journey/route.rb#119 - def format(path_options); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/route.rb#137 - def glob?; end - - # Returns the value of attribute internal. - # - # source://actionpack//lib/action_dispatch/journey/route.rb#7 - def internal; end - - # source://actionpack//lib/action_dispatch/journey/route.rb#163 - def ip; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/route.rb#145 - def matches?(request); end - - # Returns the value of attribute name. - # - # source://actionpack//lib/action_dispatch/journey/route.rb#7 - def name; end - - # source://actionpack//lib/action_dispatch/journey/route.rb#114 - def parts; end - - # Returns the value of attribute path. - # - # source://actionpack//lib/action_dispatch/journey/route.rb#7 - def path; end - - # Returns the value of attribute precedence. - # - # source://actionpack//lib/action_dispatch/journey/route.rb#7 - def precedence; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/route.rb#127 - def required_default?(key); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#131 - def required_defaults; end - - # source://actionpack//lib/action_dispatch/journey/route.rb#102 - def required_keys; end - - # source://actionpack//lib/action_dispatch/journey/route.rb#123 - def required_parts; end - - # Needed for `bin/rails routes`. Picks up succinctly defined requirements - # for a route, for example route - # - # get 'photo/:id', :controller => 'photos', :action => 'show', - # :id => /[A-Z]\d{5}/ - # - # will have {:controller=>"photos", :action=>"show", :id=>/[A-Z]\d{5}/} - # as requirements. - # - # source://actionpack//lib/action_dispatch/journey/route.rb#92 - def requirements; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/route.rb#167 - def requires_matching_verb?; end - - # Returns the value of attribute scope_options. - # - # source://actionpack//lib/action_dispatch/journey/route.rb#7 - def scope_options; end - - # source://actionpack//lib/action_dispatch/journey/route.rb#106 - def score(supplied_keys); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#114 - def segment_keys; end - - # source://actionpack//lib/action_dispatch/journey/route.rb#98 - def segments; end - - # source://actionpack//lib/action_dispatch/journey/route.rb#171 - def verb; end - - private - - # source://actionpack//lib/action_dispatch/journey/route.rb#180 - def match_verb(request); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#176 - def verbs; end - - class << self - # source://actionpack//lib/action_dispatch/journey/route.rb#47 - def verb_matcher(verb); end - end -end - -# source://actionpack//lib/action_dispatch/journey/route.rb#12 -module ActionDispatch::Journey::Route::VerbMatchers; end - -# source://actionpack//lib/action_dispatch/journey/route.rb#34 -class ActionDispatch::Journey::Route::VerbMatchers::All - class << self - # source://actionpack//lib/action_dispatch/journey/route.rb#35 - def call(_); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#36 - def verb; end - end -end - -# source://actionpack//lib/action_dispatch/journey/route.rb#17 -class ActionDispatch::Journey::Route::VerbMatchers::DELETE - class << self - # source://actionpack//lib/action_dispatch/journey/route.rb#19 - def call(req); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#18 - def verb; end - end -end - -# source://actionpack//lib/action_dispatch/journey/route.rb#17 -class ActionDispatch::Journey::Route::VerbMatchers::GET - class << self - # source://actionpack//lib/action_dispatch/journey/route.rb#19 - def call(req); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#18 - def verb; end - end -end - -# source://actionpack//lib/action_dispatch/journey/route.rb#17 -class ActionDispatch::Journey::Route::VerbMatchers::HEAD - class << self - # source://actionpack//lib/action_dispatch/journey/route.rb#19 - def call(req); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#18 - def verb; end - end -end - -# source://actionpack//lib/action_dispatch/journey/route.rb#17 -class ActionDispatch::Journey::Route::VerbMatchers::LINK - class << self - # source://actionpack//lib/action_dispatch/journey/route.rb#19 - def call(req); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#18 - def verb; end - end -end - -# source://actionpack//lib/action_dispatch/journey/route.rb#17 -class ActionDispatch::Journey::Route::VerbMatchers::OPTIONS - class << self - # source://actionpack//lib/action_dispatch/journey/route.rb#19 - def call(req); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#18 - def verb; end - end -end - -# source://actionpack//lib/action_dispatch/journey/route.rb#17 -class ActionDispatch::Journey::Route::VerbMatchers::PATCH - class << self - # source://actionpack//lib/action_dispatch/journey/route.rb#19 - def call(req); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#18 - def verb; end - end -end - -# source://actionpack//lib/action_dispatch/journey/route.rb#17 -class ActionDispatch::Journey::Route::VerbMatchers::POST - class << self - # source://actionpack//lib/action_dispatch/journey/route.rb#19 - def call(req); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#18 - def verb; end - end -end - -# source://actionpack//lib/action_dispatch/journey/route.rb#17 -class ActionDispatch::Journey::Route::VerbMatchers::PUT - class << self - # source://actionpack//lib/action_dispatch/journey/route.rb#19 - def call(req); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#18 - def verb; end - end -end - -# source://actionpack//lib/action_dispatch/journey/route.rb#17 -class ActionDispatch::Journey::Route::VerbMatchers::TRACE - class << self - # source://actionpack//lib/action_dispatch/journey/route.rb#19 - def call(req); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#18 - def verb; end - end -end - -# source://actionpack//lib/action_dispatch/journey/route.rb#17 -class ActionDispatch::Journey::Route::VerbMatchers::UNLINK - class << self - # source://actionpack//lib/action_dispatch/journey/route.rb#19 - def call(req); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#18 - def verb; end - end -end - -# source://actionpack//lib/action_dispatch/journey/route.rb#24 -class ActionDispatch::Journey::Route::VerbMatchers::Unknown - # @return [Unknown] a new instance of Unknown - # - # source://actionpack//lib/action_dispatch/journey/route.rb#27 - def initialize(verb); end - - # source://actionpack//lib/action_dispatch/journey/route.rb#31 - def call(request); end - - # Returns the value of attribute verb. - # - # source://actionpack//lib/action_dispatch/journey/route.rb#25 - def verb; end -end - -# source://actionpack//lib/action_dispatch/journey/route.rb#13 -ActionDispatch::Journey::Route::VerbMatchers::VERBS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/journey/route.rb#39 -ActionDispatch::Journey::Route::VerbMatchers::VERB_TO_CLASS = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#5 -class ActionDispatch::Journey::Router - # @return [Router] a new instance of Router - # - # source://actionpack//lib/action_dispatch/journey/router.rb#20 - def initialize(routes); end - - # source://actionpack//lib/action_dispatch/journey/router.rb#24 - def eager_load!; end - - # source://actionpack//lib/action_dispatch/journey/router.rb#65 - def recognize(rails_req); end - - # Returns the value of attribute routes. - # - # source://actionpack//lib/action_dispatch/journey/router.rb#18 - def routes; end - - # Sets the attribute routes - # - # @param value the value to set the attribute routes to. - # - # source://actionpack//lib/action_dispatch/journey/router.rb#18 - def routes=(_arg0); end - - # source://actionpack//lib/action_dispatch/journey/router.rb#31 - def serve(req); end - - # source://actionpack//lib/action_dispatch/journey/router.rb#78 - def visualizer; end - - private - - # source://actionpack//lib/action_dispatch/journey/router.rb#92 - def ast; end - - # source://actionpack//lib/action_dispatch/journey/router.rb#100 - def custom_routes; end - - # source://actionpack//lib/action_dispatch/journey/router.rb#104 - def filter_routes(path); end - - # source://actionpack//lib/action_dispatch/journey/router.rb#109 - def find_routes(req); end - - # source://actionpack//lib/action_dispatch/journey/router.rb#134 - def match_head_routes(routes, req); end - - # source://actionpack//lib/action_dispatch/journey/router.rb#86 - def partitioned_routes; end - - # source://actionpack//lib/action_dispatch/journey/router.rb#96 - def simulator; end -end - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#6 -class ActionDispatch::Journey::Router::Utils - class << self - # source://actionpack//lib/action_dispatch/journey/router/utils.rb#90 - def escape_fragment(fragment); end - - # source://actionpack//lib/action_dispatch/journey/router/utils.rb#82 - def escape_path(path); end - - # source://actionpack//lib/action_dispatch/journey/router/utils.rb#86 - def escape_segment(segment); end - - # Normalizes URI path. - # - # Strips off trailing slash and ensures there is a leading slash. - # Also converts downcase URL encoded string to uppercase. - # - # normalize_path("/foo") # => "/foo" - # normalize_path("/foo/") # => "/foo" - # normalize_path("foo") # => "/foo" - # normalize_path("") # => "/" - # normalize_path("/%ab") # => "/%AB" - # - # source://actionpack//lib/action_dispatch/journey/router/utils.rb#17 - def normalize_path(path); end - - # Replaces any escaped sequences with their unescaped representations. - # - # uri = "/topics?title=Ruby%20on%20Rails" - # unescape_uri(uri) #=> "/topics?title=Ruby on Rails" - # - # source://actionpack//lib/action_dispatch/journey/router/utils.rb#98 - def unescape_uri(uri); end - end -end - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#80 -ActionDispatch::Journey::Router::Utils::ENCODER = T.let(T.unsafe(nil), ActionDispatch::Journey::Router::Utils::UriEncoder) - -# URI path and fragment escaping -# https://tools.ietf.org/html/rfc3986 -# -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#33 -class ActionDispatch::Journey::Router::Utils::UriEncoder - # source://actionpack//lib/action_dispatch/journey/router/utils.rb#51 - def escape_fragment(fragment); end - - # source://actionpack//lib/action_dispatch/journey/router/utils.rb#55 - def escape_path(path); end - - # source://actionpack//lib/action_dispatch/journey/router/utils.rb#59 - def escape_segment(segment); end - - # source://actionpack//lib/action_dispatch/journey/router/utils.rb#63 - def unescape_uri(uri); end - - private - - # source://actionpack//lib/action_dispatch/journey/router/utils.rb#69 - def escape(component, pattern); end - - # source://actionpack//lib/action_dispatch/journey/router/utils.rb#73 - def percent_encode(unsafe); end -end - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#40 -ActionDispatch::Journey::Router::Utils::UriEncoder::ALPHA = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#38 -ActionDispatch::Journey::Router::Utils::UriEncoder::DEC2HEX = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#41 -ActionDispatch::Journey::Router::Utils::UriEncoder::DIGIT = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#37 -ActionDispatch::Journey::Router::Utils::UriEncoder::EMPTY = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#34 -ActionDispatch::Journey::Router::Utils::UriEncoder::ENCODE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#45 -ActionDispatch::Journey::Router::Utils::UriEncoder::ESCAPED = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#47 -ActionDispatch::Journey::Router::Utils::UriEncoder::FRAGMENT = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#49 -ActionDispatch::Journey::Router::Utils::UriEncoder::PATH = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#48 -ActionDispatch::Journey::Router::Utils::UriEncoder::SEGMENT = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#43 -ActionDispatch::Journey::Router::Utils::UriEncoder::SUB_DELIMS = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#42 -ActionDispatch::Journey::Router::Utils::UriEncoder::UNRESERVED = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#35 -ActionDispatch::Journey::Router::Utils::UriEncoder::US_ASCII = T.let(T.unsafe(nil), Encoding) - -# source://actionpack//lib/action_dispatch/journey/router/utils.rb#36 -ActionDispatch::Journey::Router::Utils::UriEncoder::UTF_8 = T.let(T.unsafe(nil), Encoding) - -# The Routing table. Contains all routes for a system. Routes can be -# added to the table by calling Routes#add_route. -# -# source://actionpack//lib/action_dispatch/journey/routes.rb#7 -class ActionDispatch::Journey::Routes - include ::Enumerable - - # @return [Routes] a new instance of Routes - # - # source://actionpack//lib/action_dispatch/journey/routes.rb#12 - def initialize; end - - # source://actionpack//lib/action_dispatch/journey/routes.rb#65 - def add_route(name, mapping); end - - # Returns the value of attribute anchored_routes. - # - # source://actionpack//lib/action_dispatch/journey/routes.rb#10 - def anchored_routes; end - - # source://actionpack//lib/action_dispatch/journey/routes.rb#51 - def ast; end - - # source://actionpack//lib/action_dispatch/journey/routes.rb#37 - def clear; end - - # Returns the value of attribute custom_routes. - # - # source://actionpack//lib/action_dispatch/journey/routes.rb#10 - def custom_routes; end - - # source://actionpack//lib/action_dispatch/journey/routes.rb#33 - def each(&block); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/routes.rb#20 - def empty?; end - - # source://actionpack//lib/action_dispatch/journey/routes.rb#29 - def last; end - - # source://actionpack//lib/action_dispatch/journey/routes.rb#24 - def length; end - - # source://actionpack//lib/action_dispatch/journey/routes.rb#43 - def partition_route(route); end - - # Returns the value of attribute routes. - # - # source://actionpack//lib/action_dispatch/journey/routes.rb#10 - def routes; end - - # source://actionpack//lib/action_dispatch/journey/routes.rb#58 - def simulator; end - - # source://actionpack//lib/action_dispatch/journey/routes.rb#24 - def size; end - - private - - # source://actionpack//lib/action_dispatch/journey/routes.rb#74 - def clear_cache!; end -end - -# source://actionpack//lib/action_dispatch/journey/scanner.rb#7 -class ActionDispatch::Journey::Scanner - # @return [Scanner] a new instance of Scanner - # - # source://actionpack//lib/action_dispatch/journey/scanner.rb#8 - def initialize; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/journey/scanner.rb#16 - def eos?; end - - # source://actionpack//lib/action_dispatch/journey/scanner.rb#28 - def next_token; end - - # source://actionpack//lib/action_dispatch/journey/scanner.rb#20 - def pos; end - - # source://actionpack//lib/action_dispatch/journey/scanner.rb#24 - def pre_match; end - - # source://actionpack//lib/action_dispatch/journey/scanner.rb#12 - def scan_setup(str); end - - private - - # takes advantage of String @- deduping capabilities in Ruby 2.5 upwards - # see: https://bugs.ruby-lang.org/issues/13077 - # - # source://actionpack//lib/action_dispatch/journey/scanner.rb#38 - def dedup_scan(regex); end - - # source://actionpack//lib/action_dispatch/journey/scanner.rb#43 - def scan; end -end - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#53 -module ActionDispatch::Journey::Visitors; end - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#194 -class ActionDispatch::Journey::Visitors::Dot < ::ActionDispatch::Journey::Visitors::FunctionalVisitor - # @return [Dot] a new instance of Dot - # - # source://actionpack//lib/action_dispatch/journey/visitors.rb#195 - def initialize; end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#200 - def accept(node, seed = T.unsafe(nil)); end - - private - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#215 - def binary(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#222 - def nary(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#254 - def terminal(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#229 - def unary(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#239 - def visit_CAT(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#234 - def visit_GROUP(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#249 - def visit_OR(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#244 - def visit_STAR(node, seed); end -end - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#260 -ActionDispatch::Journey::Visitors::Dot::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::Dot) - -# Loop through the requirements AST. -# -# source://actionpack//lib/action_dispatch/journey/visitors.rb#159 -class ActionDispatch::Journey::Visitors::Each < ::ActionDispatch::Journey::Visitors::FunctionalVisitor - # source://actionpack//lib/action_dispatch/journey/visitors.rb#160 - def visit(node, block); end -end - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#165 -ActionDispatch::Journey::Visitors::Each::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::Each) - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#134 -class ActionDispatch::Journey::Visitors::FormatBuilder < ::ActionDispatch::Journey::Visitors::Visitor - # source://actionpack//lib/action_dispatch/journey/visitors.rb#135 - def accept(node); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#138 - def binary(node); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#136 - def terminal(node); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#142 - def visit_GROUP(n); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#144 - def visit_STAR(n); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#148 - def visit_SYMBOL(n); end -end - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#95 -class ActionDispatch::Journey::Visitors::FunctionalVisitor - # source://actionpack//lib/action_dispatch/journey/visitors.rb#98 - def accept(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#106 - def binary(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#111 - def nary(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#122 - def terminal(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#116 - def unary(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#102 - def visit(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#109 - def visit_CAT(n, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#126 - def visit_DOT(n, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#119 - def visit_GROUP(n, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#123 - def visit_LITERAL(n, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#114 - def visit_OR(n, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#125 - def visit_SLASH(n, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#120 - def visit_STAR(n, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#124 - def visit_SYMBOL(n, seed); end -end - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#96 -ActionDispatch::Journey::Visitors::FunctionalVisitor::DISPATCH_CACHE = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#168 -class ActionDispatch::Journey::Visitors::String < ::ActionDispatch::Journey::Visitors::FunctionalVisitor - private - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#170 - def binary(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#174 - def nary(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#183 - def terminal(node, seed); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#187 - def visit_GROUP(node, seed); end -end - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#191 -ActionDispatch::Journey::Visitors::String::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::String) - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#54 -class ActionDispatch::Journey::Visitors::Visitor - # source://actionpack//lib/action_dispatch/journey/visitors.rb#57 - def accept(node); end - - private - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#66 - def binary(node); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#72 - def nary(node); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#83 - def terminal(node); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#77 - def unary(node); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#62 - def visit(node); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#70 - def visit_CAT(n); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#87 - def visit_DOT(n); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#80 - def visit_GROUP(n); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#84 - def visit_LITERAL(n); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#75 - def visit_OR(n); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#86 - def visit_SLASH(n); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#81 - def visit_STAR(n); end - - # source://actionpack//lib/action_dispatch/journey/visitors.rb#85 - def visit_SYMBOL(n); end -end - -# source://actionpack//lib/action_dispatch/journey/visitors.rb#55 -ActionDispatch::Journey::Visitors::Visitor::DISPATCH_CACHE = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_dispatch/middleware/stack.rb#7 -class ActionDispatch::MiddlewareStack - include ::Enumerable - - # @return [MiddlewareStack] a new instance of MiddlewareStack - # @yield [_self] - # @yieldparam _self [ActionDispatch::MiddlewareStack] the object that the method was called on - # - # source://actionpack//lib/action_dispatch/middleware/stack.rb#70 - def initialize(*args); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#87 - def [](i); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#160 - def build(app = T.unsafe(nil), &block); end - - # Deletes a middleware from the middleware stack. - # - # Returns the array of middlewares not including the deleted item, or - # returns nil if the target is not found. - # - # source://actionpack//lib/action_dispatch/middleware/stack.rb#125 - def delete(target); end - - # Deletes a middleware from the middleware stack. - # - # Returns the array of middlewares not including the deleted item, or - # raises +RuntimeError+ if the target is not found. - # - # source://actionpack//lib/action_dispatch/middleware/stack.rb#133 - def delete!(target); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#75 - def each(&block); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#100 - def insert(index, klass, *args, &block); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#108 - def insert_after(index, *args, &block); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#100 - def insert_before(index, klass, *args, &block); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#83 - def last; end - - # Returns the value of attribute middlewares. - # - # source://actionpack//lib/action_dispatch/middleware/stack.rb#68 - def middlewares; end - - # Sets the attribute middlewares - # - # @param value the value to set the attribute middlewares to. - # - # source://actionpack//lib/action_dispatch/middleware/stack.rb#68 - def middlewares=(_arg0); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#137 - def move(target, source); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#147 - def move_after(target, source); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#137 - def move_before(target, source); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#79 - def size; end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#114 - def swap(target, *args, &block); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#91 - def unshift(klass, *args, &block); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#155 - def use(klass, *args, &block); end - - private - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#172 - def assert_index(index, where); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#178 - def build_middleware(klass, args, block); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#182 - def index_of(klass); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#96 - def initialize_copy(other); end -end - -# This class is used to instrument the execution of a single middleware. -# It proxies the +call+ method transparently and instruments the method -# call. -# -# source://actionpack//lib/action_dispatch/middleware/stack.rb#48 -class ActionDispatch::MiddlewareStack::InstrumentationProxy - # @return [InstrumentationProxy] a new instance of InstrumentationProxy - # - # source://actionpack//lib/action_dispatch/middleware/stack.rb#51 - def initialize(middleware, class_name); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#59 - def call(env); end -end - -# source://actionpack//lib/action_dispatch/middleware/stack.rb#49 -ActionDispatch::MiddlewareStack::InstrumentationProxy::EVENT_NAME = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/stack.rb#8 -class ActionDispatch::MiddlewareStack::Middleware - # @return [Middleware] a new instance of Middleware - # - # source://actionpack//lib/action_dispatch/middleware/stack.rb#11 - def initialize(klass, args, block); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#19 - def ==(middleware); end - - # Returns the value of attribute args. - # - # source://actionpack//lib/action_dispatch/middleware/stack.rb#9 - def args; end - - # Returns the value of attribute block. - # - # source://actionpack//lib/action_dispatch/middleware/stack.rb#9 - def block; end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#36 - def build(app); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#40 - def build_instrumented(app); end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#28 - def inspect; end - - # Returns the value of attribute klass. - # - # source://actionpack//lib/action_dispatch/middleware/stack.rb#9 - def klass; end - - # source://actionpack//lib/action_dispatch/middleware/stack.rb#17 - def name; end -end - -# source://actionpack//lib/action_dispatch.rb#43 -class ActionDispatch::MissingController < ::NameError; end - -# Configures the HTTP -# {Feature-Policy}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy] -# response header to specify which browser features the current document and -# its iframes can use. -# -# Example global policy: -# -# Rails.application.config.permissions_policy do |policy| -# policy.camera :none -# policy.gyroscope :none -# policy.microphone :none -# policy.usb :none -# policy.fullscreen :self -# policy.payment :self, "https://secure.example.com" -# end -# -# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#22 -class ActionDispatch::PermissionsPolicy - # @return [PermissionsPolicy] a new instance of PermissionsPolicy - # @yield [_self] - # @yieldparam _self [ActionDispatch::PermissionsPolicy] the object that the method was called on - # - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#113 - def initialize; end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def accelerometer(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def ambient_light_sensor(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def autoplay(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#132 - def build(context = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def camera(*sources); end - - # Returns the value of attribute directives. - # - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#111 - def directives; end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def encrypted_media(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def fullscreen(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def geolocation(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def gyroscope(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def magnetometer(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def microphone(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def midi(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def payment(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def picture_in_picture(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def speaker(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def usb(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def vibrate(*sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 - def vr(*sources); end - - private - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#150 - def apply_mapping(source); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#137 - def apply_mappings(sources); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#168 - def build_directive(sources, context); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#156 - def build_directives(context); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#118 - def initialize_copy(other); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#172 - def resolve_source(source, context); end -end - -# List of available permissions can be found at -# https://github.com/w3c/webappsec-permissions-policy/blob/master/features.md#policy-controlled-features -# -# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#89 -ActionDispatch::PermissionsPolicy::DIRECTIVES = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#82 -ActionDispatch::PermissionsPolicy::MAPPINGS = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#23 -class ActionDispatch::PermissionsPolicy::Middleware - # @return [Middleware] a new instance of Middleware - # - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#32 - def initialize(app); end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#36 - def call(env); end - - private - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#55 - def html_response?(headers); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#65 - def policy_empty?(policy); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#61 - def policy_present?(headers); end -end - -# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#24 -ActionDispatch::PermissionsPolicy::Middleware::CONTENT_TYPE = T.let(T.unsafe(nil), String) - -# The Feature-Policy header has been renamed to Permissions-Policy. -# The Permissions-Policy requires a different implementation and isn't -# yet supported by all browsers. To avoid having to rename this -# middleware in the future we use the new name for the middleware but -# keep the old header name and implementation for now. -# -# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#30 -ActionDispatch::PermissionsPolicy::Middleware::POLICY = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#70 -module ActionDispatch::PermissionsPolicy::Request - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#73 - def permissions_policy; end - - # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#77 - def permissions_policy=(policy); end -end - -# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#71 -ActionDispatch::PermissionsPolicy::Request::POLICY = T.let(T.unsafe(nil), String) - -# When called, this middleware renders an error page. By default if an HTML -# response is expected it will render static error pages from the /public -# directory. For example when this middleware receives a 500 response it will -# render the template found in /public/500.html. -# If an internationalized locale is set, this middleware will attempt to render -# the template in /public/500..html. If an internationalized template -# is not found it will fall back on /public/500.html. -# -# When a request with a content type other than HTML is made, this middleware -# will attempt to convert error information into the appropriate response type. -# -# source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#14 -class ActionDispatch::PublicExceptions - # @return [PublicExceptions] a new instance of PublicExceptions - # - # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#17 - def initialize(public_path); end - - # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#21 - def call(env); end - - # Returns the value of attribute public_path. - # - # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#15 - def public_path; end - - # Sets the attribute public_path - # - # @param value the value to set the attribute public_path to. - # - # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#15 - def public_path=(_arg0); end - - private - - # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#35 - def render(status, content_type, body); end - - # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#44 - def render_format(status, content_type, body); end - - # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#49 - def render_html(status); end -end - -# source://actionpack//lib/action_dispatch/railtie.rb#7 -class ActionDispatch::Railtie < ::Rails::Railtie; end - -# ActionDispatch::Reloader wraps the request with callbacks provided by ActiveSupport::Reloader -# callbacks, intended to assist with code reloading during development. -# -# By default, ActionDispatch::Reloader is included in the middleware stack -# only in the development environment; specifically, when +config.cache_classes+ -# is false. -# -# source://actionpack//lib/action_dispatch/middleware/reloader.rb#10 -class ActionDispatch::Reloader < ::ActionDispatch::Executor; end - -# This middleware calculates the IP address of the remote client that is -# making the request. It does this by checking various headers that could -# contain the address, and then picking the last-set address that is not -# on the list of trusted IPs. This follows the precedent set by e.g. -# {the Tomcat server}[https://issues.apache.org/bugzilla/show_bug.cgi?id=50453], -# with {reasoning explained at length}[https://blog.gingerlime.com/2012/rails-ip-spoofing-vulnerabilities-and-protection] -# by @gingerlime. A more detailed explanation of the algorithm is given -# at GetIp#calculate_ip. -# -# Some Rack servers concatenate repeated headers, like {HTTP RFC 2616}[https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2] -# requires. Some Rack servers simply drop preceding headers, and only report -# the value that was {given in the last header}[https://andre.arko.net/2011/12/26/repeated-headers-and-ruby-web-servers]. -# If you are behind multiple proxy servers (like NGINX to HAProxy to Unicorn) -# then you should test your Rack server to make sure your data is good. -# -# IF YOU DON'T USE A PROXY, THIS MAKES YOU VULNERABLE TO IP SPOOFING. -# This middleware assumes that there is at least one proxy sitting around -# and setting headers with the client's remote IP address. If you don't use -# a proxy, because you are hosted on e.g. Heroku without SSL, any client can -# claim to have any IP address by setting the X-Forwarded-For header. If you -# care about that, then you need to explicitly drop or ignore those headers -# sometime before this middleware runs. -# -# source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#28 -class ActionDispatch::RemoteIp - # Create a new +RemoteIp+ middleware instance. - # - # The +ip_spoofing_check+ option is on by default. When on, an exception - # is raised if it looks like the client is trying to lie about its own IP - # address. It makes sense to turn off this check on sites aimed at non-IP - # clients (like WAP devices), or behind proxies that set headers in an - # incorrect or confusing way (like AWS ELB). - # - # The +custom_proxies+ argument can take an enumerable which will be used - # instead of +TRUSTED_PROXIES+. Any proxy setup will put the value you - # want in the middle (or at the beginning) of the X-Forwarded-For list, - # with your proxy servers after it. If your proxies aren't removed, pass - # them in via the +custom_proxies+ parameter. That way, the middleware will - # ignore those IP addresses, and return the one that you want. - # - # @return [RemoteIp] a new instance of RemoteIp - # - # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#60 - def initialize(app, ip_spoofing_check = T.unsafe(nil), custom_proxies = T.unsafe(nil)); end - - # Since the IP address may not be needed, we store the object here - # without calculating the IP to keep from slowing down the majority of - # requests. For those requests that do need to know the IP, the - # GetIp#calculate_ip method will calculate the memoized client IP address. - # - # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#90 - def call(env); end - - # Returns the value of attribute check_ip. - # - # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#44 - def check_ip; end - - # Returns the value of attribute proxies. - # - # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#44 - def proxies; end -end - -# The GetIp class exists as a way to defer processing of the request data -# into an actual IP address. If the ActionDispatch::Request#remote_ip method -# is called, this class will calculate the value and then memoize it. -# -# source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#99 -class ActionDispatch::RemoteIp::GetIp - # @return [GetIp] a new instance of GetIp - # - # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#100 - def initialize(req, check_ip, proxies); end - - # Sort through the various IP address headers, looking for the IP most - # likely to be the address of the actual remote client making this - # request. - # - # REMOTE_ADDR will be correct if the request is made directly against the - # Ruby process, on e.g. Heroku. When the request is proxied by another - # server like HAProxy or NGINX, the IP address that made the original - # request will be put in an X-Forwarded-For header. If there are multiple - # proxies, that header may contain a list of IPs. Other proxy services - # set the Client-Ip header instead, so we check that too. - # - # As discussed in {this post about Rails IP Spoofing}[https://blog.gingerlime.com/2012/rails-ip-spoofing-vulnerabilities-and-protection/], - # while the first IP in the list is likely to be the "originating" IP, - # it could also have been set by the client maliciously. - # - # In order to find the first address that is (probably) accurate, we - # take the list of IPs, remove known and trusted proxies, and then take - # the last address left, which was presumably set by one of those proxies. - # - # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#124 - def calculate_ip; end - - # Memoizes the value returned by #calculate_ip and returns it for - # ActionDispatch::Request to use. - # - # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#167 - def to_s; end - - private - - # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#186 - def filter_proxies(ips); end - - # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#172 - def ips_from(header); end -end - -# source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#29 -class ActionDispatch::RemoteIp::IpSpoofAttackError < ::StandardError; end - -# The default trusted IPs list simply includes IP addresses that are -# guaranteed by the IP specification to be private addresses. Those will -# not be the ultimate client IP in production, and so are discarded. See -# https://en.wikipedia.org/wiki/Private_network for details. -# -# source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#35 -ActionDispatch::RemoteIp::TRUSTED_PROXIES = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/http/request.rb#18 -class ActionDispatch::Request - include ::ActionDispatch::Flash::RequestMethods - include ::Rack::Request::Helpers - include ::ActionDispatch::Http::Cache::Request - include ::ActionDispatch::Http::MimeNegotiation - include ::ActionDispatch::Http::Parameters - include ::ActionDispatch::Http::FilterParameters - include ::ActionDispatch::Http::URL - include ::ActionDispatch::ContentSecurityPolicy::Request - include ::ActionDispatch::PermissionsPolicy::Request - include ::Rack::Request::Env - include ::ActionDispatch::RequestCookieMethods - extend ::ActionDispatch::Http::Parameters::ClassMethods - - # @return [Request] a new instance of Request - # - # source://actionpack//lib/action_dispatch/http/request.rb#60 - def initialize(env); end - - # Override Rack's GET method to support indifferent access. - # - # source://actionpack//lib/action_dispatch/http/request.rb#372 - def GET; end - - # Override Rack's POST method to support indifferent access. - # - # source://actionpack//lib/action_dispatch/http/request.rb#388 - def POST; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def accept; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def accept_charset; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def accept_encoding; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def accept_language; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def auth_type; end - - # Returns the authorization header regardless of whether it was specified directly or through one of the - # proxy alternatives. - # - # source://actionpack//lib/action_dispatch/http/request.rb#404 - def authorization; end - - # The request body is an IO input stream. If the RAW_POST_DATA environment - # variable is already set, wrap it in a StringIO. - # - # source://actionpack//lib/action_dispatch/http/request.rb#334 - def body; end - - # source://actionpack//lib/action_dispatch/http/request.rb#355 - def body_stream; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def cache_control; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def client_ip; end - - # source://actionpack//lib/action_dispatch/http/request.rb#70 - def commit_cookie_jar!; end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#62 - def commit_flash; end - - # Returns the content length of the request as an integer. - # - # source://actionpack//lib/action_dispatch/http/request.rb#270 - def content_length; end - - # source://actionpack//lib/action_dispatch/http/request.rb#79 - def controller_class; end - - # source://actionpack//lib/action_dispatch/http/request.rb#85 - def controller_class_for(name); end - - # source://actionpack//lib/action_dispatch/http/request.rb#171 - def controller_instance; end - - # source://actionpack//lib/action_dispatch/http/request.rb#175 - def controller_instance=(controller); end - - # source://actionpack//lib/action_dispatch/http/request.rb#157 - def engine_script_name(_routes); end - - # source://actionpack//lib/action_dispatch/http/request.rb#161 - def engine_script_name=(name); end - - # Determine whether the request body contains form-data by checking - # the request Content-Type for one of the media-types: - # "application/x-www-form-urlencoded" or "multipart/form-data". The - # list of form-data media types can be modified through the - # +FORM_DATA_MEDIA_TYPES+ array. - # - # A request body is not assumed to contain form-data when no - # Content-Type header is provided and the request_method is POST. - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/request.rb#351 - def form_data?; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def from; end - - # Returns the +String+ full path including params of the last URL requested. - # - # # get "/articles" - # request.fullpath # => "/articles" - # - # # get "/articles?page=2" - # request.fullpath # => "/articles?page=2" - # - # source://actionpack//lib/action_dispatch/http/request.rb#249 - def fullpath; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def gateway_interface; end - - # Provides access to the request's HTTP headers, for example: - # - # request.headers["Content-Type"] # => "text/plain" - # - # source://actionpack//lib/action_dispatch/http/request.rb#210 - def headers; end - - # source://actionpack//lib/action_dispatch/http/request.rb#179 - def http_auth_salt; end - - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#18 - def ignore_accept_header; end - - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#18 - def ignore_accept_header=(val); end - - # source://actionpack//lib/action_dispatch/http/request.rb#428 - def inspect; end - - # Returns the IP address of client as a +String+. - # - # source://actionpack//lib/action_dispatch/http/request.rb#283 - def ip; end - - # Returns true if the request has a header matching the given key parameter. - # - # request.key? :ip_spoofing_check # => true - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/request.rb#106 - def key?(key); end - - # True if the request came from localhost, 127.0.0.1, or ::1. - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/request.rb#412 - def local?; end - - # source://actionpack//lib/action_dispatch/http/request.rb#421 - def logger; end - - # The +String+ MIME type of the request. - # - # # get "/articles" - # request.media_type # => "application/x-www-form-urlencoded" - # - # source://actionpack//lib/action_dispatch/http/request.rb#265 - def media_type; end - - # Returns the original value of the environment's REQUEST_METHOD, - # even if it was overridden by middleware. See #request_method for - # more information. - # - # source://actionpack//lib/action_dispatch/http/request.rb#198 - def method; end - - # Returns a symbol form of the #method. - # - # source://actionpack//lib/action_dispatch/http/request.rb#203 - def method_symbol; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def negotiate; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def origin; end - - # Returns a +String+ with the last requested path including their params. - # - # # get '/foo' - # request.original_fullpath # => '/foo' - # - # # get '/foo?bar' - # request.original_fullpath # => '/foo?bar' - # - # source://actionpack//lib/action_dispatch/http/request.rb#238 - def original_fullpath; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def original_script_name; end - - # Returns the original request URL as a +String+. - # - # # get "/articles?page=2" - # request.original_url # => "http://www.example.com/articles?page=2" - # - # source://actionpack//lib/action_dispatch/http/request.rb#257 - def original_url; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def path_translated; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def pragma; end - - # Override Rack's GET method to support indifferent access. - # - # source://actionpack//lib/action_dispatch/http/request.rb#372 - def query_parameters; end - - # Read the request \body. This is useful for web services that need to - # work with raw requests directly. - # - # source://actionpack//lib/action_dispatch/http/request.rb#323 - def raw_post; end - - # source://rack/2.2.4/lib/rack/request.rb#157 - def raw_request_method; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def remote_addr; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def remote_host; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def remote_ident; end - - # Returns the IP address of client as a +String+, - # usually set by the RemoteIp middleware. - # - # source://actionpack//lib/action_dispatch/http/request.rb#289 - def remote_ip; end - - # source://actionpack//lib/action_dispatch/http/request.rb#293 - def remote_ip=(remote_ip); end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def remote_user; end - - # Returns the unique request id, which is based on either the X-Request-Id header that can - # be generated by a firewall, load balancer, or web server, or by the RequestId middleware - # (which sets the +action_dispatch.request_id+ environment variable). - # - # This unique ID is useful for tracing a request from end-to-end as part of logging or debugging. - # This relies on the Rack variable set by the ActionDispatch::RequestId middleware. - # - # source://actionpack//lib/action_dispatch/http/request.rb#306 - def request_id; end - - # source://actionpack//lib/action_dispatch/http/request.rb#310 - def request_id=(id); end - - # Returns the HTTP \method that the application should see. - # In the case where the \method was overridden by a middleware - # (for instance, if a HEAD request was converted to a GET, - # or if a _method parameter was used to determine the \method - # the application should use), this \method returns the overridden - # value, not the original. - # - # source://actionpack//lib/action_dispatch/http/request.rb#145 - def request_method; end - - # source://actionpack//lib/action_dispatch/http/request.rb#165 - def request_method=(request_method); end - - # Returns a symbol form of the #request_method. - # - # source://actionpack//lib/action_dispatch/http/request.rb#191 - def request_method_symbol; end - - # Override Rack's POST method to support indifferent access. - # - # source://actionpack//lib/action_dispatch/http/request.rb#388 - def request_parameters; end - - # source://actionpack//lib/action_dispatch/http/request.rb#416 - def request_parameters=(params); end - - # source://actionpack//lib/action_dispatch/middleware/flash.rb#75 - def reset_session; end - - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#19 - def return_only_media_type_on_content_type; end - - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#19 - def return_only_media_type_on_content_type=(val); end - - # source://actionpack//lib/action_dispatch/http/request.rb#149 - def routes; end - - # source://actionpack//lib/action_dispatch/http/request.rb#153 - def routes=(routes); end - - # Early Hints is an HTTP/2 status code that indicates hints to help a client start - # making preparations for processing the final response. - # - # If the env contains +rack.early_hints+ then the server accepts HTTP2 push for Link headers. - # - # The +send_early_hints+ method accepts a hash of links as follows: - # - # send_early_hints("Link" => "; rel=preload; as=style\n; rel=preload") - # - # If you are using +javascript_include_tag+ or +stylesheet_link_tag+ the - # Early Hints headers are included by default if supported. - # - # source://actionpack//lib/action_dispatch/http/request.rb#225 - def send_early_hints(links); end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def server_name; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def server_protocol; end - - # Returns the lowercase name of the HTTP server software. - # - # source://actionpack//lib/action_dispatch/http/request.rb#317 - def server_software; end - - # source://actionpack//lib/action_dispatch/http/request.rb#363 - def session=(session); end - - # source://actionpack//lib/action_dispatch/http/request.rb#367 - def session_options=(options); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/request.rb#183 - def show_exceptions?; end - - # Returns the unique request id, which is based on either the X-Request-Id header that can - # be generated by a firewall, load balancer, or web server, or by the RequestId middleware - # (which sets the +action_dispatch.request_id+ environment variable). - # - # This unique ID is useful for tracing a request from end-to-end as part of logging or debugging. - # This relies on the Rack variable set by the ActionDispatch::RequestId middleware. - # - # source://actionpack//lib/action_dispatch/http/request.rb#306 - def uuid; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def version; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def x_csrf_token; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def x_forwarded_for; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def x_forwarded_host; end - - # source://actionpack//lib/action_dispatch/http/request.rb#50 - def x_request_id; end - - # Returns true if the "X-Requested-With" header contains "XMLHttpRequest" - # (case-insensitive), which may need to be manually added depending on the - # choice of JavaScript libraries and frameworks. - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/request.rb#277 - def xhr?; end - - # Returns true if the "X-Requested-With" header contains "XMLHttpRequest" - # (case-insensitive), which may need to be manually added depending on the - # choice of JavaScript libraries and frameworks. - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/request.rb#277 - def xml_http_request?; end - - private - - # source://actionpack//lib/action_dispatch/http/request.rb#433 - def check_method(name); end - - # source://actionpack//lib/action_dispatch/http/request.rb#438 - def default_session; end - - class << self - # source://actionpack//lib/action_dispatch/http/request.rb#56 - def empty; end - - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#18 - def ignore_accept_header; end - - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#18 - def ignore_accept_header=(val); end - - # source://actionpack//lib/action_dispatch/http/parameters.rb#28 - def parameter_parsers; end - - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#19 - def return_only_media_type_on_content_type; end - - # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#19 - def return_only_media_type_on_content_type=(val); end - end -end - -# source://actionpack//lib/action_dispatch/http/request.rb#298 -ActionDispatch::Request::ACTION_DISPATCH_REQUEST_ID = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/request.rb#34 -ActionDispatch::Request::ENV_METHODS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/http/request.rb#128 -ActionDispatch::Request::HTTP_METHODS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/http/request.rb#130 -ActionDispatch::Request::HTTP_METHOD_LOOKUP = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_dispatch/http/request.rb#32 -ActionDispatch::Request::LOCALHOST = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/http/request.rb#73 -class ActionDispatch::Request::PASS_NOT_FOUND - class << self - # source://actionpack//lib/action_dispatch/http/request.rb#74 - def action(_); end - - # source://actionpack//lib/action_dispatch/http/request.rb#76 - def action_encoding_template(action); end - - # source://actionpack//lib/action_dispatch/http/request.rb#75 - def call(_); end - end -end - -# source://actionpack//lib/action_dispatch/http/request.rb#120 -ActionDispatch::Request::RFC2518 = T.let(T.unsafe(nil), Array) - -# List of HTTP request methods from the following RFCs: -# Hypertext Transfer Protocol -- HTTP/1.1 (https://www.ietf.org/rfc/rfc2616.txt) -# HTTP Extensions for Distributed Authoring -- WEBDAV (https://www.ietf.org/rfc/rfc2518.txt) -# Versioning Extensions to WebDAV (https://www.ietf.org/rfc/rfc3253.txt) -# Ordered Collections Protocol (WebDAV) (https://www.ietf.org/rfc/rfc3648.txt) -# Web Distributed Authoring and Versioning (WebDAV) Access Control Protocol (https://www.ietf.org/rfc/rfc3744.txt) -# Web Distributed Authoring and Versioning (WebDAV) SEARCH (https://www.ietf.org/rfc/rfc5323.txt) -# Calendar Extensions to WebDAV (https://www.ietf.org/rfc/rfc4791.txt) -# PATCH Method for HTTP (https://www.ietf.org/rfc/rfc5789.txt) -# -# source://actionpack//lib/action_dispatch/http/request.rb#119 -ActionDispatch::Request::RFC2616 = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/http/request.rb#121 -ActionDispatch::Request::RFC3253 = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/http/request.rb#122 -ActionDispatch::Request::RFC3648 = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/http/request.rb#123 -ActionDispatch::Request::RFC3744 = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/http/request.rb#125 -ActionDispatch::Request::RFC4791 = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/http/request.rb#124 -ActionDispatch::Request::RFC5323 = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/http/request.rb#126 -ActionDispatch::Request::RFC5789 = T.let(T.unsafe(nil), Array) - -# Session is responsible for lazily loading the session from store. -# -# source://actionpack//lib/action_dispatch/request/session.rb#8 -class ActionDispatch::Request::Session - # @return [Session] a new instance of Session - # - # source://actionpack//lib/action_dispatch/request/session.rb#74 - def initialize(by, req, enabled: T.unsafe(nil)); end - - # Returns value of the key stored in the session or - # +nil+ if the given key is not found in the session. - # - # source://actionpack//lib/action_dispatch/request/session.rb#110 - def [](key); end - - # Writes given value to given key of the session. - # - # source://actionpack//lib/action_dispatch/request/session.rb#150 - def []=(key, value); end - - # Clears the session. - # - # source://actionpack//lib/action_dispatch/request/session.rb#156 - def clear; end - - # Deletes given key from the session. - # - # source://actionpack//lib/action_dispatch/request/session.rb#184 - def delete(key); end - - # source://actionpack//lib/action_dispatch/request/session.rb#95 - def destroy; end - - # Returns the nested value specified by the sequence of keys, returning - # +nil+ if any intermediate step is +nil+. - # - # source://actionpack//lib/action_dispatch/request/session.rb#123 - def dig(*keys); end - - # source://actionpack//lib/action_dispatch/request/session.rb#240 - def each(&block); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/request/session.rb#230 - def empty?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/request/session.rb#87 - def enabled?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/request/session.rb#220 - def exists?; end - - # Returns value of the given key from the session, or raises +KeyError+ - # if can't find the given key and no default value is set. - # Returns default value if specified. - # - # session.fetch(:foo) - # # => KeyError: key not found: "foo" - # - # session.fetch(:foo, :bar) - # # => :bar - # - # session.fetch(:foo) do - # :bar - # end - # # => :bar - # - # source://actionpack//lib/action_dispatch/request/session.rb#203 - def fetch(key, default = T.unsafe(nil), &block); end - - # Returns true if the session has the given key or false. - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/request/session.rb#130 - def has_key?(key); end - - # source://actionpack//lib/action_dispatch/request/session.rb#83 - def id; end - - # Returns true if the session has the given key or false. - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/request/session.rb#130 - def include?(key); end - - # source://actionpack//lib/action_dispatch/request/session.rb#212 - def inspect; end - - # Returns true if the session has the given key or false. - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/request/session.rb#130 - def key?(key); end - - # Returns keys of the session as Array. - # - # source://actionpack//lib/action_dispatch/request/session.rb#138 - def keys; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/request/session.rb#226 - def loaded?; end - - # source://actionpack//lib/action_dispatch/request/session.rb#235 - def merge!(other); end - - # source://actionpack//lib/action_dispatch/request/session.rb#91 - def options; end - - # Returns the session as Hash. - # - # source://actionpack//lib/action_dispatch/request/session.rb#162 - def to_h; end - - # Returns the session as Hash. - # - # source://actionpack//lib/action_dispatch/request/session.rb#162 - def to_hash; end - - # Updates the session with given Hash. - # - # session.to_hash - # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2"} - # - # session.update({ "foo" => "bar" }) - # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"} - # - # session.to_hash - # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"} - # - # source://actionpack//lib/action_dispatch/request/session.rb#178 - def update(hash); end - - # Returns values of the session as Array. - # - # source://actionpack//lib/action_dispatch/request/session.rb#144 - def values; end - - private - - # source://actionpack//lib/action_dispatch/request/session.rb#261 - def load!; end - - # source://actionpack//lib/action_dispatch/request/session.rb#257 - def load_for_delete!; end - - # source://actionpack//lib/action_dispatch/request/session.rb#245 - def load_for_read!; end - - # source://actionpack//lib/action_dispatch/request/session.rb#249 - def load_for_write!; end - - class << self - # Creates a session hash, merging the properties of the previous session if any. - # - # source://actionpack//lib/action_dispatch/request/session.rb#17 - def create(store, req, default_options); end - - # source://actionpack//lib/action_dispatch/request/session.rb#41 - def delete(req); end - - # source://actionpack//lib/action_dispatch/request/session.rb#27 - def disabled(req); end - - # source://actionpack//lib/action_dispatch/request/session.rb#33 - def find(req); end - - # source://actionpack//lib/action_dispatch/request/session.rb#37 - def set(req, session); end - end -end - -# source://actionpack//lib/action_dispatch/request/session.rb#9 -class ActionDispatch::Request::Session::DisabledSessionError < ::StandardError; end - -# source://actionpack//lib/action_dispatch/request/session.rb#10 -ActionDispatch::Request::Session::ENV_SESSION_KEY = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/request/session.rb#11 -ActionDispatch::Request::Session::ENV_SESSION_OPTIONS_KEY = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/request/session.rb#45 -class ActionDispatch::Request::Session::Options - # @return [Options] a new instance of Options - # - # source://actionpack//lib/action_dispatch/request/session.rb#54 - def initialize(by, default_options); end - - # source://actionpack//lib/action_dispatch/request/session.rb#59 - def [](key); end - - # source://actionpack//lib/action_dispatch/request/session.rb#69 - def []=(k, v); end - - # source://actionpack//lib/action_dispatch/request/session.rb#63 - def id(req); end - - # source://actionpack//lib/action_dispatch/request/session.rb#70 - def to_hash; end - - # source://actionpack//lib/action_dispatch/request/session.rb#71 - def values_at(*args); end - - class << self - # source://actionpack//lib/action_dispatch/request/session.rb#50 - def find(req); end - - # source://actionpack//lib/action_dispatch/request/session.rb#46 - def set(req, options); end - end -end - -# Singleton object used to determine if an optional param wasn't specified. -# -# source://actionpack//lib/action_dispatch/request/session.rb#14 -ActionDispatch::Request::Session::Unspecified = T.let(T.unsafe(nil), Object) - -# source://actionpack//lib/action_dispatch/request/utils.rb#7 -class ActionDispatch::Request::Utils - # source://actionpack//lib/action_dispatch/request/utils.rb#8 - def perform_deep_munge; end - - # source://actionpack//lib/action_dispatch/request/utils.rb#8 - def perform_deep_munge=(val); end - - class << self - # source://actionpack//lib/action_dispatch/request/utils.rb#29 - def check_param_encoding(params); end - - # source://actionpack//lib/action_dispatch/request/utils.rb#10 - def each_param_value(params, &block); end - - # source://actionpack//lib/action_dispatch/request/utils.rb#21 - def normalize_encode_params(params); end - - # source://actionpack//lib/action_dispatch/request/utils.rb#8 - def perform_deep_munge; end - - # source://actionpack//lib/action_dispatch/request/utils.rb#8 - def perform_deep_munge=(val); end - - # source://actionpack//lib/action_dispatch/request/utils.rb#44 - def set_binary_encoding(request, params, controller, action); end - end -end - -# source://actionpack//lib/action_dispatch/request/utils.rb#81 -class ActionDispatch::Request::Utils::CustomParamEncoder - class << self - # source://actionpack//lib/action_dispatch/request/utils.rb#94 - def action_encoding_template(request, controller, action); end - - # source://actionpack//lib/action_dispatch/request/utils.rb#82 - def encode(request, params, controller, action); end - end -end - -# Remove nils from the params hash. -# -# source://actionpack//lib/action_dispatch/request/utils.rb#73 -class ActionDispatch::Request::Utils::NoNilParamEncoder < ::ActionDispatch::Request::Utils::ParamEncoder - class << self - # source://actionpack//lib/action_dispatch/request/utils.rb#74 - def handle_array(params); end - end -end - -# source://actionpack//lib/action_dispatch/request/utils.rb#48 -class ActionDispatch::Request::Utils::ParamEncoder - class << self - # source://actionpack//lib/action_dispatch/request/utils.rb#67 - def handle_array(params); end - - # Convert nested Hash to HashWithIndifferentAccess. - # - # source://actionpack//lib/action_dispatch/request/utils.rb#50 - def normalize_encode_params(params); end - end -end - -# source://actionpack//lib/action_dispatch/middleware/cookies.rb#10 -module ActionDispatch::RequestCookieMethods - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#48 - def authenticated_encrypted_cookie_salt; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#11 - def cookie_jar; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#28 - def cookie_jar=(jar); end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#76 - def cookies_digest; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#80 - def cookies_rotations; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#72 - def cookies_same_site_protection; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#68 - def cookies_serializer; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#56 - def encrypted_cookie_cipher; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#40 - def encrypted_cookie_salt; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#44 - def encrypted_signed_cookie_salt; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#24 - def have_cookie_jar?; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#32 - def key_generator; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#64 - def secret_key_base; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#60 - def signed_cookie_digest; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#36 - def signed_cookie_salt; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#52 - def use_authenticated_cookie_encryption; end - - # source://actionpack//lib/action_dispatch/middleware/cookies.rb#84 - def use_cookies_with_metadata; end -end - -# source://actionpack//lib/action_dispatch/testing/request_encoder.rb#4 -class ActionDispatch::RequestEncoder - # @return [RequestEncoder] a new instance of RequestEncoder - # - # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#16 - def initialize(mime_name, param_encoder, response_parser); end - - # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#32 - def accept_header; end - - # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#28 - def content_type; end - - # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#36 - def encode_params(params); end - - # Returns the value of attribute response_parser. - # - # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#14 - def response_parser; end - - class << self - # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#45 - def encoder(name); end - - # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#40 - def parser(content_type); end - - # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#49 - def register_encoder(mime_name, param_encoder: T.unsafe(nil), response_parser: T.unsafe(nil)); end - end -end - -# source://actionpack//lib/action_dispatch/testing/request_encoder.rb#5 -class ActionDispatch::RequestEncoder::IdentityEncoder - # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#7 - def accept_header; end - - # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#6 - def content_type; end - - # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#8 - def encode_params(params); end - - # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#9 - def response_parser; end -end - -# Makes a unique request id available to the +action_dispatch.request_id+ env variable (which is then accessible -# through ActionDispatch::Request#request_id or the alias ActionDispatch::Request#uuid) and sends -# the same id to the client via the X-Request-Id header. -# -# The unique request id is either based on the X-Request-Id header in the request, which would typically be generated -# by a firewall, load balancer, or the web server, or, if this header is not available, a random uuid. If the -# header is accepted from the outside world, we sanitize it to a max of 255 chars and alphanumeric and dashes only. -# -# The unique request id can be used to trace a request end-to-end and would typically end up being part of log files -# from multiple pieces of the stack. -# -# source://actionpack//lib/action_dispatch/middleware/request_id.rb#17 -class ActionDispatch::RequestId - # @return [RequestId] a new instance of RequestId - # - # source://actionpack//lib/action_dispatch/middleware/request_id.rb#18 - def initialize(app, header:); end - - # source://actionpack//lib/action_dispatch/middleware/request_id.rb#23 - def call(env); end - - private - - # source://actionpack//lib/action_dispatch/middleware/request_id.rb#38 - def internal_request_id; end - - # source://actionpack//lib/action_dispatch/middleware/request_id.rb#30 - def make_request_id(request_id); end -end - -# Represents an HTTP response generated by a controller action. Use it to -# retrieve the current state of the response, or customize the response. It can -# either represent a real HTTP response (i.e. one that is meant to be sent -# back to the web browser) or a TestResponse (i.e. one that is generated -# from integration tests). -# -# \Response is mostly a Ruby on \Rails framework implementation detail, and -# should never be used directly in controllers. Controllers should use the -# methods defined in ActionController::Base instead. For example, if you want -# to set the HTTP response's content MIME type, then use -# ActionControllerBase#headers instead of Response#headers. -# -# Nevertheless, integration tests may want to inspect controller responses in -# more detail, and that's when \Response can be useful for application -# developers. Integration test methods such as -# Integration::RequestHelpers#get and Integration::RequestHelpers#post return -# objects of type TestResponse (which are of course also of type \Response). -# -# For example, the following demo integration test prints the body of the -# controller response to the console: -# -# class DemoControllerTest < ActionDispatch::IntegrationTest -# def test_print_root_path_to_console -# get('/') -# puts response.body -# end -# end -# -# source://actionpack//lib/action_dispatch/http/response.rb#36 -class ActionDispatch::Response - include ::Rack::Response::Helpers - include ::ActionDispatch::Http::FilterRedirect - include ::ActionDispatch::Http::Cache::Response - include ::MonitorMixin - - # @return [Response] a new instance of Response - # @yield [_self] - # @yieldparam _self [ActionDispatch::Response] the object that the method was called on - # - # source://actionpack//lib/action_dispatch/http/response.rb#161 - def initialize(status = T.unsafe(nil), header = T.unsafe(nil), body = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/http/response.rb#71 - def [](*_arg0, &_arg1); end - - # source://actionpack//lib/action_dispatch/http/response.rb#71 - def []=(*_arg0, &_arg1); end - - # Aliasing these off because AD::Http::Cache::Response defines them. - # - # source://rack/2.2.4/lib/rack/response.rb#229 - def _cache_control; end - - # source://rack/2.2.4/lib/rack/response.rb#233 - def _cache_control=(v); end - - # source://actionpack//lib/action_dispatch/http/response.rb#370 - def abort; end - - # source://actionpack//lib/action_dispatch/http/response.rb#183 - def await_commit; end - - # source://actionpack//lib/action_dispatch/http/response.rb#189 - def await_sent; end - - # Returns the content of the response as a string. This contains the contents - # of any calls to render. - # - # source://actionpack//lib/action_dispatch/http/response.rb#304 - def body; end - - # Allows you to manually set or override the response body. - # - # source://actionpack//lib/action_dispatch/http/response.rb#313 - def body=(body); end - - # source://actionpack//lib/action_dispatch/http/response.rb#357 - def body_parts; end - - # The charset of the response. HTML wants to know the encoding of the - # content you're giving them, so we need to send that along. - # - # source://actionpack//lib/action_dispatch/http/response.rb#274 - def charset; end - - # Sets the HTTP character set. In case of +nil+ parameter - # it sets the charset to +default_charset+. - # - # response.charset = 'utf-16' # => 'utf-16' - # response.charset = nil # => 'utf-8' - # - # source://actionpack//lib/action_dispatch/http/response.rb#263 - def charset=(charset); end - - # source://actionpack//lib/action_dispatch/http/response.rb#366 - def close; end - - # Returns a string to ensure compatibility with Net::HTTPResponse. - # - # source://actionpack//lib/action_dispatch/http/response.rb#285 - def code; end - - # source://actionpack//lib/action_dispatch/http/response.rb#193 - def commit!; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/response.rb#217 - def committed?; end - - # Content type of response. - # - # source://actionpack//lib/action_dispatch/http/response.rb#243 - def content_type; end - - # Sets the HTTP response's content MIME type. For example, in the controller - # you could write this: - # - # response.content_type = "text/plain" - # - # If a character set has been defined for this response (see charset=) then - # the character set information will also be included in the content type - # information. - # - # source://actionpack//lib/action_dispatch/http/response.rb#233 - def content_type=(content_type); end - - # Returns the response cookies, converted to a Hash of (name => value) pairs - # - # assert_equal 'AuthorOfNewPage', r.cookies['author'] - # - # source://actionpack//lib/action_dispatch/http/response.rb#394 - def cookies; end - - # source://actionpack//lib/action_dispatch/http/response.rb#85 - def default_charset; end - - # source://actionpack//lib/action_dispatch/http/response.rb#85 - def default_charset=(val); end - - # source://actionpack//lib/action_dispatch/http/response.rb#86 - def default_headers; end - - # source://actionpack//lib/action_dispatch/http/response.rb#86 - def default_headers=(val); end - - # source://actionpack//lib/action_dispatch/http/response.rb#181 - def delete_header(key); end - - # source://actionpack//lib/action_dispatch/http/response.rb#73 - def each(&block); end - - # source://actionpack//lib/action_dispatch/http/response.rb#179 - def get_header(key); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/response.rb#178 - def has_header?(key); end - - # Get headers for this response. - # - # source://actionpack//lib/action_dispatch/http/response.rb#67 - def header; end - - # Get headers for this response. - # - # source://actionpack//lib/action_dispatch/http/response.rb#67 - def headers; end - - # Media type of response. - # - # source://actionpack//lib/action_dispatch/http/response.rb#248 - def media_type; end - - # Returns the corresponding message for the current HTTP status code: - # - # response.status = 200 - # response.message # => "OK" - # - # response.status = 404 - # response.message # => "Not Found" - # - # source://actionpack//lib/action_dispatch/http/response.rb#297 - def message; end - - # Turns the Response into a Rack-compatible array of the status, headers, - # and body. Allows explicit splatting: - # - # status, headers, body = *response - # - # source://actionpack//lib/action_dispatch/http/response.rb#385 - def prepare!; end - - # The location header we'll be responding with. - # - # source://rack/2.2.4/lib/rack/response.rb#204 - def redirect_url; end - - # The request that the response is responding to. - # - # source://actionpack//lib/action_dispatch/http/response.rb#61 - def request; end - - # The request that the response is responding to. - # - # source://actionpack//lib/action_dispatch/http/response.rb#61 - def request=(_arg0); end - - # source://actionpack//lib/action_dispatch/http/response.rb#353 - def reset_body!; end - - # The response code of the request. - # - # source://actionpack//lib/action_dispatch/http/response.rb#280 - def response_code; end - - # Send the file stored at +path+ as the response body. - # - # source://actionpack//lib/action_dispatch/http/response.rb#348 - def send_file(path); end - - # source://actionpack//lib/action_dispatch/http/response.rb#201 - def sending!; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/response.rb#216 - def sending?; end - - # source://actionpack//lib/action_dispatch/http/response.rb#252 - def sending_file=(v); end - - # source://actionpack//lib/action_dispatch/http/response.rb#209 - def sent!; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/response.rb#218 - def sent?; end - - # source://actionpack//lib/action_dispatch/http/response.rb#180 - def set_header(key, v); end - - # The HTTP status code. - # - # source://actionpack//lib/action_dispatch/http/response.rb#64 - def status; end - - # Sets the HTTP status code. - # - # source://actionpack//lib/action_dispatch/http/response.rb#221 - def status=(status); end - - # Returns the corresponding message for the current HTTP status code: - # - # response.status = 200 - # response.message # => "OK" - # - # response.status = 404 - # response.message # => "Not Found" - # - # source://actionpack//lib/action_dispatch/http/response.rb#297 - def status_message; end - - # The underlying body, as a streamable object. - # - # source://actionpack//lib/action_dispatch/http/response.rb#159 - def stream; end - - # Turns the Response into a Rack-compatible array of the status, headers, - # and body. Allows explicit splatting: - # - # status, headers, body = *response - # - # source://actionpack//lib/action_dispatch/http/response.rb#385 - def to_a; end - - # source://actionpack//lib/action_dispatch/http/response.rb#308 - def write(string); end - - private - - # source://actionpack//lib/action_dispatch/http/response.rb#466 - def assign_default_content_type_and_charset!; end - - # source://actionpack//lib/action_dispatch/http/response.rb#438 - def before_committed; end - - # source://actionpack//lib/action_dispatch/http/response.rb#446 - def before_sending; end - - # source://actionpack//lib/action_dispatch/http/response.rb#458 - def build_buffer(response, body); end - - # source://actionpack//lib/action_dispatch/http/response.rb#510 - def handle_no_content!; end - - # source://actionpack//lib/action_dispatch/http/response.rb#462 - def munge_body_object(body); end - - # source://actionpack//lib/action_dispatch/http/response.rb#418 - def parse_content_type(content_type); end - - # Small internal convenience method to get the parsed version of the current - # content type header. - # - # source://actionpack//lib/action_dispatch/http/response.rb#428 - def parsed_content_type_header; end - - # source://actionpack//lib/action_dispatch/http/response.rb#517 - def rack_response(status, header); end - - # source://actionpack//lib/action_dispatch/http/response.rb#432 - def set_content_type(content_type, charset); end - - class << self - # source://actionpack//lib/action_dispatch/http/response.rb#149 - def create(status = T.unsafe(nil), header = T.unsafe(nil), body = T.unsafe(nil), default_headers: T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/http/response.rb#85 - def default_charset; end - - # source://actionpack//lib/action_dispatch/http/response.rb#85 - def default_charset=(val); end - - # source://actionpack//lib/action_dispatch/http/response.rb#86 - def default_headers; end - - # source://actionpack//lib/action_dispatch/http/response.rb#86 - def default_headers=(val); end - - # source://actionpack//lib/action_dispatch/http/response.rb#154 - def merge_default_headers(original, default); end - end -end - -# source://actionpack//lib/action_dispatch/http/response.rb#97 -class ActionDispatch::Response::Buffer - # @return [Buffer] a new instance of Buffer - # - # source://actionpack//lib/action_dispatch/http/response.rb#98 - def initialize(response, buf); end - - # source://actionpack//lib/action_dispatch/http/response.rb#131 - def abort; end - - # source://actionpack//lib/action_dispatch/http/response.rb#105 - def body; end - - # source://actionpack//lib/action_dispatch/http/response.rb#134 - def close; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/response.rb#139 - def closed?; end - - # source://actionpack//lib/action_dispatch/http/response.rb#121 - def each(&block); end - - # @raise [IOError] - # - # source://actionpack//lib/action_dispatch/http/response.rb#113 - def write(string); end - - private - - # source://actionpack//lib/action_dispatch/http/response.rb#144 - def each_chunk(&block); end -end - -# source://actionpack//lib/action_dispatch/http/response.rb#80 -ActionDispatch::Response::CONTENT_TYPE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/response.rb#412 -ActionDispatch::Response::CONTENT_TYPE_PARSER = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/http/response.rb#409 -class ActionDispatch::Response::ContentTypeHeader < ::Struct - # Returns the value of attribute charset - # - # @return [Object] the current value of charset - def charset; end - - # Sets the attribute charset - # - # @param value [Object] the value to set the attribute charset to. - # @return [Object] the newly set value - # - # source://actionpack//lib/action_dispatch/http/response.rb#409 - def charset=(_); end - - # Returns the value of attribute mime_type - # - # @return [Object] the current value of mime_type - def mime_type; end - - # Sets the attribute mime_type - # - # @param value [Object] the value to set the attribute mime_type to. - # @return [Object] the newly set value - # - # source://actionpack//lib/action_dispatch/http/response.rb#409 - def mime_type=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def members; end - def new(*_arg0); end - end -end - -# Avoid having to pass an open file handle as the response body. -# Rack::Sendfile will usually intercept the response and uses -# the path directly, so there is no reason to open the file. -# -# source://actionpack//lib/action_dispatch/http/response.rb#326 -class ActionDispatch::Response::FileBody - # @return [FileBody] a new instance of FileBody - # - # source://actionpack//lib/action_dispatch/http/response.rb#329 - def initialize(path); end - - # source://actionpack//lib/action_dispatch/http/response.rb#333 - def body; end - - # Stream the file's contents if Rack::Sendfile isn't present. - # - # source://actionpack//lib/action_dispatch/http/response.rb#338 - def each; end - - # source://actionpack//lib/action_dispatch/http/response.rb#327 - def to_path; end -end - -# source://actionpack//lib/action_dispatch/http/response.rb#37 -class ActionDispatch::Response::Header - # @return [Header] a new instance of Header - # - # source://actionpack//lib/action_dispatch/http/response.rb#38 - def initialize(response, header); end - - # source://actionpack//lib/action_dispatch/http/response.rb#43 - def []=(k, v); end - - # source://actionpack//lib/action_dispatch/http/response.rb#51 - def merge(other); end - - # source://actionpack//lib/action_dispatch/http/response.rb#55 - def to_hash; end -end - -# source://actionpack//lib/action_dispatch/http/response.rb#82 -ActionDispatch::Response::LOCATION = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/response.rb#83 -ActionDispatch::Response::NO_CONTENT_CODES = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/http/response.rb#410 -ActionDispatch::Response::NullContentTypeHeader = T.let(T.unsafe(nil), ActionDispatch::Response::ContentTypeHeader) - -# source://actionpack//lib/action_dispatch/http/response.rb#474 -class ActionDispatch::Response::RackBody - # @return [RackBody] a new instance of RackBody - # - # source://actionpack//lib/action_dispatch/http/response.rb#475 - def initialize(response); end - - # source://actionpack//lib/action_dispatch/http/response.rb#489 - def body; end - - # source://actionpack//lib/action_dispatch/http/response.rb#483 - def close; end - - # source://actionpack//lib/action_dispatch/http/response.rb#479 - def each(*args, &block); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/response.rb#493 - def respond_to?(method, include_private = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/http/response.rb#505 - def to_ary; end - - # source://actionpack//lib/action_dispatch/http/response.rb#501 - def to_path; end -end - -# source://actionpack//lib/action_dispatch/http/response.rb#81 -ActionDispatch::Response::SET_COOKIE = T.let(T.unsafe(nil), String) - -# The routing module provides URL rewriting in native Ruby. It's a way to -# redirect incoming requests to controllers and actions. This replaces -# mod_rewrite rules. Best of all, Rails' \Routing works with any web server. -# Routes are defined in config/routes.rb. -# -# Think of creating routes as drawing a map for your requests. The map tells -# them where to go based on some predefined pattern: -# -# Rails.application.routes.draw do -# Pattern 1 tells some request to go to one place -# Pattern 2 tell them to go to another -# ... -# end -# -# The following symbols are special: -# -# :controller maps to your controller name -# :action maps to an action with your controllers -# -# Other names simply map to a parameter as in the case of :id. -# -# == Resources -# -# Resource routing allows you to quickly declare all of the common routes -# for a given resourceful controller. Instead of declaring separate routes -# for your +index+, +show+, +new+, +edit+, +create+, +update+, and +destroy+ -# actions, a resourceful route declares them in a single line of code: -# -# resources :photos -# -# Sometimes, you have a resource that clients always look up without -# referencing an ID. A common example, /profile always shows the profile of -# the currently logged in user. In this case, you can use a singular resource -# to map /profile (rather than /profile/:id) to the show action. -# -# resource :profile -# -# It's common to have resources that are logically children of other -# resources: -# -# resources :magazines do -# resources :ads -# end -# -# You may wish to organize groups of controllers under a namespace. Most -# commonly, you might group a number of administrative controllers under -# an +admin+ namespace. You would place these controllers under the -# app/controllers/admin directory, and you can group them together -# in your router: -# -# namespace "admin" do -# resources :posts, :comments -# end -# -# Alternatively, you can add prefixes to your path without using a separate -# directory by using +scope+. +scope+ takes additional options which -# apply to all enclosed routes. -# -# scope path: "/cpanel", as: 'admin' do -# resources :posts, :comments -# end -# -# For more, see Routing::Mapper::Resources#resources, -# Routing::Mapper::Scoping#namespace, and Routing::Mapper::Scoping#scope. -# -# == Non-resourceful routes -# -# For routes that don't fit the resources mold, you can use the HTTP helper -# methods get, post, patch, put and delete. -# -# get 'post/:id', to: 'posts#show' -# post 'post/:id', to: 'posts#create_comment' -# -# Now, if you POST to /posts/:id, it will route to the create_comment action. A GET on the same -# URL will route to the show action. -# -# If your route needs to respond to more than one HTTP method (or all methods) then using the -# :via option on match is preferable. -# -# match 'post/:id', to: 'posts#show', via: [:get, :post] -# -# == Named routes -# -# Routes can be named by passing an :as option, -# allowing for easy reference within your source as +name_of_route_url+ -# for the full URL and +name_of_route_path+ for the URI path. -# -# Example: -# -# # In config/routes.rb -# get '/login', to: 'accounts#login', as: 'login' -# -# # With render, redirect_to, tests, etc. -# redirect_to login_url -# -# Arguments can be passed as well. -# -# redirect_to show_item_path(id: 25) -# -# Use root as a shorthand to name a route for the root path "/". -# -# # In config/routes.rb -# root to: 'blogs#index' -# -# # would recognize http://www.example.com/ as -# params = { controller: 'blogs', action: 'index' } -# -# # and provide these named routes -# root_url # => 'http://www.example.com/' -# root_path # => '/' -# -# Note: when using +controller+, the route is simply named after the -# method you call on the block parameter rather than map. -# -# # In config/routes.rb -# controller :blog do -# get 'blog/show', to: :list -# get 'blog/delete', to: :delete -# get 'blog/edit', to: :edit -# end -# -# # provides named routes for show, delete, and edit -# link_to @article.title, blog_show_path(id: @article.id) -# -# == Pretty URLs -# -# Routes can generate pretty URLs. For example: -# -# get '/articles/:year/:month/:day', to: 'articles#find_by_id', constraints: { -# year: /\d{4}/, -# month: /\d{1,2}/, -# day: /\d{1,2}/ -# } -# -# Using the route above, the URL "http://localhost:3000/articles/2005/11/06" -# maps to -# -# params = {year: '2005', month: '11', day: '06'} -# -# == Regular Expressions and parameters -# You can specify a regular expression to define a format for a parameter. -# -# controller 'geocode' do -# get 'geocode/:postalcode', to: :show, constraints: { -# postalcode: /\d{5}(-\d{4})?/ -# } -# end -# -# Constraints can include the 'ignorecase' and 'extended syntax' regular -# expression modifiers: -# -# controller 'geocode' do -# get 'geocode/:postalcode', to: :show, constraints: { -# postalcode: /hx\d\d\s\d[a-z]{2}/i -# } -# end -# -# controller 'geocode' do -# get 'geocode/:postalcode', to: :show, constraints: { -# postalcode: /# Postalcode format -# \d{5} #Prefix -# (-\d{4})? #Suffix -# /x -# } -# end -# -# Using the multiline modifier will raise an +ArgumentError+. -# Encoding regular expression modifiers are silently ignored. The -# match will always use the default encoding or ASCII. -# -# == External redirects -# -# You can redirect any path to another path using the redirect helper in your router: -# -# get "/stories", to: redirect("/posts") -# -# == Unicode character routes -# -# You can specify unicode character routes in your router: -# -# get "こんにちは", to: "welcome#index" -# -# == Routing to Rack Applications -# -# Instead of a String, like posts#index, which corresponds to the -# index action in the PostsController, you can specify any Rack application -# as the endpoint for a matcher: -# -# get "/application.js", to: Sprockets -# -# == Reloading routes -# -# You can reload routes if you feel you must: -# -# Rails.application.reload_routes! -# -# This will clear all named routes and reload config/routes.rb if the file has been modified from -# last load. To absolutely force reloading, use reload!. -# -# == Testing Routes -# -# The two main methods for testing your routes: -# -# === +assert_routing+ -# -# def test_movie_route_properly_splits -# opts = {controller: "plugin", action: "checkout", id: "2"} -# assert_routing "plugin/checkout/2", opts -# end -# -# +assert_routing+ lets you test whether or not the route properly resolves into options. -# -# === +assert_recognizes+ -# -# def test_route_has_options -# opts = {controller: "plugin", action: "show", id: "12"} -# assert_recognizes opts, "/plugins/show/12" -# end -# -# Note the subtle difference between the two: +assert_routing+ tests that -# a URL fits options while +assert_recognizes+ tests that a URL -# breaks into parameters properly. -# -# In tests you can simply pass the URL or named route to +get+ or +post+. -# -# def send_to_jail -# get '/jail' -# assert_response :success -# end -# -# def goes_to_login -# get login_url -# #... -# end -# -# == View a list of all your routes -# -# rails routes -# -# Target a specific controller with -c, or grep routes -# using -g. Useful in conjunction with --expanded -# which displays routes vertically. -# -# source://actionpack//lib/action_dispatch/routing.rb#248 -module ActionDispatch::Routing - extend ::ActiveSupport::Autoload -end - -# source://actionpack//lib/action_dispatch/routing/inspector.rb#129 -module ActionDispatch::Routing::ConsoleFormatter; end - -# source://actionpack//lib/action_dispatch/routing/inspector.rb#130 -class ActionDispatch::Routing::ConsoleFormatter::Base - # @return [Base] a new instance of Base - # - # source://actionpack//lib/action_dispatch/routing/inspector.rb#131 - def initialize; end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#145 - def header(routes); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#148 - def no_routes(routes, filter); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#135 - def result; end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#142 - def section(routes); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#139 - def section_title(title); end -end - -# source://actionpack//lib/action_dispatch/routing/inspector.rb#202 -class ActionDispatch::Routing::ConsoleFormatter::Expanded < ::ActionDispatch::Routing::ConsoleFormatter::Base - # @return [Expanded] a new instance of Expanded - # - # source://actionpack//lib/action_dispatch/routing/inspector.rb#203 - def initialize(width: T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#212 - def section(routes); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#208 - def section_title(title); end - - private - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#217 - def draw_expanded_section(routes); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#229 - def route_header(index:); end -end - -# source://actionpack//lib/action_dispatch/routing/inspector.rb#166 -class ActionDispatch::Routing::ConsoleFormatter::Sheet < ::ActionDispatch::Routing::ConsoleFormatter::Base - # source://actionpack//lib/action_dispatch/routing/inspector.rb#175 - def header(routes); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#171 - def section(routes); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#167 - def section_title(title); end - - private - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#189 - def draw_header(routes); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#180 - def draw_section(routes); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#195 - def widths(routes); end -end - -# source://actionpack//lib/action_dispatch/routing/endpoint.rb#5 -class ActionDispatch::Routing::Endpoint - # source://actionpack//lib/action_dispatch/routing/endpoint.rb#9 - def app; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/endpoint.rb#6 - def dispatcher?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/endpoint.rb#12 - def engine?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/endpoint.rb#8 - def matches?(req); end - - # source://actionpack//lib/action_dispatch/routing/endpoint.rb#10 - def rack_app; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/endpoint.rb#7 - def redirect?; end -end - -# source://actionpack//lib/action_dispatch/routing.rb#258 -ActionDispatch::Routing::HTTP_METHODS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/routing/inspector.rb#235 -class ActionDispatch::Routing::HtmlTableFormatter - # @return [HtmlTableFormatter] a new instance of HtmlTableFormatter - # - # source://actionpack//lib/action_dispatch/routing/inspector.rb#236 - def initialize(view); end - - # The header is part of the HTML page, so we don't construct it here. - # - # source://actionpack//lib/action_dispatch/routing/inspector.rb#250 - def header(routes); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#253 - def no_routes(*_arg0); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#266 - def result; end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#245 - def section(routes); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#241 - def section_title(title); end -end - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#12 -class ActionDispatch::Routing::Mapper - include ::ActionDispatch::Routing::Mapper::Base - include ::ActionDispatch::Routing::Mapper::HttpHelpers - include ::ActionDispatch::Routing::Redirection - include ::ActionDispatch::Routing::Mapper::Scoping - include ::ActionDispatch::Routing::Mapper::Concerns - include ::ActionDispatch::Routing::Mapper::Resources - include ::ActionDispatch::Routing::Mapper::CustomUrls - - # @return [Mapper] a new instance of Mapper - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2279 - def initialize(set); end - - class << self - # source://actionpack//lib/action_dispatch/routing/mapper.rb#381 - def normalize_name(name); end - - # Invokes Journey::Router::Utils.normalize_path, then ensures that - # /(:locale) becomes (/:locale). Except for root cases, where the - # former is the correct one. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#364 - def normalize_path(path); end - end -end - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#385 -module ActionDispatch::Routing::Mapper::Base - # source://actionpack//lib/action_dispatch/routing/mapper.rb#618 - def default_url_options(options); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#618 - def default_url_options=(options); end - - # Query if the following named route was already defined. - # - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#630 - def has_named_route?(name); end - - # Matches a URL pattern to one or more routes. - # - # You should not use the +match+ method in your router - # without specifying an HTTP method. - # - # If you want to expose your action to both GET and POST, use: - # - # # sets :controller, :action, and :id in params - # match ':controller/:action/:id', via: [:get, :post] - # - # Note that +:controller+, +:action+, and +:id+ are interpreted as URL - # query parameters and thus available through +params+ in an action. - # - # If you want to expose your action to GET, use +get+ in the router: - # - # Instead of: - # - # match ":controller/:action/:id" - # - # Do: - # - # get ":controller/:action/:id" - # - # Two of these symbols are special, +:controller+ maps to the controller - # and +:action+ to the controller's action. A pattern can also map - # wildcard segments (globs) to params: - # - # get 'songs/*category/:title', to: 'songs#show' - # - # # 'songs/rock/classic/stairway-to-heaven' sets - # # params[:category] = 'rock/classic' - # # params[:title] = 'stairway-to-heaven' - # - # To match a wildcard parameter, it must have a name assigned to it. - # Without a variable name to attach the glob parameter to, the route - # can't be parsed. - # - # When a pattern points to an internal route, the route's +:action+ and - # +:controller+ should be set in options or hash shorthand. Examples: - # - # match 'photos/:id' => 'photos#show', via: :get - # match 'photos/:id', to: 'photos#show', via: :get - # match 'photos/:id', controller: 'photos', action: 'show', via: :get - # - # A pattern can also point to a +Rack+ endpoint i.e. anything that - # responds to +call+: - # - # match 'photos/:id', to: -> (hash) { [200, {}, ["Coming soon"]] }, via: :get - # match 'photos/:id', to: PhotoRackApp, via: :get - # # Yes, controller actions are just rack endpoints - # match 'photos/:id', to: PhotosController.action(:show), via: :get - # - # Because requesting various HTTP verbs with a single action has security - # implications, you must either specify the actions in - # the via options or use one of the HttpHelpers[rdoc-ref:HttpHelpers] - # instead +match+ - # - # === Options - # - # Any options not seen here are passed on as params with the URL. - # - # [:controller] - # The route's controller. - # - # [:action] - # The route's action. - # - # [:param] - # Overrides the default resource identifier +:id+ (name of the - # dynamic segment used to generate the routes). - # You can access that segment from your controller using - # params[<:param>]. - # In your router: - # - # resources :users, param: :name - # - # The +users+ resource here will have the following routes generated for it: - # - # GET /users(.:format) - # POST /users(.:format) - # GET /users/new(.:format) - # GET /users/:name/edit(.:format) - # GET /users/:name(.:format) - # PATCH/PUT /users/:name(.:format) - # DELETE /users/:name(.:format) - # - # You can override ActiveRecord::Base#to_param of a related - # model to construct a URL: - # - # class User < ActiveRecord::Base - # def to_param - # name - # end - # end - # - # user = User.find_by(name: 'Phusion') - # user_path(user) # => "/users/Phusion" - # - # [:path] - # The path prefix for the routes. - # - # [:module] - # The namespace for :controller. - # - # match 'path', to: 'c#a', module: 'sekret', controller: 'posts', via: :get - # # => Sekret::PostsController - # - # See Scoping#namespace for its scope equivalent. - # - # [:as] - # The name used to generate routing helpers. - # - # [:via] - # Allowed HTTP verb(s) for route. - # - # match 'path', to: 'c#a', via: :get - # match 'path', to: 'c#a', via: [:get, :post] - # match 'path', to: 'c#a', via: :all - # - # [:to] - # Points to a +Rack+ endpoint. Can be an object that responds to - # +call+ or a string representing a controller's action. - # - # match 'path', to: 'controller#action', via: :get - # match 'path', to: -> (env) { [200, {}, ["Success!"]] }, via: :get - # match 'path', to: RackApp, via: :get - # - # [:on] - # Shorthand for wrapping routes in a specific RESTful context. Valid - # values are +:member+, +:collection+, and +:new+. Only use within - # resource(s) block. For example: - # - # resource :bar do - # match 'foo', to: 'c#a', on: :member, via: [:get, :post] - # end - # - # Is equivalent to: - # - # resource :bar do - # member do - # match 'foo', to: 'c#a', via: [:get, :post] - # end - # end - # - # [:constraints] - # Constrains parameters with a hash of regular expressions - # or an object that responds to matches?. In addition, constraints - # other than path can also be specified with any object - # that responds to === (e.g. String, Array, Range, etc.). - # - # match 'path/:id', constraints: { id: /[A-Z]\d{5}/ }, via: :get - # - # match 'json_only', constraints: { format: 'json' }, via: :get - # - # class PermitList - # def matches?(request) request.remote_ip == '1.2.3.4' end - # end - # match 'path', to: 'c#a', constraints: PermitList.new, via: :get - # - # See Scoping#constraints for more examples with its scope - # equivalent. - # - # [:defaults] - # Sets defaults for parameters - # - # # Sets params[:format] to 'jpg' by default - # match 'path', to: 'c#a', defaults: { format: 'jpg' }, via: :get - # - # See Scoping#defaults for its scope equivalent. - # - # [:anchor] - # Boolean to anchor a match pattern. Default is true. When set to - # false, the pattern matches any request prefixed with the given path. - # - # # Matches any request starting with 'path' - # match 'path', to: 'c#a', anchor: false, via: :get - # - # [:format] - # Allows you to specify the default value for optional +format+ - # segment or disable it by supplying +false+. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#566 - def match(path, options = T.unsafe(nil)); end - - # Mount a Rack-based application to be used within the application. - # - # mount SomeRackApp, at: "some_route" - # - # Alternatively: - # - # mount(SomeRackApp => "some_route") - # - # For options, see +match+, as +mount+ uses it internally. - # - # All mounted applications come with routing helpers to access them. - # These are named after the class specified, so for the above example - # the helper is either +some_rack_app_path+ or +some_rack_app_url+. - # To customize this helper's name, use the +:as+ option: - # - # mount(SomeRackApp => "some_route", as: "exciting") - # - # This will generate the +exciting_path+ and +exciting_url+ helpers - # which can be used to navigate to this mounted app. - # - # @raise [ArgumentError] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#588 - def mount(app, options = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#623 - def with_default_scope(scope, &block); end - - private - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#639 - def app_name(app, rails_app); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#648 - def define_generate_prefix(app, name); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#635 - def rails_app?(app); end -end - -# Routing Concerns allow you to declare common routes that can be reused -# inside others resources and routes. -# -# concern :commentable do -# resources :comments -# end -# -# concern :image_attachable do -# resources :images, only: :index -# end -# -# These concerns are used in Resources routing: -# -# resources :messages, concerns: [:commentable, :image_attachable] -# -# or in a scope or namespace: -# -# namespace :posts do -# concerns :commentable -# end -# -# source://actionpack//lib/action_dispatch/routing/mapper.rb#1991 -module ActionDispatch::Routing::Mapper::Concerns - # Define a routing concern using a name. - # - # Concerns may be defined inline, using a block, or handled by - # another object, by passing that object as the second parameter. - # - # The concern object, if supplied, should respond to call, - # which will receive two parameters: - # - # * The current mapper - # * A hash of options which the concern object may use - # - # Options may also be used by concerns defined in a block by accepting - # a block parameter. So, using a block, you might do something as - # simple as limit the actions available on certain resources, passing - # standard resource options through the concern: - # - # concern :commentable do |options| - # resources :comments, options - # end - # - # resources :posts, concerns: :commentable - # resources :archived_posts do - # # Don't allow comments on archived posts - # concerns :commentable, only: [:index, :show] - # end - # - # Or, using a callable object, you might implement something more - # specific to your application, which would be out of place in your - # routes file. - # - # # purchasable.rb - # class Purchasable - # def initialize(defaults = {}) - # @defaults = defaults - # end - # - # def call(mapper, options = {}) - # options = @defaults.merge(options) - # mapper.resources :purchases - # mapper.resources :receipts - # mapper.resources :returns if options[:returnable] - # end - # end - # - # # routes.rb - # concern :purchasable, Purchasable.new(returnable: true) - # - # resources :toys, concerns: :purchasable - # resources :electronics, concerns: :purchasable - # resources :pets do - # concerns :purchasable, returnable: false - # end - # - # Any routing helpers can be used inside a concern. If using a - # callable, they're accessible from the Mapper that's passed to - # call. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2048 - def concern(name, callable = T.unsafe(nil), &block); end - - # Use the named concerns - # - # resources :posts do - # concerns :commentable - # end - # - # Concerns also work in any routes helper that you want to use: - # - # namespace :posts do - # concerns :commentable - # end - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2064 - def concerns(*args); end -end - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#15 -class ActionDispatch::Routing::Mapper::Constraints < ::ActionDispatch::Routing::Endpoint - # @return [Constraints] a new instance of Constraints - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#21 - def initialize(app, constraints, strategy); end - - # Returns the value of attribute app. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#16 - def app; end - - # Returns the value of attribute constraints. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#16 - def constraints; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#36 - def dispatcher?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#38 - def matches?(req); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#45 - def serve(req); end - - private - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#52 - def constraint_args(constraint, request); end -end - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#19 -ActionDispatch::Routing::Mapper::Constraints::CALL = T.let(T.unsafe(nil), Proc) - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#18 -ActionDispatch::Routing::Mapper::Constraints::SERVE = T.let(T.unsafe(nil), Proc) - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#2076 -module ActionDispatch::Routing::Mapper::CustomUrls - # Define custom URL helpers that will be added to the application's - # routes. This allows you to override and/or replace the default behavior - # of routing helpers, e.g: - # - # direct :homepage do - # "https://rubyonrails.org" - # end - # - # direct :commentable do |model| - # [ model, anchor: model.dom_id ] - # end - # - # direct :main do - # { controller: "pages", action: "index", subdomain: "www" } - # end - # - # The return value from the block passed to +direct+ must be a valid set of - # arguments for +url_for+ which will actually build the URL string. This can - # be one of the following: - # - # * A string, which is treated as a generated URL - # * A hash, e.g. { controller: "pages", action: "index" } - # * An array, which is passed to +polymorphic_url+ - # * An Active Model instance - # * An Active Model class - # - # NOTE: Other URL helpers can be called in the block but be careful not to invoke - # your custom URL helper again otherwise it will result in a stack overflow error. - # - # You can also specify default options that will be passed through to - # your URL helper definition, e.g: - # - # direct :browse, page: 1, size: 10 do |options| - # [ :products, options.merge(params.permit(:page, :size).to_h.symbolize_keys) ] - # end - # - # In this instance the +params+ object comes from the context in which the - # block is executed, e.g. generating a URL inside a controller action or a view. - # If the block is executed where there isn't a +params+ object such as this: - # - # Rails.application.routes.url_helpers.browse_path - # - # then it will raise a +NameError+. Because of this you need to be aware of the - # context in which you will use your custom URL helper when defining it. - # - # NOTE: The +direct+ method can't be used inside of a scope block such as - # +namespace+ or +scope+ and will raise an error if it detects that it is. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2124 - def direct(name, options = T.unsafe(nil), &block); end - - # Define custom polymorphic mappings of models to URLs. This alters the - # behavior of +polymorphic_url+ and consequently the behavior of - # +link_to+ and +form_for+ when passed a model instance, e.g: - # - # resource :basket - # - # resolve "Basket" do - # [:basket] - # end - # - # This will now generate "/basket" when a +Basket+ instance is passed to - # +link_to+ or +form_for+ instead of the standard "/baskets/:id". - # - # NOTE: This custom behavior only applies to simple polymorphic URLs where - # a single model instance is passed and not more complicated forms, e.g: - # - # # config/routes.rb - # resource :profile - # namespace :admin do - # resources :users - # end - # - # resolve("User") { [:profile] } - # - # # app/views/application/_menu.html.erb - # link_to "Profile", @current_user - # link_to "Profile", [:admin, @current_user] - # - # The first +link_to+ will generate "/profile" but the second will generate - # the standard polymorphic URL of "/admin/users/1". - # - # You can pass options to a polymorphic mapping - the arity for the block - # needs to be two as the instance is passed as the first argument, e.g: - # - # resolve "Basket", anchor: "items" do |basket, options| - # [:basket, options] - # end - # - # This generates the URL "/basket#items" because when the last item in an - # array passed to +polymorphic_url+ is a hash then it's treated as options - # to the URL helper that gets called. - # - # NOTE: The +resolve+ method can't be used inside of a scope block such as - # +namespace+ or +scope+ and will raise an error if it detects that it is. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2176 - def resolve(*args, &block); end -end - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#682 -module ActionDispatch::Routing::Mapper::HttpHelpers - # Define a route that only recognizes HTTP DELETE. - # For supported arguments, see match[rdoc-ref:Base#match] - # - # delete 'broccoli', to: 'food#broccoli' - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#719 - def delete(*args, &block); end - - # Define a route that only recognizes HTTP GET. - # For supported arguments, see match[rdoc-ref:Base#match] - # - # get 'bacon', to: 'food#bacon' - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#687 - def get(*args, &block); end - - # Define a route that only recognizes HTTP OPTIONS. - # For supported arguments, see match[rdoc-ref:Base#match] - # - # options 'carrots', to: 'food#carrots' - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#727 - def options(*args, &block); end - - # Define a route that only recognizes HTTP PATCH. - # For supported arguments, see match[rdoc-ref:Base#match] - # - # patch 'bacon', to: 'food#bacon' - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#703 - def patch(*args, &block); end - - # Define a route that only recognizes HTTP POST. - # For supported arguments, see match[rdoc-ref:Base#match] - # - # post 'bacon', to: 'food#bacon' - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#695 - def post(*args, &block); end - - # Define a route that only recognizes HTTP PUT. - # For supported arguments, see match[rdoc-ref:Base#match] - # - # put 'bacon', to: 'food#bacon' - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#711 - def put(*args, &block); end - - private - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#732 - def map_method(method, args, &block); end -end - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#69 -class ActionDispatch::Routing::Mapper::Mapping - # @return [Mapping] a new instance of Mapping - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#118 - def initialize(set:, ast:, controller:, default_action:, to:, formatted:, via:, options_constraints:, anchor:, scope_params:, options:); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#176 - def application; end - - # Returns the value of attribute ast. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 - def ast; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#180 - def conditions; end - - # Returns the value of attribute default_action. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 - def default_action; end - - # Returns the value of attribute default_controller. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 - def default_controller; end - - # Returns the value of attribute defaults. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 - def defaults; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#169 - def make_route(name, precedence); end - - # Returns the value of attribute path. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 - def path; end - - # Returns the value of attribute required_defaults. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 - def required_defaults; end - - # Returns the value of attribute requirements. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 - def requirements; end - - # Returns the value of attribute scope_options. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 - def scope_options; end - - # Returns the value of attribute to. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#73 - def to; end - - private - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#316 - def add_controller_module(controller, modyoule); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#269 - def app(blocks); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#335 - def blocks(callable_constraint); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#184 - def build_conditions(current_conditions, request_class); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#281 - def check_controller_and_action(path_params, controller, action); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#296 - def check_part(name, part, path_params, hash); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#342 - def constraints(options, path_params); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#356 - def dispatcher(raise_on_name_error); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#199 - def intern(object); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#265 - def normalize_defaults(options); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#233 - def normalize_format(formatted); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#203 - def normalize_options!(options, path_params, modyoule); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#193 - def request_method; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#227 - def split_constraints(path_params, constraints); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#308 - def split_to(to); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#328 - def translate_controller(controller); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#249 - def verify_regexp_requirements(requirements, wildcard_options); end - - class << self - # source://actionpack//lib/action_dispatch/routing/mapper.rb#76 - def build(scope, set, ast, controller, default_action, to, via, formatted, options_constraints, anchor, options); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#90 - def check_via(via); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#102 - def normalize_path(path, format); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#114 - def optional_format?(path, format); end - end -end - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#70 -ActionDispatch::Routing::Mapper::Mapping::ANCHOR_CHARACTERS_REGEX = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#167 -ActionDispatch::Routing::Mapper::Mapping::JOINED_SEPARATORS = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#71 -ActionDispatch::Routing::Mapper::Mapping::OPTIONAL_FORMAT_REGEX = T.let(T.unsafe(nil), Regexp) - -# Resource routing allows you to quickly declare all of the common routes -# for a given resourceful controller. Instead of declaring separate routes -# for your +index+, +show+, +new+, +edit+, +create+, +update+, and +destroy+ -# actions, a resourceful route declares them in a single line of code: -# -# resources :photos -# -# Sometimes, you have a resource that clients always look up without -# referencing an ID. A common example, /profile always shows the profile of -# the currently logged in user. In this case, you can use a singular resource -# to map /profile (rather than /profile/:id) to the show action. -# -# resource :profile -# -# It's common to have resources that are logically children of other -# resources: -# -# resources :magazines do -# resources :ads -# end -# -# You may wish to organize groups of controllers under a namespace. Most -# commonly, you might group a number of administrative controllers under -# an +admin+ namespace. You would place these controllers under the -# app/controllers/admin directory, and you can group them together -# in your router: -# -# namespace "admin" do -# resources :posts, :comments -# end -# -# By default the +:id+ parameter doesn't accept dots. If you need to -# use dots as part of the +:id+ parameter add a constraint which -# overrides this restriction, e.g: -# -# resources :articles, id: /[^\/]+/ -# -# This allows any character other than a slash as part of your +:id+. -# -# source://actionpack//lib/action_dispatch/routing/mapper.rb#1122 -module ActionDispatch::Routing::Mapper::Resources - # To add a route to the collection: - # - # resources :photos do - # collection do - # get 'search' - # end - # end - # - # This will enable Rails to recognize paths such as /photos/search - # with GET, and route to the search action of +PhotosController+. It will also - # create the search_photos_url and search_photos_path - # route helpers. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1500 - def collection(&block); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1587 - def draw(name); end - - # Matches a URL pattern to one or more routes. - # For more information, see match[rdoc-ref:Base#match]. - # - # match 'path' => 'controller#action', via: :patch - # match 'path', to: 'controller#action', via: :post - # match 'path', 'otherpath', on: :member, via: :get - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1609 - def match(path, *rest, &block); end - - # To add a member route, add a member block into the resource block: - # - # resources :photos do - # member do - # get 'preview' - # end - # end - # - # This will recognize /photos/1/preview with GET, and route to the - # preview action of +PhotosController+. It will also create the - # preview_photo_url and preview_photo_path helpers. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1521 - def member(&block); end - - # See ActionDispatch::Routing::Mapper::Scoping#namespace. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1568 - def namespace(path, options = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1547 - def nested(&block); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1537 - def new(&block); end - - # Sometimes, you have a resource that clients always look up without - # referencing an ID. A common example, /profile always shows the - # profile of the currently logged in user. In this case, you can use - # a singular resource to map /profile (rather than /profile/:id) to - # the show action: - # - # resource :profile - # - # This creates six different routes in your application, all mapping to - # the +Profiles+ controller (note that the controller is named after - # the plural): - # - # GET /profile/new - # GET /profile - # GET /profile/edit - # PATCH/PUT /profile - # DELETE /profile - # POST /profile - # - # If you want instances of a model to work with this resource via - # record identification (e.g. in +form_with+ or +redirect_to+), you - # will need to call resolve[rdoc-ref:CustomUrls#resolve]: - # - # resource :profile - # resolve('Profile') { [:profile] } - # - # # Enables this to work with singular routes: - # form_with(model: @profile) {} - # - # === Options - # Takes same options as resources[rdoc-ref:#resources] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1292 - def resource(*resources, &block); end - - # In Rails, a resourceful route provides a mapping between HTTP verbs - # and URLs and controller actions. By convention, each action also maps - # to particular CRUD operations in a database. A single entry in the - # routing file, such as - # - # resources :photos - # - # creates seven different routes in your application, all mapping to - # the +Photos+ controller: - # - # GET /photos - # GET /photos/new - # POST /photos - # GET /photos/:id - # GET /photos/:id/edit - # PATCH/PUT /photos/:id - # DELETE /photos/:id - # - # Resources can also be nested infinitely by using this block syntax: - # - # resources :photos do - # resources :comments - # end - # - # This generates the following comments routes: - # - # GET /photos/:photo_id/comments - # GET /photos/:photo_id/comments/new - # POST /photos/:photo_id/comments - # GET /photos/:photo_id/comments/:id - # GET /photos/:photo_id/comments/:id/edit - # PATCH/PUT /photos/:photo_id/comments/:id - # DELETE /photos/:photo_id/comments/:id - # - # === Options - # Takes same options as match[rdoc-ref:Base#match] as well as: - # - # [:path_names] - # Allows you to change the segment component of the +edit+ and +new+ actions. - # Actions not specified are not changed. - # - # resources :posts, path_names: { new: "brand_new" } - # - # The above example will now change /posts/new to /posts/brand_new. - # - # [:path] - # Allows you to change the path prefix for the resource. - # - # resources :posts, path: 'postings' - # - # The resource and all segments will now route to /postings instead of /posts. - # - # [:only] - # Only generate routes for the given actions. - # - # resources :cows, only: :show - # resources :cows, only: [:show, :index] - # - # [:except] - # Generate all routes except for the given actions. - # - # resources :cows, except: :show - # resources :cows, except: [:show, :index] - # - # [:shallow] - # Generates shallow routes for nested resource(s). When placed on a parent resource, - # generates shallow routes for all nested resources. - # - # resources :posts, shallow: true do - # resources :comments - # end - # - # Is the same as: - # - # resources :posts do - # resources :comments, except: [:show, :edit, :update, :destroy] - # end - # resources :comments, only: [:show, :edit, :update, :destroy] - # - # This allows URLs for resources that otherwise would be deeply nested such - # as a comment on a blog post like /posts/a-long-permalink/comments/1234 - # to be shortened to just /comments/1234. - # - # Set shallow: false on a child resource to ignore a parent's shallow parameter. - # - # [:shallow_path] - # Prefixes nested shallow routes with the specified path. - # - # scope shallow_path: "sekret" do - # resources :posts do - # resources :comments, shallow: true - # end - # end - # - # The +comments+ resource here will have the following routes generated for it: - # - # post_comments GET /posts/:post_id/comments(.:format) - # post_comments POST /posts/:post_id/comments(.:format) - # new_post_comment GET /posts/:post_id/comments/new(.:format) - # edit_comment GET /sekret/comments/:id/edit(.:format) - # comment GET /sekret/comments/:id(.:format) - # comment PATCH/PUT /sekret/comments/:id(.:format) - # comment DELETE /sekret/comments/:id(.:format) - # - # [:shallow_prefix] - # Prefixes nested shallow route names with specified prefix. - # - # scope shallow_prefix: "sekret" do - # resources :posts do - # resources :comments, shallow: true - # end - # end - # - # The +comments+ resource here will have the following routes generated for it: - # - # post_comments GET /posts/:post_id/comments(.:format) - # post_comments POST /posts/:post_id/comments(.:format) - # new_post_comment GET /posts/:post_id/comments/new(.:format) - # edit_sekret_comment GET /comments/:id/edit(.:format) - # sekret_comment GET /comments/:id(.:format) - # sekret_comment PATCH/PUT /comments/:id(.:format) - # sekret_comment DELETE /comments/:id(.:format) - # - # [:format] - # Allows you to specify the default value for optional +format+ - # segment or disable it by supplying +false+. - # - # [:param] - # Allows you to override the default param name of +:id+ in the URL. - # - # === Examples - # - # # routes call Admin::PostsController - # resources :posts, module: "admin" - # - # # resource actions are at /admin/posts. - # resources :posts, path: "admin/posts" - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1458 - def resources(*resources, &block); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1257 - def resources_path_names(options); end - - # You can specify what Rails should route "/" to with the root method: - # - # root to: 'pages#main' - # - # For options, see +match+, as +root+ uses it internally. - # - # You can also pass a string which will expand - # - # root 'pages#main' - # - # You should put the root route at the top of config/routes.rb, - # because this means it will be matched first. As this is the most popular route - # of most Rails applications, this is beneficial. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1656 - def root(path, options = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1576 - def shallow; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1583 - def shallow?; end - - private - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1720 - def action_options?(options); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1802 - def action_path(name); end - - # @raise [ArgumentError] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1938 - def add_route(action, controller, options, _path, to, via, formatted, anchor, options_constraints); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1856 - def api_only?; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1715 - def apply_action_options(options); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1681 - def apply_common_behavior_for(method, resources, options, &block); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1778 - def canonical_action?(action); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1923 - def decomposed_match(path, controller, options, _path, to, via, formatted, anchor, options_constraints); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1908 - def get_to_from_path(path, to, action); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1867 - def map_match(paths, options); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1965 - def match_root_route(options); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1818 - def name_for_action(as, action); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1755 - def nested_options; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1736 - def nested_scope?; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1774 - def param_constraint; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1770 - def param_constraint?; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1677 - def parent_resource; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1792 - def path_for_action(action, path); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1860 - def path_scope(path); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1806 - def prefix_name_for_action(as, action); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1732 - def resource_method_scope?; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1747 - def resource_scope(resource, &block); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1728 - def resource_scope?; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1724 - def scope_action_options; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1844 - def set_member_mappings_for_resource; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1764 - def shallow_nesting_depth; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1782 - def shallow_scope; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1919 - def using_match_shorthand?(path); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1740 - def with_scope_level(kind); end -end - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#1127 -ActionDispatch::Routing::Mapper::Resources::CANONICAL_ACTIONS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#1126 -ActionDispatch::Routing::Mapper::Resources::RESOURCE_OPTIONS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#1129 -class ActionDispatch::Routing::Mapper::Resources::Resource - # @return [Resource] a new instance of Resource - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1132 - def initialize(entities, api_only, shallow, options = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1157 - def actions; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1165 - def available_actions; end - - # Checks for uncountable plurals, and appends "_index" if the plural - # and singular form are the same. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1189 - def collection_name; end - - # Returns the value of attribute path. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1130 - def collection_scope; end - - # Returns the value of attribute controller. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1130 - def controller; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1149 - def default_actions; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1181 - def member_name; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1199 - def member_scope; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1173 - def name; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1209 - def nested_param; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1213 - def nested_scope; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1205 - def new_scope(new_path); end - - # Returns the value of attribute param. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1130 - def param; end - - # Returns the value of attribute path. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1130 - def path; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1177 - def plural; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1193 - def resource_scope; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1217 - def shallow?; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1199 - def shallow_scope; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1221 - def singleton?; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1181 - def singular; end -end - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#1224 -class ActionDispatch::Routing::Mapper::Resources::SingletonResource < ::ActionDispatch::Routing::Mapper::Resources::Resource - # @return [SingletonResource] a new instance of SingletonResource - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1225 - def initialize(entities, api_only, shallow, options); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1244 - def collection_name; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1232 - def default_actions; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1244 - def member_name; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1130 - def member_scope; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1130 - def nested_scope; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1240 - def plural; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1254 - def singleton?; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1244 - def singular; end -end - -# CANONICAL_ACTIONS holds all actions that does not need a prefix or -# a path appended since they fit properly in their scope level. -# -# source://actionpack//lib/action_dispatch/routing/mapper.rb#1125 -ActionDispatch::Routing::Mapper::Resources::VALID_ON_OPTIONS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#2190 -class ActionDispatch::Routing::Mapper::Scope - include ::Enumerable - - # @return [Scope] a new instance of Scope - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2200 - def initialize(hash, parent = T.unsafe(nil), scope_level = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2259 - def [](key); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2226 - def action_name(name_prefix, prefix, collection_name, member_name); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2266 - def each; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2274 - def frame; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2206 - def nested?; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2251 - def new(hash); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2255 - def new_level(level); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2210 - def null?; end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2247 - def options; end - - # Returns the value of attribute parent. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2198 - def parent; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2222 - def resource_method_scope?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2243 - def resource_scope?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2218 - def resources?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2214 - def root?; end - - # Returns the value of attribute scope_level. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#2198 - def scope_level; end -end - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#2276 -ActionDispatch::Routing::Mapper::Scope::NULL = T.let(T.unsafe(nil), ActionDispatch::Routing::Mapper::Scope) - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#2191 -ActionDispatch::Routing::Mapper::Scope::OPTIONS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#2196 -ActionDispatch::Routing::Mapper::Scope::RESOURCE_METHOD_SCOPES = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#2195 -ActionDispatch::Routing::Mapper::Scope::RESOURCE_SCOPES = T.let(T.unsafe(nil), Array) - -# You may wish to organize groups of controllers under a namespace. -# Most commonly, you might group a number of administrative controllers -# under an +admin+ namespace. You would place these controllers under -# the app/controllers/admin directory, and you can group them -# together in your router: -# -# namespace "admin" do -# resources :posts, :comments -# end -# -# This will create a number of routes for each of the posts and comments -# controller. For Admin::PostsController, Rails will create: -# -# GET /admin/posts -# GET /admin/posts/new -# POST /admin/posts -# GET /admin/posts/1 -# GET /admin/posts/1/edit -# PATCH/PUT /admin/posts/1 -# DELETE /admin/posts/1 -# -# If you want to route /posts (without the prefix /admin) to -# Admin::PostsController, you could use -# -# scope module: "admin" do -# resources :posts -# end -# -# or, for a single case -# -# resources :posts, module: "admin" -# -# If you want to route /admin/posts to +PostsController+ -# (without the Admin:: module prefix), you could use -# -# scope "/admin" do -# resources :posts -# end -# -# or, for a single case -# -# resources :posts, path: "/admin/posts" -# -# In each of these cases, the named routes remain the same as if you did -# not use scope. In the last case, the following paths map to -# +PostsController+: -# -# GET /admin/posts -# GET /admin/posts/new -# POST /admin/posts -# GET /admin/posts/1 -# GET /admin/posts/1/edit -# PATCH/PUT /admin/posts/1 -# DELETE /admin/posts/1 -# -# source://actionpack//lib/action_dispatch/routing/mapper.rb#794 -module ActionDispatch::Routing::Mapper::Scoping - # === Parameter Restriction - # Allows you to constrain the nested routes based on a set of rules. - # For instance, in order to change the routes to allow for a dot character in the +id+ parameter: - # - # constraints(id: /\d+\.\d+/) do - # resources :posts - # end - # - # Now routes such as +/posts/1+ will no longer be valid, but +/posts/1.1+ will be. - # The +id+ parameter must match the constraint passed in for this example. - # - # You may use this to also restrict other parameters: - # - # resources :posts do - # constraints(post_id: /\d+\.\d+/) do - # resources :comments - # end - # end - # - # === Restricting based on IP - # - # Routes can also be constrained to an IP or a certain range of IP addresses: - # - # constraints(ip: /192\.168\.\d+\.\d+/) do - # resources :posts - # end - # - # Any user connecting from the 192.168.* range will be able to see this resource, - # where as any user connecting outside of this range will be told there is no such route. - # - # === Dynamic request matching - # - # Requests to routes can be constrained based on specific criteria: - # - # constraints(-> (req) { /iPhone/.match?(req.env["HTTP_USER_AGENT"]) }) do - # resources :iphones - # end - # - # You are able to move this logic out into a class if it is too complex for routes. - # This class must have a +matches?+ method defined on it which either returns +true+ - # if the user should be given access to that route, or +false+ if the user should not. - # - # class Iphone - # def self.matches?(request) - # /iPhone/.match?(request.env["HTTP_USER_AGENT"]) - # end - # end - # - # An expected place for this code would be +lib/constraints+. - # - # This class is then used like this: - # - # constraints(Iphone) do - # resources :iphones - # end - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#999 - def constraints(constraints = T.unsafe(nil), &block); end - - # Scopes routes to a specific controller - # - # controller "food" do - # match "bacon", action: :bacon, via: :get - # end - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#884 - def controller(controller); end - - # Allows you to set default parameters for a route, such as this: - # defaults id: 'home' do - # match 'scoped_pages/(:id)', to: 'pages#show' - # end - # Using this, the +:id+ parameter here will default to 'home'. - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1008 - def defaults(defaults = T.unsafe(nil)); end - - # Scopes routes to a specific namespace. For example: - # - # namespace :admin do - # resources :posts - # end - # - # This generates the following routes: - # - # admin_posts GET /admin/posts(.:format) admin/posts#index - # admin_posts POST /admin/posts(.:format) admin/posts#create - # new_admin_post GET /admin/posts/new(.:format) admin/posts#new - # edit_admin_post GET /admin/posts/:id/edit(.:format) admin/posts#edit - # admin_post GET /admin/posts/:id(.:format) admin/posts#show - # admin_post PATCH/PUT /admin/posts/:id(.:format) admin/posts#update - # admin_post DELETE /admin/posts/:id(.:format) admin/posts#destroy - # - # === Options - # - # The +:path+, +:as+, +:module+, +:shallow_path+, and +:shallow_prefix+ - # options all default to the name of the namespace. - # - # For options, see Base#match. For +:shallow_path+ option, see - # Resources#resources. - # - # # accessible through /sekret/posts rather than /admin/posts - # namespace :admin, path: "sekret" do - # resources :posts - # end - # - # # maps to Sekret::PostsController rather than Admin::PostsController - # namespace :admin, module: "sekret" do - # resources :posts - # end - # - # # generates +sekret_posts_path+ rather than +admin_posts_path+ - # namespace :admin, as: "sekret" do - # resources :posts - # end - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#929 - def namespace(path, options = T.unsafe(nil), &block); end - - # Scopes a set of routes to the given default options. - # - # Take the following route definition as an example: - # - # scope path: ":account_id", as: "account" do - # resources :projects - # end - # - # This generates helpers such as +account_projects_path+, just like +resources+ does. - # The difference here being that the routes generated are like /:account_id/projects, - # rather than /accounts/:account_id/projects. - # - # === Options - # - # Takes same options as Base#match and Resources#resources. - # - # # route /posts (without the prefix /admin) to Admin::PostsController - # scope module: "admin" do - # resources :posts - # end - # - # # prefix the posts resource's requests with '/admin' - # scope path: "/admin" do - # resources :posts - # end - # - # # prefix the routing helper name: +sekret_posts_path+ instead of +posts_path+ - # scope as: "sekret" do - # resources :posts - # end - # - # source://actionpack//lib/action_dispatch/routing/mapper.rb#825 - def scope(*args); end - - private - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1040 - def merge_action_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1024 - def merge_as_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1064 - def merge_blocks_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1056 - def merge_constraints_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1036 - def merge_controller_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1060 - def merge_defaults_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1048 - def merge_format_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1032 - def merge_module_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1070 - def merge_options_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1052 - def merge_path_names_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1016 - def merge_path_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1020 - def merge_shallow_path_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1028 - def merge_shallow_prefix_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1074 - def merge_shallow_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1078 - def merge_to_scope(parent, child); end - - # source://actionpack//lib/action_dispatch/routing/mapper.rb#1044 - def merge_via_scope(parent, child); end -end - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#877 -ActionDispatch::Routing::Mapper::Scoping::POISON = T.let(T.unsafe(nil), Object) - -# source://actionpack//lib/action_dispatch/routing/mapper.rb#13 -ActionDispatch::Routing::Mapper::URL_OPTIONS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/routing/redirection.rb#103 -class ActionDispatch::Routing::OptionRedirect < ::ActionDispatch::Routing::Redirect - # source://actionpack//lib/action_dispatch/routing/redirection.rb#132 - def inspect; end - - # source://actionpack//lib/action_dispatch/routing/redirection.rb#11 - def options; end - - # source://actionpack//lib/action_dispatch/routing/redirection.rb#106 - def path(params, request); end -end - -# source://actionpack//lib/action_dispatch/routing/redirection.rb#78 -class ActionDispatch::Routing::PathRedirect < ::ActionDispatch::Routing::Redirect - # source://actionpack//lib/action_dispatch/routing/redirection.rb#93 - def inspect; end - - # source://actionpack//lib/action_dispatch/routing/redirection.rb#81 - def path(params, request); end - - private - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/redirection.rb#98 - def interpolation_required?(string, params); end -end - -# source://actionpack//lib/action_dispatch/routing/redirection.rb#79 -ActionDispatch::Routing::PathRedirect::URL_PARTS = T.let(T.unsafe(nil), Regexp) - -# Polymorphic URL helpers are methods for smart resolution to a named route call when -# given an Active Record model instance. They are to be used in combination with -# ActionController::Resources. -# -# These methods are useful when you want to generate the correct URL or path to a RESTful -# resource without having to know the exact type of the record in question. -# -# Nested resources and/or namespaces are also supported, as illustrated in the example: -# -# polymorphic_url([:admin, @article, @comment]) -# -# results in: -# -# admin_article_comment_url(@article, @comment) -# -# == Usage within the framework -# -# Polymorphic URL helpers are used in a number of places throughout the \Rails framework: -# -# * url_for, so you can use it with a record as the argument, e.g. -# url_for(@article); -# * ActionView::Helpers::FormHelper uses polymorphic_path, so you can write -# form_for(@article) without having to specify :url parameter for the form -# action; -# * redirect_to (which, in fact, uses url_for) so you can write -# redirect_to(post) in your controllers; -# * ActionView::Helpers::AtomFeedHelper, so you don't have to explicitly specify URLs -# for feed entries. -# -# == Prefixed polymorphic helpers -# -# In addition to polymorphic_url and polymorphic_path methods, a -# number of prefixed helpers are available as a shorthand to action: "..." -# in options. Those are: -# -# * edit_polymorphic_url, edit_polymorphic_path -# * new_polymorphic_url, new_polymorphic_path -# -# Example usage: -# -# edit_polymorphic_path(@post) # => "/posts/1/edit" -# polymorphic_path(@post, format: :pdf) # => "/posts/1.pdf" -# -# == Usage with mounted engines -# -# If you are using a mounted engine and you need to use a polymorphic_url -# pointing at the engine's routes, pass in the engine's route proxy as the first -# argument to the method. For example: -# -# polymorphic_url([blog, @post]) # calls blog.post_path(@post) -# form_for([blog, @post]) # => "/blog/posts/1" -# -# source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#57 -module ActionDispatch::Routing::PolymorphicRoutes - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#153 - def edit_polymorphic_path(record_or_hash, options = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#149 - def edit_polymorphic_url(record_or_hash, options = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#153 - def new_polymorphic_path(record_or_hash, options = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#149 - def new_polymorphic_url(record_or_hash, options = T.unsafe(nil)); end - - # Returns the path component of a URL for the given record. - # - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#124 - def polymorphic_path(record_or_hash_or_array, options = T.unsafe(nil)); end - - # Constructs a call to a named RESTful route for the given record and returns the - # resulting URL string. For example: - # - # # calls post_url(post) - # polymorphic_url(post) # => "http://example.com/posts/1" - # polymorphic_url([blog, post]) # => "http://example.com/blogs/1/posts/1" - # polymorphic_url([:admin, blog, post]) # => "http://example.com/admin/blogs/1/posts/1" - # polymorphic_url([user, :blog, post]) # => "http://example.com/users/1/blog/posts/1" - # polymorphic_url(Comment) # => "http://example.com/comments" - # - # ==== Options - # - # * :action - Specifies the action prefix for the named route: - # :new or :edit. Default is no prefix. - # * :routing_type - Allowed values are :path or :url. - # Default is :url. - # - # Also includes all the options from url_for. These include such - # things as :anchor or :trailing_slash. Example usage - # is given below: - # - # polymorphic_url([blog, post], anchor: 'my_anchor') - # # => "http://example.com/blogs/1/posts/1#my_anchor" - # polymorphic_url([blog, post], anchor: 'my_anchor', script_name: "/my_app") - # # => "http://example.com/my_app/blogs/1/posts/1#my_anchor" - # - # For all of these options, see the documentation for {url_for}[rdoc-ref:ActionDispatch::Routing::UrlFor]. - # - # ==== Functionality - # - # # an Article record - # polymorphic_url(record) # same as article_url(record) - # - # # a Comment record - # polymorphic_url(record) # same as comment_url(record) - # - # # it recognizes new records and maps to the collection - # record = Comment.new - # polymorphic_url(record) # same as comments_url() - # - # # the class of a record will also map to the collection - # polymorphic_url(Comment) # same as comments_url() - # - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#101 - def polymorphic_url(record_or_hash_or_array, options = T.unsafe(nil)); end - - private - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#168 - def polymorphic_mapping(record); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#164 - def polymorphic_path_for_action(action, record_or_hash, options); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#160 - def polymorphic_url_for_action(action, record_or_hash, options); end -end - -# source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#176 -class ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder - # @return [HelperMethodBuilder] a new instance of HelperMethodBuilder - # - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#239 - def initialize(key_strategy, prefix, suffix); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#253 - def handle_class(klass); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#257 - def handle_class_call(target, klass); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#284 - def handle_list(list); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#261 - def handle_model(record); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#275 - def handle_model_call(target, record); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#245 - def handle_string(record); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#249 - def handle_string_call(target, str); end - - # Returns the value of attribute prefix. - # - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#237 - def prefix; end - - # Returns the value of attribute suffix. - # - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#237 - def suffix; end - - private - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#338 - def get_method_for_class(klass); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#343 - def get_method_for_string(str); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#330 - def polymorphic_mapping(target, record); end - - class << self - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#187 - def build(action, type); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#179 - def get(action, type); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#185 - def path; end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#201 - def plural(prefix, suffix); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#205 - def polymorphic_method(recipient, record_or_hash_or_array, action, type, options); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#197 - def singular(prefix, suffix); end - - # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#184 - def url; end - end -end - -# source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#177 -ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder::CACHE = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_dispatch/routing/redirection.rb#10 -class ActionDispatch::Routing::Redirect < ::ActionDispatch::Routing::Endpoint - # @return [Redirect] a new instance of Redirect - # - # source://actionpack//lib/action_dispatch/routing/redirection.rb#13 - def initialize(status, block); end - - # Returns the value of attribute block. - # - # source://actionpack//lib/action_dispatch/routing/redirection.rb#11 - def block; end - - # source://actionpack//lib/action_dispatch/routing/redirection.rb#20 - def call(env); end - - # source://actionpack//lib/action_dispatch/routing/redirection.rb#56 - def inspect; end - - # source://actionpack//lib/action_dispatch/routing/redirection.rb#52 - def path(params, request); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/redirection.rb#18 - def redirect?; end - - # source://actionpack//lib/action_dispatch/routing/redirection.rb#24 - def serve(req); end - - # Returns the value of attribute status. - # - # source://actionpack//lib/action_dispatch/routing/redirection.rb#11 - def status; end - - private - - # source://actionpack//lib/action_dispatch/routing/redirection.rb#65 - def escape(params); end - - # source://actionpack//lib/action_dispatch/routing/redirection.rb#69 - def escape_fragment(params); end - - # source://actionpack//lib/action_dispatch/routing/redirection.rb#73 - def escape_path(params); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/redirection.rb#61 - def relative_path?(path); end -end - -# source://actionpack//lib/action_dispatch/routing/redirection.rb#137 -module ActionDispatch::Routing::Redirection - # Redirect any path to another path: - # - # get "/stories" => redirect("/posts") - # - # This will redirect the user, while ignoring certain parts of the request, including query string, etc. - # /stories, /stories?foo=bar, etc all redirect to /posts. - # - # The redirect will use a 301 Moved Permanently status code by - # default. This can be overridden with the +:status+ option: - # - # get "/stories" => redirect("/posts", status: 307) - # - # You can also use interpolation in the supplied redirect argument: - # - # get 'docs/:article', to: redirect('/wiki/%{article}') - # - # Note that if you return a path without a leading slash then the URL is prefixed with the - # current SCRIPT_NAME environment variable. This is typically '/' but may be different in - # a mounted engine or where the application is deployed to a subdirectory of a website. - # - # Alternatively you can use one of the other syntaxes: - # - # The block version of redirect allows for the easy encapsulation of any logic associated with - # the redirect in question. Either the params and request are supplied as arguments, or just - # params, depending of how many arguments your block accepts. A string is required as a - # return value. - # - # get 'jokes/:number', to: redirect { |params, request| - # path = (params[:number].to_i.even? ? "wheres-the-beef" : "i-love-lamp") - # "http://#{request.host_with_port}/#{path}" - # } - # - # Note that the do end syntax for the redirect block wouldn't work, as Ruby would pass - # the block to +get+ instead of +redirect+. Use { ... } instead. - # - # The options version of redirect allows you to supply only the parts of the URL which need - # to change, it also supports interpolation of the path similar to the first example. - # - # get 'stores/:name', to: redirect(subdomain: 'stores', path: '/%{name}') - # get 'stores/:name(*all)', to: redirect(subdomain: 'stores', path: '/%{name}%{all}') - # get '/stories', to: redirect(path: '/posts') - # - # This will redirect the user, while changing only the specified parts of the request, - # for example the +path+ option in the last example. - # /stories, /stories?foo=bar, redirect to /posts and /posts?foo=bar respectively. - # - # Finally, an object which responds to call can be supplied to redirect, allowing you to reuse - # common redirect routes. The call method must accept two arguments, params and request, and return - # a string. - # - # get 'accounts/:name' => redirect(SubdomainRedirector.new('api')) - # - # @raise [ArgumentError] - # - # source://actionpack//lib/action_dispatch/routing/redirection.rb#190 - def redirect(*args, &block); end -end - -# :stopdoc: -# -# source://actionpack//lib/action_dispatch/routing/route_set.rb#14 -class ActionDispatch::Routing::RouteSet - # @return [RouteSet] a new instance of RouteSet - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#366 - def initialize(config = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#615 - def add_polymorphic_mapping(klass, options, &block); end - - # @raise [ArgumentError] - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#584 - def add_route(mapping, name); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#619 - def add_url_helper(name, options, &block); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#395 - def api_only?; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#415 - def append(&block); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#849 - def call(env); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#439 - def clear!; end - - # Returns the value of attribute default_scope. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 - def default_scope; end - - # Sets the attribute default_scope - # - # @param value the value to set the attribute default_scope to. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 - def default_scope=(_arg0); end - - # Returns the value of attribute default_url_options. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#338 - def default_url_options; end - - # Sets the attribute default_url_options - # - # @param value the value to set the attribute default_url_options to. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#338 - def default_url_options=(_arg0); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#461 - def define_mounted_helper(name, script_namer = T.unsafe(nil)); end - - # Returns the value of attribute disable_clear_and_finalize. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#337 - def disable_clear_and_finalize; end - - # Sets the attribute disable_clear_and_finalize - # - # @param value the value to set the attribute disable_clear_and_finalize to. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#337 - def disable_clear_and_finalize=(_arg0); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#408 - def draw(&block); end - - # Returns the value of attribute draw_paths. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#338 - def draw_paths; end - - # Sets the attribute draw_paths - # - # @param value the value to set the attribute draw_paths to. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#338 - def draw_paths=(_arg0); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#385 - def eager_load!; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#580 - def empty?; end - - # Returns the value of attribute env_key. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#339 - def env_key; end - - # Generate the path indicated by the arguments, and return an array of - # the keys that were not used to generate it. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#760 - def extra_keys(options, recall = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#433 - def finalize!; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#792 - def find_relative_url_root(options); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#788 - def find_script_name(options); end - - # Returns the value of attribute formatter. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 - def formatter; end - - # Sets the attribute formatter - # - # @param value the value to set the attribute formatter to. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 - def formatter=(_arg0); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#764 - def generate_extras(options, recall = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#488 - def generate_url_helpers(supports_path); end - - # Since the router holds references to many parts of the system - # like engines, controllers and the application itself, inspecting - # the route set can actually be really slow, therefore we default - # alias inspect to to_s. - def inspect; end - - # Contains all the mounted helpers across different - # engines and the `main_app` helper for the application. - # You can include this in your classes if you want to - # access routes for other engines. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#457 - def mounted_helpers; end - - # Returns the value of attribute named_routes. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 - def named_routes; end - - # Sets the attribute named_routes - # - # @param value the value to set the attribute named_routes to. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 - def named_routes=(_arg0); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#784 - def optimize_routes_generation?; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#796 - def path_for(options, route_name = T.unsafe(nil), reserved = T.unsafe(nil)); end - - # Returns the value of attribute polymorphic_mappings. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#339 - def polymorphic_mappings; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#419 - def prepend(&block); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#855 - def recognize_path(path, environment = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#870 - def recognize_path_with_request(req, path, extras, raise_on_missing: T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#391 - def relative_url_root; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#399 - def request_class; end - - # Returns the value of attribute resources_path_names. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#337 - def resources_path_names; end - - # Sets the attribute resources_path_names - # - # @param value the value to set the attribute resources_path_names to. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#337 - def resources_path_names=(_arg0); end - - # Returns the value of attribute router. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 - def router; end - - # Sets the attribute router - # - # @param value the value to set the attribute router to. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 - def router=(_arg0); end - - # Returns the value of attribute set. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 - def routes; end - - # Returns the value of attribute set. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 - def set; end - - # Sets the attribute set - # - # @param value the value to set the attribute set to. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#336 - def set=(_arg0); end - - # The +options+ argument must be a hash whose keys are *symbols*. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#801 - def url_for(options, route_name = T.unsafe(nil), url_strategy = T.unsafe(nil), method_name = T.unsafe(nil), reserved = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#480 - def url_helpers(supports_path = T.unsafe(nil)); end - - private - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#423 - def eval_block(block); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#775 - def generate(route_name, options, recall = T.unsafe(nil), method_name = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#403 - def make_request(env); end - - class << self - # source://actionpack//lib/action_dispatch/routing/route_set.rb#343 - def default_resources_path_names; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#347 - def new_with_config(config); end - end -end - -# source://actionpack//lib/action_dispatch/routing/route_set.rb#362 -class ActionDispatch::Routing::RouteSet::Config < ::Struct - # Returns the value of attribute api_only - # - # @return [Object] the current value of api_only - def api_only; end - - # Sets the attribute api_only - # - # @param value [Object] the value to set the attribute api_only to. - # @return [Object] the newly set value - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#362 - def api_only=(_); end - - # Returns the value of attribute relative_url_root - # - # @return [Object] the current value of relative_url_root - def relative_url_root; end - - # Sets the attribute relative_url_root - # - # @param value [Object] the value to set the attribute relative_url_root to. - # @return [Object] the newly set value - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#362 - def relative_url_root=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def members; end - def new(*_arg0); end - end -end - -# source://actionpack//lib/action_dispatch/routing/route_set.rb#623 -class ActionDispatch::Routing::RouteSet::CustomUrlHelper - # @return [CustomUrlHelper] a new instance of CustomUrlHelper - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#626 - def initialize(name, defaults, &block); end - - # Returns the value of attribute block. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#624 - def block; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#632 - def call(t, args, only_path = T.unsafe(nil)); end - - # Returns the value of attribute defaults. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#624 - def defaults; end - - # Returns the value of attribute name. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#624 - def name; end - - private - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#644 - def eval_block(t, args, options); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#648 - def merge_defaults(options); end -end - -# source://actionpack//lib/action_dispatch/routing/route_set.rb#364 -ActionDispatch::Routing::RouteSet::DEFAULT_CONFIG = T.let(T.unsafe(nil), ActionDispatch::Routing::RouteSet::Config) - -# source://actionpack//lib/action_dispatch/routing/route_set.rb#21 -class ActionDispatch::Routing::RouteSet::Dispatcher < ::ActionDispatch::Routing::Endpoint - # @return [Dispatcher] a new instance of Dispatcher - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#22 - def initialize(raise_on_name_error); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#26 - def dispatcher?; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#28 - def serve(req); end - - private - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#42 - def controller(req); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#48 - def dispatch(controller, action, req, res); end -end - -# source://actionpack//lib/action_dispatch/routing/route_set.rb#653 -class ActionDispatch::Routing::RouteSet::Generator - # @return [Generator] a new instance of Generator - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#656 - def initialize(named_route, options, recall, set); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#668 - def controller; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#672 - def current_controller; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#743 - def different_controller?; end - - # Generates a path from routes, returns a RouteWithParams or MissingRoute. - # MissingRoute will raise ActionController::UrlGenerationError. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#739 - def generate; end - - # Returns the value of attribute named_route. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#654 - def named_route; end - - # Remove leading slashes from controllers - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#727 - def normalize_controller!; end - - # This pulls :controller, :action, and :id out of the recall. - # The recall key is only used if there is no key in the options - # or if the key in the options is identical. If any of - # :controller, :action or :id is not found, don't pull any - # more keys from the recall. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#709 - def normalize_controller_action_id!; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#684 - def normalize_options!; end - - # Returns the value of attribute options. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#654 - def options; end - - # Returns the value of attribute recall. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#654 - def recall; end - - # Returns the value of attribute set. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#654 - def set; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#676 - def use_recall_for(key); end - - # if the current controller is "foo/bar/baz" and controller: "baz/bat" - # is specified, the controller becomes "foo/baz/bat" - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#717 - def use_relative_controller!; end - - private - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#749 - def named_route_exists?; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#753 - def segment_keys; end -end - -# source://actionpack//lib/action_dispatch/routing/route_set.rb#448 -module ActionDispatch::Routing::RouteSet::MountedHelpers - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - include ::ActionDispatch::Routing::UrlFor - - mixes_in_class_methods GeneratedClassMethods - - module GeneratedClassMethods - def default_url_options; end - def default_url_options=(value); end - def default_url_options?; end - end - - module GeneratedInstanceMethods - def default_url_options; end - def default_url_options=(value); end - def default_url_options?; end - end -end - -# A NamedRouteCollection instance is a collection of named routes, and also -# maintains an anonymous module that can be used to install helpers for the -# named routes. -# -# source://actionpack//lib/action_dispatch/routing/route_set.rb#66 -class ActionDispatch::Routing::RouteSet::NamedRouteCollection - include ::Enumerable - - # @return [NamedRouteCollection] a new instance of NamedRouteCollection - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#71 - def initialize; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#121 - def [](name); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#102 - def []=(name, route); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#102 - def add(name, route); end - - # Given a +name+, defines name_path and name_url helpers. - # Used by 'direct', 'resolve', and 'polymorphic' route helpers. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#149 - def add_url_helper(name, defaults, &block); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#88 - def clear; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#88 - def clear!; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#134 - def each(&block); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#121 - def get(name); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#84 - def helper_names; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#125 - def key?(name); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#143 - def length; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#139 - def names; end - - # Returns the value of attribute path_helpers_module. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#68 - def path_helpers_module; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#79 - def route_defined?(name); end - - # Returns the value of attribute url_helpers_module. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#68 - def url_helpers_module; end - - private - - # Create a URL helper allowing ordered parameters to be associated - # with corresponding dynamic segments, so you can do: - # - # foo_url(bar, baz, bang) - # - # Instead of: - # - # foo_url(bar: bar, baz: baz, bang: bang) - # - # Also allow options hash, so you can do: - # - # foo_url(bar, baz, bang, sort_by: 'baz') - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#317 - def define_url_helper(mod, name, helper, url_strategy); end - - # Returns the value of attribute routes. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#68 - def routes; end -end - -# source://actionpack//lib/action_dispatch/routing/route_set.rb#172 -class ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper - # @return [UrlHelper] a new instance of UrlHelper - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#255 - def initialize(route, options, route_name); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#262 - def call(t, method_name, args, inner_options, url_strategy); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#274 - def handle_positional_args(controller_options, inner_options, args, result, path_params); end - - # Returns the value of attribute route_name. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#185 - def route_name; end - - class << self - # source://actionpack//lib/action_dispatch/routing/route_set.rb#173 - def create(route, options, route_name); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#181 - def optimize_helper?(route); end - end -end - -# source://actionpack//lib/action_dispatch/routing/route_set.rb#187 -class ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper::OptimizedUrlHelper < ::ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper - # @return [OptimizedUrlHelper] a new instance of OptimizedUrlHelper - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#190 - def initialize(route, options, route_name); end - - # Returns the value of attribute arg_size. - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#188 - def arg_size; end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#196 - def call(t, method_name, args, inner_options, url_strategy); end - - private - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#227 - def optimize_routes_generation?(t); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#219 - def optimized_helper(args); end - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#231 - def parameterize_args(args); end - - # @raise [ActionController::UrlGenerationError] - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#242 - def raise_generation_error(args); end -end - -# strategy for building URLs to send to the client -# -# source://actionpack//lib/action_dispatch/routing/route_set.rb#333 -ActionDispatch::Routing::RouteSet::PATH = T.let(T.unsafe(nil), Proc) - -# source://actionpack//lib/action_dispatch/routing/route_set.rb#780 -ActionDispatch::Routing::RouteSet::RESERVED_OPTIONS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/routing/route_set.rb#53 -class ActionDispatch::Routing::RouteSet::StaticDispatcher < ::ActionDispatch::Routing::RouteSet::Dispatcher - # @return [StaticDispatcher] a new instance of StaticDispatcher - # - # source://actionpack//lib/action_dispatch/routing/route_set.rb#54 - def initialize(controller_class); end - - private - - # source://actionpack//lib/action_dispatch/routing/route_set.rb#60 - def controller(_); end -end - -# source://actionpack//lib/action_dispatch/routing/route_set.rb#334 -ActionDispatch::Routing::RouteSet::UNKNOWN = T.let(T.unsafe(nil), Proc) - -# source://actionpack//lib/action_dispatch/routing/inspector.rb#8 -class ActionDispatch::Routing::RouteWrapper < ::SimpleDelegator - # source://actionpack//lib/action_dispatch/routing/inspector.rb#41 - def action; end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#13 - def constraints; end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#37 - def controller; end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#9 - def endpoint; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/inspector.rb#49 - def engine?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/inspector.rb#45 - def internal?; end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#25 - def name; end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#21 - def path; end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#17 - def rack_app; end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#29 - def reqs; end -end - -# This class is just used for displaying route information when someone -# executes `bin/rails routes` or looks at the RoutingError page. -# People should not use this class. -# -# source://actionpack//lib/action_dispatch/routing/inspector.rb#58 -class ActionDispatch::Routing::RoutesInspector - # @return [RoutesInspector] a new instance of RoutesInspector - # - # source://actionpack//lib/action_dispatch/routing/inspector.rb#59 - def initialize(routes); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#64 - def format(formatter, filter = T.unsafe(nil)); end - - private - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#117 - def collect_engine_routes(route); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#104 - def collect_routes(routes); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#93 - def filter_routes(filter); end - - # source://actionpack//lib/action_dispatch/routing/inspector.rb#84 - def normalize_filter(filter); end -end - -# source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#7 -class ActionDispatch::Routing::RoutesProxy - include ::ActionDispatch::Routing::PolymorphicRoutes - include ::ActionDispatch::Routing::UrlFor - - # @return [RoutesProxy] a new instance of RoutesProxy - # - # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#13 - def initialize(routes, scope, helpers, script_namer = T.unsafe(nil)); end - - # Returns the value of attribute routes. - # - # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 - def _routes; end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options; end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options=(_arg0); end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options?; end - - # Returns the value of attribute routes. - # - # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 - def routes; end - - # Sets the attribute routes - # - # @param value the value to set the attribute routes to. - # - # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 - def routes=(_arg0); end - - # Returns the value of attribute scope. - # - # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 - def scope; end - - # Sets the attribute scope - # - # @param value the value to set the attribute scope to. - # - # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 - def scope=(_arg0); end - - # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#19 - def url_options; end - - private - - # Keeps the part of the script name provided by the global - # context via ENV["SCRIPT_NAME"], which `mount` doesn't know - # about since it depends on the specific request, but use our - # script name resolver for the mount point dependent part. - # - # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#58 - def merge_script_names(previous_script_name, new_script_name); end - - # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#30 - def method_missing(method, *args); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#26 - def respond_to_missing?(method, _); end - - class << self - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options; end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options=(value); end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#95 - def default_url_options?; end - end -end - -# source://actionpack//lib/action_dispatch/routing.rb#257 -ActionDispatch::Routing::SEPARATORS = T.let(T.unsafe(nil), Array) - -# In config/routes.rb you define URL-to-controller mappings, but the reverse -# is also possible: a URL can be generated from one of your routing definitions. -# URL generation functionality is centralized in this module. -# -# See ActionDispatch::Routing for general information about routing and routes.rb. -# -# Tip: If you need to generate URLs from your models or some other place, -# then ActionController::UrlFor is what you're looking for. Read on for -# an introduction. In general, this module should not be included on its own, -# as it is usually included by url_helpers (as in Rails.application.routes.url_helpers). -# -# == URL generation from parameters -# -# As you may know, some functions, such as ActionController::Base#url_for -# and ActionView::Helpers::UrlHelper#link_to, can generate URLs given a set -# of parameters. For example, you've probably had the chance to write code -# like this in one of your views: -# -# <%= link_to('Click here', controller: 'users', -# action: 'new', message: 'Welcome!') %> -# # => Click here -# -# link_to, and all other functions that require URL generation functionality, -# actually use ActionController::UrlFor under the hood. And in particular, -# they use the ActionController::UrlFor#url_for method. One can generate -# the same path as the above example by using the following code: -# -# include UrlFor -# url_for(controller: 'users', -# action: 'new', -# message: 'Welcome!', -# only_path: true) -# # => "/users/new?message=Welcome%21" -# -# Notice the only_path: true part. This is because UrlFor has no -# information about the website hostname that your Rails app is serving. So if you -# want to include the hostname as well, then you must also pass the :host -# argument: -# -# include UrlFor -# url_for(controller: 'users', -# action: 'new', -# message: 'Welcome!', -# host: 'www.example.com') -# # => "http://www.example.com/users/new?message=Welcome%21" -# -# By default, all controllers and views have access to a special version of url_for, -# that already knows what the current hostname is. So if you use url_for in your -# controllers or your views, then you don't need to explicitly pass the :host -# argument. -# -# For convenience reasons, mailers provide a shortcut for ActionController::UrlFor#url_for. -# So within mailers, you only have to type +url_for+ instead of 'ActionController::UrlFor#url_for' -# in full. However, mailers don't have hostname information, and you still have to provide -# the +:host+ argument or set the default host that will be used in all mailers using the -# configuration option +config.action_mailer.default_url_options+. For more information on -# url_for in mailers read the ActionMailer#Base documentation. -# -# -# == URL generation for named routes -# -# UrlFor also allows one to access methods that have been auto-generated from -# named routes. For example, suppose that you have a 'users' resource in your -# config/routes.rb: -# -# resources :users -# -# This generates, among other things, the method users_path. By default, -# this method is accessible from your controllers, views, and mailers. If you need -# to access this auto-generated method from other places (such as a model), then -# you can do that by including Rails.application.routes.url_helpers in your class: -# -# class User < ActiveRecord::Base -# include Rails.application.routes.url_helpers -# -# def base_uri -# user_path(self) -# end -# end -# -# User.find(1).base_uri # => "/users/1" -# -# source://actionpack//lib/action_dispatch/routing/url_for.rb#87 -module ActionDispatch::Routing::UrlFor - include ::ActionDispatch::Routing::PolymorphicRoutes - extend ::ActiveSupport::Concern - include GeneratedInstanceMethods - - mixes_in_class_methods GeneratedClassMethods - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#106 - def initialize(*_arg0, &_arg1); end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#173 - def full_url_for(options = T.unsafe(nil)); end - - # Allows calling direct or regular named route. - # - # resources :buckets - # - # direct :recordable do |recording| - # route_for(:bucket, recording.bucket) - # end - # - # direct :threadable do |threadable| - # route_for(:recordable, threadable.parent) - # end - # - # This maintains the context of the original caller on - # whether to return a path or full URL, e.g: - # - # threadable_path(threadable) # => "/buckets/1" - # threadable_url(threadable) # => "http://example.com/buckets/1" - # - # source://actionpack//lib/action_dispatch/routing/url_for.rb#213 - def route_for(name, *args); end - - # Generate a URL based on the options provided, default_url_options, and the - # routes defined in routes.rb. The following options are supported: - # - # * :only_path - If true, the relative URL is returned. Defaults to +false+. - # * :protocol - The protocol to connect to. Defaults to 'http'. - # * :host - Specifies the host the link should be targeted at. - # If :only_path is false, this option must be - # provided either explicitly, or via +default_url_options+. - # * :subdomain - Specifies the subdomain of the link, using the +tld_length+ - # to split the subdomain from the host. - # If false, removes all subdomains from the host part of the link. - # * :domain - Specifies the domain of the link, using the +tld_length+ - # to split the domain from the host. - # * :tld_length - Number of labels the TLD id composed of, only used if - # :subdomain or :domain are supplied. Defaults to - # ActionDispatch::Http::URL.tld_length, which in turn defaults to 1. - # * :port - Optionally specify the port to connect to. - # * :anchor - An anchor name to be appended to the path. - # * :params - The query parameters to be appended to the path. - # * :trailing_slash - If true, adds a trailing slash, as in "/archive/2009/" - # * :script_name - Specifies application path relative to domain root. If provided, prepends application path. - # - # Any other key (:controller, :action, etc.) given to - # +url_for+ is forwarded to the Routes module. - # - # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', port: '8080' - # # => 'http://somehost.org:8080/tasks/testing' - # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', anchor: 'ok', only_path: true - # # => '/tasks/testing#ok' - # url_for controller: 'tasks', action: 'testing', trailing_slash: true - # # => 'http://somehost.org/tasks/testing/' - # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', number: '33' - # # => 'http://somehost.org/tasks/testing?number=33' - # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', script_name: "/myapp" - # # => 'http://somehost.org/myapp/tasks/testing' - # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', script_name: "/myapp", only_path: true - # # => '/myapp/tasks/testing' - # - # Missing routes keys may be filled in from the current request's parameters - # (e.g. +:controller+, +:action+, +:id+, and any other parameters that are - # placed in the path). Given that the current action has been reached - # through GET /users/1: - # - # url_for(only_path: true) # => '/users/1' - # url_for(only_path: true, action: 'edit') # => '/users/1/edit' - # url_for(only_path: true, action: 'edit', id: 2) # => '/users/2/edit' - # - # Notice that no +:id+ parameter was provided to the first +url_for+ call - # and the helper used the one from the route's path. Any path parameter - # implicitly used by +url_for+ can always be overwritten like shown on the - # last +url_for+ calls. - # - # source://actionpack//lib/action_dispatch/routing/url_for.rb#169 - def url_for(options = T.unsafe(nil)); end - - # Hook overridden in controller to add request information - # with +default_url_options+. Application logic should not - # go into url_options. - # - # source://actionpack//lib/action_dispatch/routing/url_for.rb#114 - def url_options; end - - protected - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/routing/url_for.rb#218 - def optimize_routes_generation?; end - - private - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#230 - def _routes_context; end - - # source://actionpack//lib/action_dispatch/routing/url_for.rb#223 - def _with_routes(routes); end - - module GeneratedClassMethods - def default_url_options; end - def default_url_options=(value); end - def default_url_options?; end - end - - module GeneratedInstanceMethods - def default_url_options; end - def default_url_options=(value); end - def default_url_options?; end - end -end - -# This middleware is added to the stack when config.force_ssl = true, and is passed -# the options set in +config.ssl_options+. It does three jobs to enforce secure HTTP -# requests: -# -# 1. TLS redirect: Permanently redirects +http://+ requests to +https://+ -# with the same URL host, path, etc. Enabled by default. Set +config.ssl_options+ -# to modify the destination URL -# (e.g. redirect: { host: "secure.widgets.com", port: 8080 }), or set -# redirect: false to disable this feature. -# -# Requests can opt-out of redirection with +exclude+: -# -# config.ssl_options = { redirect: { exclude: -> request { /healthcheck/.match?(request.path) } } } -# -# Cookies will not be flagged as secure for excluded requests. -# -# 2. Secure cookies: Sets the +secure+ flag on cookies to tell browsers they -# must not be sent along with +http://+ requests. Enabled by default. Set -# +config.ssl_options+ with secure_cookies: false to disable this feature. -# -# 3. HTTP Strict Transport Security (HSTS): Tells the browser to remember -# this site as TLS-only and automatically redirect non-TLS requests. -# Enabled by default. Configure +config.ssl_options+ with hsts: false to disable. -# -# Set +config.ssl_options+ with hsts: { ... } to configure HSTS: -# -# * +expires+: How long, in seconds, these settings will stick. The minimum -# required to qualify for browser preload lists is 1 year. Defaults to -# 2 years (recommended). -# -# * +subdomains+: Set to +true+ to tell the browser to apply these settings -# to all subdomains. This protects your cookies from interception by a -# vulnerable site on a subdomain. Defaults to +true+. -# -# * +preload+: Advertise that this site may be included in browsers' -# preloaded HSTS lists. HSTS protects your site on every visit except the -# first visit since it hasn't seen your HSTS header yet. To close this -# gap, browser vendors include a baked-in list of HSTS-enabled sites. -# Go to https://hstspreload.org to submit your site for inclusion. -# Defaults to +false+. -# -# To turn off HSTS, omitting the header is not enough. Browsers will remember the -# original HSTS directive until it expires. Instead, use the header to tell browsers to -# expire HSTS immediately. Setting hsts: false is a shortcut for -# hsts: { expires: 0 }. -# -# source://actionpack//lib/action_dispatch/middleware/ssl.rb#49 -class ActionDispatch::SSL - # @return [SSL] a new instance of SSL - # - # source://actionpack//lib/action_dispatch/middleware/ssl.rb#61 - def initialize(app, redirect: T.unsafe(nil), hsts: T.unsafe(nil), secure_cookies: T.unsafe(nil), ssl_default_redirect_status: T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/middleware/ssl.rb#73 - def call(env); end - - private - - # https://tools.ietf.org/html/rfc6797#section-6.1 - # - # source://actionpack//lib/action_dispatch/middleware/ssl.rb#107 - def build_hsts_header(hsts); end - - # source://actionpack//lib/action_dispatch/middleware/ssl.rb#114 - def flag_cookies_as_secure!(headers); end - - # source://actionpack//lib/action_dispatch/middleware/ssl.rb#145 - def https_location_for(request); end - - # source://actionpack//lib/action_dispatch/middleware/ssl.rb#92 - def normalize_hsts_options(options); end - - # source://actionpack//lib/action_dispatch/middleware/ssl.rb#128 - def redirect_to_https(request); end - - # source://actionpack//lib/action_dispatch/middleware/ssl.rb#135 - def redirection_status(request); end - - # source://actionpack//lib/action_dispatch/middleware/ssl.rb#88 - def set_hsts_header!(headers); end - - class << self - # source://actionpack//lib/action_dispatch/middleware/ssl.rb#57 - def default_hsts_options; end - end -end - -# Default to 2 years as recommended on hstspreload.org. -# -# source://actionpack//lib/action_dispatch/middleware/ssl.rb#53 -ActionDispatch::SSL::HSTS_EXPIRES_IN = T.let(T.unsafe(nil), Integer) - -# source://actionpack//lib/action_dispatch/middleware/ssl.rb#55 -ActionDispatch::SSL::PERMANENT_REDIRECT_REQUEST_METHODS = T.let(T.unsafe(nil), Array) - -# source://actionpack//lib/action_dispatch/middleware/server_timing.rb#6 -class ActionDispatch::ServerTiming - # @return [ServerTiming] a new instance of ServerTiming - # - # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#52 - def initialize(app); end - - # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#58 - def call(env); end - - class << self - # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#48 - def unsubscribe; end - end -end - -# source://actionpack//lib/action_dispatch/middleware/server_timing.rb#7 -ActionDispatch::ServerTiming::SERVER_TIMING_HEADER = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/middleware/server_timing.rb#9 -class ActionDispatch::ServerTiming::Subscriber - include ::Singleton - extend ::Singleton::SingletonClassMethods - - # @return [Subscriber] a new instance of Subscriber - # - # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#13 - def initialize; end - - # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#17 - def call(event); end - - # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#23 - def collect_events; end - - # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#32 - def ensure_subscribed; end - - # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#40 - def unsubscribe; end -end - -# source://actionpack//lib/action_dispatch/middleware/server_timing.rb#11 -ActionDispatch::ServerTiming::Subscriber::KEY = T.let(T.unsafe(nil), Symbol) - -# source://actionpack//lib/action_dispatch.rb#91 -module ActionDispatch::Session; end - -# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#90 -class ActionDispatch::Session::AbstractSecureStore < ::Rack::Session::Abstract::PersistedSecure - include ::ActionDispatch::Session::Compatibility - include ::ActionDispatch::Session::StaleSessionCheck - include ::ActionDispatch::Session::SessionObject - - # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#95 - def generate_sid; end - - private - - # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#100 - def set_cookie(request, response, cookie); end -end - -# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#79 -class ActionDispatch::Session::AbstractStore < ::Rack::Session::Abstract::Persisted - include ::ActionDispatch::Session::Compatibility - include ::ActionDispatch::Session::StaleSessionCheck - include ::ActionDispatch::Session::SessionObject - - private - - # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#85 - def set_cookie(request, response, cookie); end -end - -# A session store that uses an ActiveSupport::Cache::Store to store the sessions. This store is most useful -# if you don't store critical data in your sessions and you don't need them to live for extended periods -# of time. -# -# ==== Options -# * cache - The cache to use. If it is not specified, Rails.cache will be used. -# * expire_after - The length of time a session will be stored before automatically expiring. -# By default, the :expires_in option of the cache is used. -# -# source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#15 -class ActionDispatch::Session::CacheStore < ::ActionDispatch::Session::AbstractSecureStore - # @return [CacheStore] a new instance of CacheStore - # - # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#16 - def initialize(app, options = T.unsafe(nil)); end - - # Remove a session from the cache. - # - # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#42 - def delete_session(env, sid, options); end - - # Get a session from the cache. - # - # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#23 - def find_session(env, sid); end - - # Set a session in the cache. - # - # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#31 - def write_session(env, sid, session, options); end - - private - - # Turn the session id into a cache key. - # - # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#50 - def cache_key(id); end - - # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#54 - def get_session_with_fallback(sid); end -end - -# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#20 -module ActionDispatch::Session::Compatibility - # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#21 - def initialize(app, options = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#26 - def generate_sid; end - - private - - # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#33 - def initialize_sid; end - - # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#38 - def make_request(env); end -end - -# This cookie-based session store is the Rails default. It is -# dramatically faster than the alternatives. -# -# Sessions typically contain at most a user ID and flash message; both fit -# within the 4096 bytes cookie size limit. A +CookieOverflow+ exception is raised if -# you attempt to store more than 4096 bytes of data. -# -# The cookie jar used for storage is automatically configured to be the -# best possible option given your application's configuration. -# -# Your cookies will be encrypted using your application's +secret_key_base+. This -# goes a step further than signed cookies in that encrypted cookies cannot -# be altered or read by users. This is the default starting in Rails 4. -# -# Configure your session store in an initializer: -# -# Rails.application.config.session_store :cookie_store, key: '_your_app_session' -# -# In the development and test environments your application's +secret_key_base+ is -# generated by Rails and stored in a temporary file in tmp/development_secret.txt. -# In all other environments, it is stored encrypted in the -# config/credentials.yml.enc file. -# -# If your application was not updated to Rails 5.2 defaults, the +secret_key_base+ -# will be found in the old config/secrets.yml file. -# -# Note that changing your +secret_key_base+ will invalidate all existing session. -# Additionally, you should take care to make sure you are not relying on the -# ability to decode signed cookies generated by your app in external -# applications or JavaScript before changing it. -# -# Because CookieStore extends +Rack::Session::Abstract::Persisted+, many of the -# options described there can be used to customize the session cookie that -# is generated. For example: -# -# Rails.application.config.session_store :cookie_store, expire_after: 14.days -# -# would set the session cookie to expire automatically 14 days after creation. -# Other useful options include :key, :secure, -# :httponly, and :same_site. -# -# source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#49 -class ActionDispatch::Session::CookieStore < ::ActionDispatch::Session::AbstractSecureStore - # @return [CookieStore] a new instance of CookieStore - # - # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#59 - def initialize(app, options = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#63 - def delete_session(req, session_id, options); end - - # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#70 - def load_session(req); end - - private - - # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#117 - def cookie_jar(request); end - - # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#79 - def extract_session_id(req); end - - # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#113 - def get_cookie(req); end - - # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#98 - def persistent_session_id!(data, sid = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#109 - def set_cookie(request, session_id, cookie); end - - # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#86 - def unpacked_cookie_data(req); end - - # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#104 - def write_session(req, sid, session_data, options); end -end - -# source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#50 -class ActionDispatch::Session::CookieStore::SessionId - # @return [SessionId] a new instance of SessionId - # - # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#53 - def initialize(session_id, cookie_value = T.unsafe(nil)); end - - # Returns the value of attribute cookie_value. - # - # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#51 - def cookie_value; end -end - -# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#69 -module ActionDispatch::Session::SessionObject - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#74 - def loaded_session?(session); end - - # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#70 - def prepare_session(req); end -end - -# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#11 -class ActionDispatch::Session::SessionRestoreError < ::StandardError - # @return [SessionRestoreError] a new instance of SessionRestoreError - # - # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#12 - def initialize; end -end - -# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#43 -module ActionDispatch::Session::StaleSessionCheck - # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#48 - def extract_session_id(env); end - - # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#44 - def load_session(env); end - - # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#52 - def stale_session_check!; end -end - -# This middleware rescues any exception returned by the application -# and calls an exceptions app that will wrap it in a format for the end user. -# -# The exceptions app should be passed as parameter on initialization -# of ShowExceptions. Every time there is an exception, ShowExceptions will -# store the exception in env["action_dispatch.exception"], rewrite the -# PATH_INFO to the exception status code and call the Rack app. -# -# If the application returns a "X-Cascade" pass response, this middleware -# will send an empty response as result with the correct status code. -# If any exception happens inside the exceptions app, this middleware -# catches the exceptions and returns a failsafe response. -# -# source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#18 -class ActionDispatch::ShowExceptions - # @return [ShowExceptions] a new instance of ShowExceptions - # - # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#19 - def initialize(app, exceptions_app); end - - # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#24 - def call(env); end - - private - - # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#58 - def fallback_to_html_format_if_invalid_mime_type(request); end - - # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#67 - def pass_response(status); end - - # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#36 - def render_exception(request, exception); end -end - -# This middleware serves static files from disk, if available. -# If no file is found, it hands off to the main app. -# -# In Rails apps, this middleware is configured to serve assets from -# the +public/+ directory. -# -# Only GET and HEAD requests are served. POST and other HTTP methods -# are handed off to the main app. -# -# Only files in the root directory are served; path traversal is denied. -# -# source://actionpack//lib/action_dispatch/middleware/static.rb#16 -class ActionDispatch::Static - # @return [Static] a new instance of Static - # - # source://actionpack//lib/action_dispatch/middleware/static.rb#17 - def initialize(app, path, index: T.unsafe(nil), headers: T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/middleware/static.rb#22 - def call(env); end -end - -# source://actionpack//lib/action_dispatch/testing/test_process.rb#7 -module ActionDispatch::TestProcess - include ::ActionDispatch::TestProcess::FixtureFile - - # @raise [NoMethodError] - # - # source://actionpack//lib/action_dispatch/testing/test_process.rb#30 - def assigns(key = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/testing/test_process.rb#44 - def cookies; end - - # source://actionpack//lib/action_dispatch/testing/test_process.rb#40 - def flash; end - - # source://actionpack//lib/action_dispatch/testing/test_process.rb#48 - def redirect_to_url; end - - # source://actionpack//lib/action_dispatch/testing/test_process.rb#36 - def session; end -end - -# source://actionpack//lib/action_dispatch/testing/test_process.rb#8 -module ActionDispatch::TestProcess::FixtureFile - # Shortcut for Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.file_fixture_path, path), type): - # - # post :change_avatar, params: { avatar: fixture_file_upload('david.png', 'image/png') } - # - # Default fixture files location is test/fixtures/files. - # - # To upload binary files on Windows, pass :binary as the last parameter. - # This will not affect other platforms: - # - # post :change_avatar, params: { avatar: fixture_file_upload('david.png', 'image/png', :binary) } - # - # source://actionpack//lib/action_dispatch/testing/test_process.rb#19 - def fixture_file_upload(path, mime_type = T.unsafe(nil), binary = T.unsafe(nil)); end -end - -# source://actionpack//lib/action_dispatch/testing/test_request.rb#7 -class ActionDispatch::TestRequest < ::ActionDispatch::Request - # source://actionpack//lib/action_dispatch/testing/test_request.rb#66 - def accept=(mime_types); end - - # source://actionpack//lib/action_dispatch/testing/test_request.rb#46 - def action=(action_name); end - - # source://actionpack//lib/action_dispatch/testing/test_request.rb#30 - def host=(host); end - - # source://actionpack//lib/action_dispatch/testing/test_request.rb#50 - def if_modified_since=(last_modified); end - - # source://actionpack//lib/action_dispatch/testing/test_request.rb#54 - def if_none_match=(etag); end - - # source://actionpack//lib/action_dispatch/testing/test_request.rb#42 - def path=(path); end - - # source://actionpack//lib/action_dispatch/testing/test_request.rb#34 - def port=(number); end - - # source://actionpack//lib/action_dispatch/testing/test_request.rb#58 - def remote_addr=(addr); end - - # source://actionpack//lib/action_dispatch/testing/test_request.rb#26 - def request_method=(method); end - - # source://actionpack//lib/action_dispatch/testing/test_request.rb#38 - def request_uri=(uri); end - - # source://actionpack//lib/action_dispatch/testing/test_request.rb#62 - def user_agent=(user_agent); end - - class << self - # Create a new test request with default +env+ values. - # - # source://actionpack//lib/action_dispatch/testing/test_request.rb#15 - def create(env = T.unsafe(nil)); end - - private - - # source://actionpack//lib/action_dispatch/testing/test_request.rb#21 - def default_env; end - end -end - -# source://actionpack//lib/action_dispatch/testing/test_request.rb#8 -ActionDispatch::TestRequest::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) - -# Integration test methods such as Integration::RequestHelpers#get -# and Integration::RequestHelpers#post return objects of class -# TestResponse, which represent the HTTP response results of the requested -# controller actions. -# -# See Response for more information on controller response objects. -# -# source://actionpack//lib/action_dispatch/testing/test_response.rb#12 -class ActionDispatch::TestResponse < ::ActionDispatch::Response - # Returns a parsed body depending on the response MIME type. When a parser - # corresponding to the MIME type is not found, it returns the raw body. - # - # ==== Examples - # get "/posts" - # response.content_type # => "text/html; charset=utf-8" - # response.parsed_body.class # => String - # response.parsed_body # => "\n\n..." - # - # get "/posts.json" - # response.content_type # => "application/json; charset=utf-8" - # response.parsed_body.class # => Array - # response.parsed_body # => [{"id"=>42, "title"=>"Title"},... - # - # get "/posts/42.json" - # response.content_type # => "application/json; charset=utf-8" - # response.parsed_body.class # => Hash - # response.parsed_body # => {"id"=>42, "title"=>"Title"} - # - # source://actionpack//lib/action_dispatch/testing/test_response.rb#35 - def parsed_body; end - - # source://actionpack//lib/action_dispatch/testing/test_response.rb#39 - def response_parser; end - - class << self - # source://actionpack//lib/action_dispatch/testing/test_response.rb#13 - def from_response(response); end - end -end - -# source://actionpack//lib/action_pack/gem_version.rb#3 -module ActionPack - class << self - # Returns the currently loaded version of Action Pack as a Gem::Version. - # - # source://actionpack//lib/action_pack/gem_version.rb#5 - def gem_version; end - - # Returns the currently loaded version of Action Pack as a Gem::Version. - # - # source://actionpack//lib/action_pack/version.rb#7 - def version; end - end -end - -# source://actionpack//lib/action_pack/gem_version.rb#9 -module ActionPack::VERSION; end - -# source://actionpack//lib/action_pack/gem_version.rb#10 -ActionPack::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) - -# source://actionpack//lib/action_pack/gem_version.rb#11 -ActionPack::VERSION::MINOR = T.let(T.unsafe(nil), Integer) - -# source://actionpack//lib/action_pack/gem_version.rb#13 -ActionPack::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) - -# source://actionpack//lib/action_pack/gem_version.rb#15 -ActionPack::VERSION::STRING = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_pack/gem_version.rb#12 -ActionPack::VERSION::TINY = T.let(T.unsafe(nil), Integer) - -# source://actionpack//lib/action_dispatch/http/mime_type.rb#5 -module Mime - class << self - # source://actionpack//lib/action_dispatch/http/mime_type.rb#40 - def [](type); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#45 - def fetch(type, &block); end - end -end - -# ALL isn't a real MIME type, so we don't register it for lookup with the -# other concrete types. It's a wildcard match that we use for +respond_to+ -# negotiation internals. -# -# source://actionpack//lib/action_dispatch/http/mime_type.rb#333 -Mime::ALL = T.let(T.unsafe(nil), Mime::AllType) - -# source://actionpack//lib/action_dispatch/http/mime_type.rb#319 -class Mime::AllType < ::Mime::Type - include ::Singleton - extend ::Singleton::SingletonClassMethods - - # @return [AllType] a new instance of AllType - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#322 - def initialize; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#326 - def all?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#327 - def html?; end -end - -# source://actionpack//lib/action_dispatch/http/mime_type.rb#36 -Mime::EXTENSION_LOOKUP = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_dispatch/http/mime_type.rb#37 -Mime::LOOKUP = T.let(T.unsafe(nil), Hash) - -# source://actionpack//lib/action_dispatch/http/mime_type.rb#6 -class Mime::Mimes - include ::Enumerable - - # @return [Mimes] a new instance of Mimes - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#11 - def initialize; end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#20 - def <<(type); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#25 - def delete_if; end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#16 - def each(&block); end - - # Returns the value of attribute symbols. - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#7 - def symbols; end -end - -# source://actionpack//lib/action_dispatch/http/mime_type.rb#335 -class Mime::NullType - include ::Singleton - extend ::Singleton::SingletonClassMethods - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#338 - def nil?; end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#346 - def ref; end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#342 - def to_s; end - - private - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#353 - def method_missing(method, *args); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#349 - def respond_to_missing?(method, _); end -end - -# source://actionpack//lib/action_dispatch/http/mime_type.rb#35 -Mime::SET = T.let(T.unsafe(nil), Mime::Mimes) - -# Encapsulates the notion of a MIME type. Can be used at render time, for example, with: -# -# class PostsController < ActionController::Base -# def show -# @post = Post.find(params[:id]) -# -# respond_to do |format| -# format.html -# format.ics { render body: @post.to_ics, mime_type: Mime::Type.lookup("text/calendar") } -# format.xml { render xml: @post } -# end -# end -# end -# -# source://actionpack//lib/action_dispatch/http/mime_type.rb#64 -class Mime::Type - # @return [Type] a new instance of Type - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#234 - def initialize(string, symbol = T.unsafe(nil), synonyms = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#267 - def ==(mime_type); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#259 - def ===(list); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#281 - def =~(mime_type); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#297 - def all?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#274 - def eql?(other); end - - # Returns the value of attribute hash. - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#225 - def hash; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#293 - def html?; end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#287 - def match?(mime_type); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#255 - def ref; end - - # Returns the value of attribute symbol. - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#65 - def symbol; end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#243 - def to_s; end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#247 - def to_str; end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#251 - def to_sym; end - - protected - - # Returns the value of attribute string. - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#300 - def string; end - - # Returns the value of attribute synonyms. - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#300 - def synonyms; end - - private - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#306 - def method_missing(method, *args); end - - # @return [Boolean] - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#314 - def respond_to_missing?(method, include_private = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#304 - def to_a; end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#303 - def to_ary; end - - class << self - # source://actionpack//lib/action_dispatch/http/mime_type.rb#144 - def lookup(string); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#148 - def lookup_by_extension(extension); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#172 - def parse(accept_header); end - - # For an input of 'text', returns [Mime[:json], Mime[:xml], Mime[:ics], - # Mime[:html], Mime[:css], Mime[:csv], Mime[:js], Mime[:yaml], Mime[:text]. - # - # For an input of 'application', returns [Mime[:html], Mime[:js], - # Mime[:xml], Mime[:yaml], Mime[:atom], Mime[:json], Mime[:rss], Mime[:url_encoded_form]. - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#206 - def parse_data_with_trailing_star(type); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#197 - def parse_trailing_star(accept_header); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#158 - def register(string, symbol, mime_type_synonyms = T.unsafe(nil), extension_synonyms = T.unsafe(nil), skip_lookup = T.unsafe(nil)); end - - # Registers an alias that's not used on MIME type lookup, but can be referenced directly. Especially useful for - # rendering different HTML versions depending on the user agent, like an iPhone. - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#154 - def register_alias(string, symbol, extension_synonyms = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#140 - def register_callback(&block); end - - # This method is opposite of register method. - # - # To unregister a MIME type: - # - # Mime::Type.unregister(:mobile) - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#215 - def unregister(symbol); end - end -end - -# A simple helper class used in parsing the accept header. -# -# source://actionpack//lib/action_dispatch/http/mime_type.rb#70 -class Mime::Type::AcceptItem - # @return [AcceptItem] a new instance of AcceptItem - # - # source://actionpack//lib/action_dispatch/http/mime_type.rb#74 - def initialize(index, name, q = T.unsafe(nil)); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#81 - def <=>(item); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#71 - def index; end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#71 - def index=(_arg0); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#71 - def name; end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#71 - def name=(_arg0); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#71 - def q; end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#71 - def q=(_arg0); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#71 - def to_s; end -end - -# source://actionpack//lib/action_dispatch/http/mime_type.rb#88 -class Mime::Type::AcceptList - class << self - # source://actionpack//lib/action_dispatch/http/mime_type.rb#131 - def find_item_by_name(array, name); end - - # source://actionpack//lib/action_dispatch/http/mime_type.rb#89 - def sort!(list); end - end -end - -# source://actionpack//lib/action_dispatch/http/mime_type.rb#232 -class Mime::Type::InvalidMimeType < ::StandardError; end - -# source://actionpack//lib/action_dispatch/http/mime_type.rb#227 -Mime::Type::MIME_NAME = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/mime_type.rb#229 -Mime::Type::MIME_PARAMETER = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/mime_type.rb#228 -Mime::Type::MIME_PARAMETER_VALUE = T.let(T.unsafe(nil), String) - -# source://actionpack//lib/action_dispatch/http/mime_type.rb#230 -Mime::Type::MIME_REGEXP = T.let(T.unsafe(nil), Regexp) - -# source://actionpack//lib/action_dispatch.rb#33 -module Rack - class << self - # source://rack/2.2.4/lib/rack/version.rb#26 - def release; end - - # source://rack/2.2.4/lib/rack/version.rb#19 - def version; end - end -end - -# source://rack/2.2.4/lib/rack.rb#29 -Rack::CACHE_CONTROL = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#31 -Rack::CONTENT_LENGTH = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#32 -Rack::CONTENT_TYPE = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#43 -Rack::DELETE = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#36 -Rack::ETAG = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#30 -Rack::EXPIRES = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack/file.rb#6 -Rack::File = Rack::Files - -# source://rack/2.2.4/lib/rack.rb#39 -Rack::GET = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#44 -Rack::HEAD = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#20 -Rack::HTTPS = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#35 -Rack::HTTP_COOKIE = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#17 -Rack::HTTP_HOST = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#18 -Rack::HTTP_PORT = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#19 -Rack::HTTP_VERSION = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#46 -Rack::LINK = T.let(T.unsafe(nil), String) - -# source://rack-test/2.0.2/lib/rack/test.rb#413 -Rack::MockSession = Rack::Test::Session - -# source://rack/2.2.4/lib/rack.rb#45 -Rack::OPTIONS = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#42 -Rack::PATCH = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#21 -Rack::PATH_INFO = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#40 -Rack::POST = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#41 -Rack::PUT = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#25 -Rack::QUERY_STRING = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#53 -Rack::RACK_ERRORS = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#63 -Rack::RACK_HIJACK = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#65 -Rack::RACK_HIJACK_IO = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#55 -Rack::RACK_INPUT = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#64 -Rack::RACK_IS_HIJACK = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#54 -Rack::RACK_LOGGER = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#76 -Rack::RACK_METHODOVERRIDE_ORIGINAL_METHOD = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#67 -Rack::RACK_MULTIPART_BUFFER_SIZE = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#68 -Rack::RACK_MULTIPART_TEMPFILE_FACTORY = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#60 -Rack::RACK_MULTIPROCESS = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#59 -Rack::RACK_MULTITHREAD = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#66 -Rack::RACK_RECURSIVE_INCLUDE = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#72 -Rack::RACK_REQUEST_COOKIE_HASH = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#73 -Rack::RACK_REQUEST_COOKIE_STRING = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#70 -Rack::RACK_REQUEST_FORM_HASH = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#69 -Rack::RACK_REQUEST_FORM_INPUT = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#71 -Rack::RACK_REQUEST_FORM_VARS = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#74 -Rack::RACK_REQUEST_QUERY_HASH = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#75 -Rack::RACK_REQUEST_QUERY_STRING = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#61 -Rack::RACK_RUNONCE = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#56 -Rack::RACK_SESSION = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#57 -Rack::RACK_SESSION_OPTIONS = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#77 -Rack::RACK_SESSION_UNPACKED_COOKIE_DATA = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#58 -Rack::RACK_SHOWSTATUS_DETAIL = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#52 -Rack::RACK_TEMPFILES = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#62 -Rack::RACK_URL_SCHEME = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#51 -Rack::RACK_VERSION = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack/version.rb#23 -Rack::RELEASE = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#22 -Rack::REQUEST_METHOD = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#23 -Rack::REQUEST_PATH = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#24 -Rack::SCRIPT_NAME = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#27 -Rack::SERVER_NAME = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#28 -Rack::SERVER_PORT = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#26 -Rack::SERVER_PROTOCOL = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#33 -Rack::SET_COOKIE = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#48 -Rack::TRACE = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#34 -Rack::TRANSFER_ENCODING = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack.rb#47 -Rack::UNLINK = T.let(T.unsafe(nil), String) - -# source://rack/2.2.4/lib/rack/version.rb#16 -Rack::VERSION = T.let(T.unsafe(nil), Array) diff --git a/sorbet/rbi/gems/actionpack@8.1.2.rbi b/sorbet/rbi/gems/actionpack@8.1.2.rbi new file mode 100644 index 0000000..dc33d1d --- /dev/null +++ b/sorbet/rbi/gems/actionpack@8.1.2.rbi @@ -0,0 +1,21969 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `actionpack` gem. +# Please instead update this file by running `bin/tapioca gem actionpack`. + + +# :markup: markdown +# +# source://actionpack//lib/abstract_controller/deprecator.rb#5 +module AbstractController + extend ::ActiveSupport::Autoload + + class << self + # source://actionpack//lib/abstract_controller/deprecator.rb#6 + def deprecator; end + + # source://actionpack//lib/abstract_controller.rb#27 + def eager_load!; end + end +end + +# Raised when a non-existing controller action is triggered. +# +# source://actionpack//lib/abstract_controller/base.rb#12 +class AbstractController::ActionNotFound < ::StandardError + include ::DidYouMean::Correctable + + # @return [ActionNotFound] a new instance of ActionNotFound + # + # source://actionpack//lib/abstract_controller/base.rb#15 + def initialize(message = T.unsafe(nil), controller = T.unsafe(nil), action = T.unsafe(nil)); end + + # source://actionpack//lib/abstract_controller/base.rb#13 + def action; end + + # source://actionpack//lib/abstract_controller/base.rb#13 + def controller; end + + # source://actionpack//lib/abstract_controller/base.rb#24 + def corrections; end +end + +# source://actionpack//lib/abstract_controller/asset_paths.rb#6 +module AbstractController::AssetPaths + extend ::ActiveSupport::Concern +end + +# # Abstract Controller Base +# +# AbstractController::Base is a low-level API. Nobody should be using it +# directly, and subclasses (like ActionController::Base) are expected to provide +# their own `render` method, since rendering means different things depending on +# the context. +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://actionpack//lib/abstract_controller/base.rb#36 +class AbstractController::Base + extend ::ActiveSupport::DescendantsTracker + + # Delegates to the class's ::action_methods. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def action_methods; end + + # Returns the name of the action this controller is processing. + # + # source://actionpack//lib/abstract_controller/base.rb#43 + def action_name; end + + # source://actionpack//lib/abstract_controller/base.rb#43 + def action_name=(_arg0); end + + # Returns true if a method for the action is available and can be dispatched, + # false otherwise. + # + # Notice that `action_methods.include?("foo")` may return false and + # `available_action?("foo")` returns true because this method considers actions + # that are also available through other means, for example, implicit render + # ones. + # + # #### Parameters + # * `action_name` - The name of an action to be tested + # + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def available_action?(action_name); end + + # source://actionpack//lib/abstract_controller/base.rb#49 + def config; end + + # source://actionpack//lib/abstract_controller/base.rb#49 + def config=(_arg0); end + + # Delegates to the class's ::controller_path. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def controller_path; end + + # Returns the formats that can be processed by the controller. + # + # source://actionpack//lib/abstract_controller/base.rb#47 + def formats; end + + # source://actionpack//lib/abstract_controller/base.rb#47 + def formats=(_arg0); end + + # source://actionpack//lib/abstract_controller/base.rb#128 + def inspect; end + + # Tests if a response body is set. Used to determine if the `process_action` + # callback needs to be terminated in AbstractController::Callbacks. + # + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def performed?; end + + # Calls the action going through the entire Action Dispatch stack. + # + # The actual method that is called is determined by calling #method_for_action. + # If no method can handle the action, then an AbstractController::ActionNotFound + # error is raised. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def process(action, *_arg1, **_arg2, &_arg3); end + + # Returns the body of the HTTP response sent by the controller. + # + # source://actionpack//lib/abstract_controller/base.rb#39 + def response_body; end + + # source://actionpack//lib/abstract_controller/base.rb#39 + def response_body=(_arg0); end + + # Actually call the method associated with the action. Override this method if + # you wish to change how action methods are called, not to add additional + # behavior around it. For example, you would override #send_action if you want + # to inject arguments into the method. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def send_action(*_arg0); end + + private + + # Takes an action name and returns the name of the method that will handle the + # action. + # + # It checks if the action name is valid and returns false otherwise. + # + # See method_for_action for more information. + # + # #### Parameters + # * `action_name` - An action name to find a method name for + # + # + # #### Returns + # * `string` - The name of the method that handles the action + # * false - No valid method name could be found. + # + # Raise `AbstractController::ActionNotFound`. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def _find_action_name(action_name); end + + # If the action name was not found, but a method called "action_missing" was + # found, #method_for_action will return "_handle_action_missing". This method + # calls #action_missing with the current action name. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def _handle_action_missing(*args); end + + # Checks if the action name is valid and returns false otherwise. + # + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def _valid_action_name?(action_name); end + + # Returns true if the name can be considered an action because it has a method + # defined in the controller. + # + # #### Parameters + # * `name` - The name of an action to be tested + # + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def action_method?(name); end + + # Takes an action name and returns the name of the method that will handle the + # action. In normal cases, this method returns the same name as it receives. By + # default, if #method_for_action receives a name that is not an action, it will + # look for an #action_missing method and return "_handle_action_missing" if one + # is found. + # + # Subclasses may override this method to add additional conditions that should + # be considered an action. For instance, an HTTP controller with a template + # matching the action name is considered to exist. + # + # If you override this method to handle additional cases, you may also provide a + # method (like `_handle_method_missing`) to handle the case. + # + # If none of these conditions are true, and `method_for_action` returns `nil`, + # an `AbstractController::ActionNotFound` exception will be raised. + # + # #### Parameters + # * `action_name` - An action name to find a method name for + # + # + # #### Returns + # * `string` - The name of the method that handles the action + # * `nil` - No method name could be found. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def method_for_action(action_name); end + + # Call the action. Override this in a subclass to modify the behavior around + # processing an action. This, and not #process, is the intended way to override + # action dispatching. + # + # Notice that the first argument is the method to be dispatched which is **not** + # necessarily the same as the action name. + # + # source://actionpack//lib/abstract_controller/base.rb#128 + def process_action(*_arg0, **_arg1, &_arg2); end + + class << self + # Returns the value of attribute abstract. + # + # source://actionpack//lib/abstract_controller/base.rb#53 + def abstract; end + + # Define a controller as abstract. See internal_methods for more details. + # + # source://actionpack//lib/abstract_controller/base.rb#57 + def abstract!; end + + # Returns the value of attribute abstract. + # + # source://actionpack//lib/abstract_controller/base.rb#54 + def abstract?; end + + # A `Set` of method names that should be considered actions. This includes all + # public instance methods on a controller, less any internal methods (see + # internal_methods), adding back in any methods that are internal, but still + # exist on the class itself. + # + # source://actionpack//lib/abstract_controller/base.rb#93 + def action_methods; end + + # action_methods are cached and there is sometimes a need to refresh them. + # ::clear_action_methods! allows you to do that, so next time you run + # action_methods, they will be recalculated. + # + # source://actionpack//lib/abstract_controller/base.rb#106 + def clear_action_methods!; end + + # source://actionpack//lib/abstract_controller/base.rb#49 + def config; end + + # source://actionpack//lib/abstract_controller/base.rb#49 + def config=(value); end + + # @yield [config] + # + # source://actionpack//lib/abstract_controller/base.rb#122 + def configure; end + + # Returns the full controller name, underscored, without the ending Controller. + # + # class MyApp::MyPostsController < AbstractController::Base + # + # end + # + # MyApp::MyPostsController.controller_path # => "my_app/my_posts" + # + # source://actionpack//lib/abstract_controller/base.rb#118 + def controller_path; end + + # source://actionpack//lib/abstract_controller/base.rb#132 + def eager_load!; end + + # source://actionpack//lib/abstract_controller/base.rb#61 + def inherited(klass); end + + # A list of all internal methods for a controller. This finds the first abstract + # superclass of a controller, and gets a list of all public instance methods on + # that abstract class. Public instance methods of a controller would normally be + # considered action methods, so methods declared on abstract classes are being + # removed. (ActionController::Metal and ActionController::Base are defined as + # abstract) + # + # source://actionpack//lib/abstract_controller/base.rb#77 + def internal_methods; end + + # Refresh the cached action_methods when a new action_method is added. + # + # source://actionpack//lib/abstract_controller/base.rb#127 + def method_added(name); end + + # Returns true if the given controller is capable of rendering a path. A + # subclass of `AbstractController::Base` may return false. An Email controller + # for example does not support paths, only full URLs. + # + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/base.rb#191 + def supports_path?; end + + private + + # source://actionpack//lib/abstract_controller/base.rb#49 + def __class_attr_config; end + + # source://actionpack//lib/abstract_controller/base.rb#49 + def __class_attr_config=(new_value); end + end +end + +# source://actionpack//lib/abstract_controller/caching.rb#6 +module AbstractController::Caching + include ::AbstractController::Caching::ConfigMethods + extend ::ActiveSupport::Concern + extend ::ActiveSupport::Autoload + include GeneratedInstanceMethods + include ::AbstractController::Caching::Fragments + + mixes_in_class_methods GeneratedClassMethods + + # source://actionpack//lib/abstract_controller/caching.rb#57 + def view_cache_dependencies; end + + private + + # Convenience accessor. + # + # source://actionpack//lib/abstract_controller/caching.rb#63 + def cache(key, options = T.unsafe(nil), &block); end + + module GeneratedClassMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end +end + +# source://actionpack//lib/abstract_controller/caching.rb#51 +module AbstractController::Caching::ClassMethods + # source://actionpack//lib/abstract_controller/caching.rb#52 + def view_cache_dependency(&dependency); end +end + +# source://actionpack//lib/abstract_controller/caching.rb#14 +module AbstractController::Caching::ConfigMethods + # source://actionpack//lib/abstract_controller/caching.rb#15 + def cache_store; end + + # source://actionpack//lib/abstract_controller/caching.rb#19 + def cache_store=(store); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/caching.rb#24 + def cache_configured?; end +end + +# # Abstract Controller Caching Fragments +# +# Fragment caching is used for caching various blocks within views without +# caching the entire action as a whole. This is useful when certain elements of +# an action change frequently or depend on complicated state while other parts +# rarely change or can be shared amongst multiple parties. The caching is done +# using the `cache` helper available in the Action View. See +# ActionView::Helpers::CacheHelper for more information. +# +# While it's strongly recommended that you use key-based cache expiration (see +# links in CacheHelper for more information), it is also possible to manually +# expire caches. For example: +# +# expire_fragment('name_of_cache') +# +# source://actionpack//lib/abstract_controller/caching/fragments.rb#21 +module AbstractController::Caching::Fragments + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods + + # Given a key (as described in `expire_fragment`), returns a key array suitable + # for use in reading, writing, or expiring a cached fragment. All keys begin + # with `:views`, followed by `ENV["RAILS_CACHE_ID"]` or + # `ENV["RAILS_APP_VERSION"]` if set, followed by any controller-wide key prefix + # values, ending with the specified `key` value. + # + # source://actionpack//lib/abstract_controller/caching/fragments.rb#68 + def combined_fragment_cache_key(key); end + + # Removes fragments from the cache. + # + # `key` can take one of three forms: + # + # * String - This would normally take the form of a path, like + # `pages/45/notes`. + # * Hash - Treated as an implicit call to `url_for`, like `{ controller: + # 'pages', action: 'notes', id: 45}` + # * Regexp - Will remove any fragment that matches, so `%r{pages/\d*/notes}` + # might remove all notes. Make sure you don't use anchors in the regex (`^` + # or `$`) because the actual filename matched looks like + # `./cache/filename/path.cache`. Note: Regexp expiration is only supported + # on caches that can iterate over all keys (unlike memcached). + # + # + # `options` is passed through to the cache store's `delete` method (or + # `delete_matched`, for Regexp keys). + # + # source://actionpack//lib/abstract_controller/caching/fragments.rb#131 + def expire_fragment(key, options = T.unsafe(nil)); end + + # Check if a cached fragment from the location signified by `key` exists (see + # `expire_fragment` for acceptable formats). + # + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/caching/fragments.rb#105 + def fragment_exist?(key, options = T.unsafe(nil)); end + + # source://actionpack//lib/abstract_controller/caching/fragments.rb#144 + def instrument_fragment_cache(name, key, &block); end + + # Reads a cached fragment from the location signified by `key` (see + # `expire_fragment` for acceptable formats). + # + # source://actionpack//lib/abstract_controller/caching/fragments.rb#93 + def read_fragment(key, options = T.unsafe(nil)); end + + # Writes `content` to the location signified by `key` (see `expire_fragment` for + # acceptable formats). + # + # source://actionpack//lib/abstract_controller/caching/fragments.rb#80 + def write_fragment(key, content, options = T.unsafe(nil)); end + + module GeneratedClassMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end +end + +# source://actionpack//lib/abstract_controller/caching/fragments.rb#38 +module AbstractController::Caching::Fragments::ClassMethods + # Allows you to specify controller-wide key prefixes for cache fragments. Pass + # either a constant `value`, or a block which computes a value each time a cache + # key is generated. + # + # For example, you may want to prefix all fragment cache keys with a global + # version identifier, so you can easily invalidate all caches. + # + # class ApplicationController + # fragment_cache_key "v1" + # end + # + # When it's time to invalidate all fragments, simply change the string constant. + # Or, progressively roll out the cache invalidation using a computed value: + # + # class ApplicationController + # fragment_cache_key do + # @account.id.odd? ? "v1" : "v2" + # end + # end + # + # source://actionpack//lib/abstract_controller/caching/fragments.rb#58 + def fragment_cache_key(value = T.unsafe(nil), &key); end +end + +# # Abstract Controller Callbacks +# +# Abstract Controller provides hooks during the life cycle of a controller +# action. Callbacks allow you to trigger logic during this cycle. Available +# callbacks are: +# +# * `after_action` +# * `append_after_action` +# * `append_around_action` +# * `append_before_action` +# * `around_action` +# * `before_action` +# * `prepend_after_action` +# * `prepend_around_action` +# * `prepend_before_action` +# * `skip_after_action` +# * `skip_around_action` +# * `skip_before_action` +# +# source://actionpack//lib/abstract_controller/callbacks.rb#24 +module AbstractController::Callbacks + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Callbacks + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + mixes_in_class_methods ::AbstractController::Callbacks::ClassMethods + + private + + # Override `AbstractController::Base#process_action` to run the `process_action` + # callbacks around the normal behavior. + # + # source://actionpack//lib/abstract_controller/callbacks.rb#265 + def process_action(*_arg0, **_arg1, &_arg2); end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + end + + module GeneratedInstanceMethods + def __callbacks; end + end +end + +# source://actionpack//lib/abstract_controller/callbacks.rb#41 +class AbstractController::Callbacks::ActionFilter + # @return [ActionFilter] a new instance of ActionFilter + # + # source://actionpack//lib/abstract_controller/callbacks.rb#42 + def initialize(filters, conditional_key, actions); end + + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/callbacks.rb#71 + def after(controller); end + + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/callbacks.rb#73 + def around(controller); end + + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/callbacks.rb#72 + def before(controller); end + + # @return [Boolean] + # + # source://actionpack//lib/abstract_controller/callbacks.rb#48 + def match?(controller); end +end + +# source://actionpack//lib/abstract_controller/callbacks.rb#76 +module AbstractController::Callbacks::ClassMethods + # Take callback names and an optional callback proc, normalize them, then call + # the block with each callback. This allows us to abstract the normalization + # across several methods that use it. + # + # #### Parameters + # * `callbacks` - An array of callbacks, with an optional options hash as the + # last parameter. + # * `block` - A proc that should be added to the callbacks. + # + # + # #### Block Parameters + # * `name` - The callback to be added. + # * `options` - A hash of options to be used when adding the callback. + # + # source://actionpack//lib/abstract_controller/callbacks.rb#122 + def _insert_callbacks(callbacks, block = T.unsafe(nil)); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#100 + def _normalize_callback_option(options, from, to); end + + # If `:only` or `:except` are used, convert the options into the `:if` and + # `:unless` options of ActiveSupport::Callbacks. + # + # The basic idea is that `:only => :index` gets converted to `:if => proc {|c| + # c.action_name == "index" }`. + # + # Note that `:only` has priority over `:if` in case they are used together. + # + # only: :index, if: -> { true } # the :if option will be ignored. + # + # Note that `:if` has priority over `:except` in case they are used together. + # + # except: :index, if: -> { true } # the :except option will be ignored. + # + # #### Options + # * `only` - The callback should be run only for this action. + # * `except` - The callback should be run for all actions except this action. + # + # source://actionpack//lib/abstract_controller/callbacks.rb#95 + def _normalize_callback_options(options); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#233 + def after_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#254 + def append_after_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#254 + def append_around_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#254 + def append_before_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#233 + def around_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#233 + def before_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#257 + def internal_methods; end + + # source://actionpack//lib/abstract_controller/callbacks.rb#239 + def prepend_after_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#239 + def prepend_around_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#239 + def prepend_before_action(*names, &blk); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#247 + def skip_after_action(*names); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#247 + def skip_around_action(*names); end + + # source://actionpack//lib/abstract_controller/callbacks.rb#247 + def skip_before_action(*names); end +end + +# source://actionpack//lib/abstract_controller/callbacks.rb#32 +AbstractController::Callbacks::DEFAULT_INTERNAL_METHODS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/abstract_controller/collector.rb#8 +module AbstractController::Collector + # source://actionpack//lib/abstract_controller/collector.rb#11 + def atom(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def bmp(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def css(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def csv(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def gif(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def gzip(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def html(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def ics(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def jpeg(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def js(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def json(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def m4a(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def md(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def mp3(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def mp4(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def mpeg(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def multipart_form(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def ogg(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def otf(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def pdf(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def png(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def rss(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def svg(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def text(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def tiff(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def ttf(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def url_encoded_form(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def vcf(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def vtt(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def webm(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def webp(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def woff(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def woff2(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def xml(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def yaml(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/abstract_controller/collector.rb#11 + def zip(*_arg0, **_arg1, &_arg2); end + + private + + # source://actionpack//lib/abstract_controller/collector.rb#27 + def method_missing(symbol, *_arg1, **_arg2, &_arg3); end + + class << self + # source://actionpack//lib/abstract_controller/collector.rb#9 + def generate_method_for_mime(mime); end + end +end + +# source://actionpack//lib/abstract_controller/rendering.rb#10 +class AbstractController::DoubleRenderError < ::AbstractController::Error + # @return [DoubleRenderError] a new instance of DoubleRenderError + # + # source://actionpack//lib/abstract_controller/rendering.rb#13 + def initialize(message = T.unsafe(nil)); end +end + +# source://actionpack//lib/abstract_controller/rendering.rb#11 +AbstractController::DoubleRenderError::DEFAULT_MESSAGE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/abstract_controller/error.rb#6 +class AbstractController::Error < ::StandardError; end + +# source://actionpack//lib/abstract_controller/helpers.rb#9 +module AbstractController::Helpers + extend ::ActiveSupport::Concern + extend ::AbstractController::Helpers::Resolution + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + + # source://actionpack//lib/abstract_controller/helpers.rb#28 + def _helpers; end + + module GeneratedClassMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end + + module GeneratedInstanceMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end +end + +# source://actionpack//lib/abstract_controller/helpers.rb#64 +module AbstractController::Helpers::ClassMethods + include ::AbstractController::Helpers::Resolution + + # Sets the attribute _helpers + # + # @param value the value to set the attribute _helpers to. + # + # source://actionpack//lib/abstract_controller/helpers.rb#76 + def _helpers=(_arg0); end + + # source://actionpack//lib/abstract_controller/helpers.rb#218 + def _helpers_for_modification; end + + # Clears up all existing helpers in this class, only keeping the helper with the + # same name as this class. + # + # source://actionpack//lib/abstract_controller/helpers.rb#209 + def clear_helpers; end + + # Includes the given modules in the template class. + # + # Modules can be specified in different ways. All of the following calls include + # `FooHelper`: + # + # # Module, recommended. + # helper FooHelper + # + # # String/symbol without the "helper" suffix, camel or snake case. + # helper "Foo" + # helper :Foo + # helper "foo" + # helper :foo + # + # The last two assume that `"foo".camelize` returns "Foo". + # + # When strings or symbols are passed, the method finds the actual module object + # using String#constantize. Therefore, if the module has not been yet loaded, it + # has to be autoloadable, which is normally the case. + # + # Namespaces are supported. The following calls include `Foo::BarHelper`: + # + # # Module, recommended. + # helper Foo::BarHelper + # + # # String/symbol without the "helper" suffix, camel or snake case. + # helper "Foo::Bar" + # helper :"Foo::Bar" + # helper "foo/bar" + # helper :"foo/bar" + # + # The last two assume that `"foo/bar".camelize` returns "Foo::Bar". + # + # The method accepts a block too. If present, the block is evaluated in the + # context of the controller helper module. This simple call makes the `wadus` + # method available in templates of the enclosing controller: + # + # helper do + # def wadus + # "wadus" + # end + # end + # + # Furthermore, all the above styles can be mixed together: + # + # helper FooHelper, "woo", "bar/baz" do + # def wadus + # "wadus" + # end + # end + # + # source://actionpack//lib/abstract_controller/helpers.rb#198 + def helper(*args, &block); end + + # Declare a controller method as a helper. For example, the following + # makes the `current_user` and `logged_in?` controller methods available + # to the view: + # + # class ApplicationController < ActionController::Base + # helper_method :current_user, :logged_in? + # + # private + # def current_user + # @current_user ||= User.find_by(id: session[:user]) + # end + # + # def logged_in? + # current_user != nil + # end + # end + # + # In a view: + # + # <% if logged_in? -%>Welcome, <%= current_user.name %><% end -%> + # + # #### Parameters + # * `method[, method]` - A name or names of a method on the controller to be + # made available on the view. + # + # source://actionpack//lib/abstract_controller/helpers.rb#128 + def helper_method(*methods); end + + # When a class is inherited, wrap its helper module in a new module. This + # ensures that the parent class's module can be changed independently of the + # child class's. + # + # source://actionpack//lib/abstract_controller/helpers.rb#68 + def inherited(klass); end + + private + + # source://actionpack//lib/abstract_controller/helpers.rb#237 + def default_helper_module!; end + + # source://actionpack//lib/abstract_controller/helpers.rb#226 + def define_helpers_module(klass, helpers = T.unsafe(nil)); end +end + +# source://actionpack//lib/abstract_controller/helpers.rb#32 +module AbstractController::Helpers::Resolution + # source://actionpack//lib/abstract_controller/helpers.rb#48 + def all_helpers_from_path(path); end + + # source://actionpack//lib/abstract_controller/helpers.rb#57 + def helper_modules_from_paths(paths); end + + # source://actionpack//lib/abstract_controller/helpers.rb#33 + def modules_for_helpers(modules_or_helper_prefixes); end +end + +# source://actionpack//lib/abstract_controller/logger.rb#8 +module AbstractController::Logger + extend ::ActiveSupport::Concern + include ::ActiveSupport::Benchmarkable +end + +# source://actionpack//lib/abstract_controller/railties/routes_helpers.rb#8 +module AbstractController::Railties; end + +# source://actionpack//lib/abstract_controller/railties/routes_helpers.rb#9 +module AbstractController::Railties::RoutesHelpers + class << self + # source://actionpack//lib/abstract_controller/railties/routes_helpers.rb#10 + def with(routes, include_path_helpers = T.unsafe(nil)); end + end +end + +# source://actionpack//lib/abstract_controller/rendering.rb#18 +module AbstractController::Rendering + extend ::ActiveSupport::Concern + include ::ActionView::ViewPaths + + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + + # Normalizes arguments and options, and then delegates to render_to_body and + # sticks the result in `self.response_body`. + # + # Supported options depend on the underlying `render_to_body` implementation. + # + # source://actionpack//lib/abstract_controller/rendering.rb#26 + def render(*args, &block); end + + # Performs the actual template rendering. + # + # source://actionpack//lib/abstract_controller/rendering.rb#50 + def render_to_body(options = T.unsafe(nil)); end + + # Similar to #render, but only returns the rendered template as a string, + # instead of setting `self.response_body`. + # + # If a component extends the semantics of `response_body` (as ActionController + # extends it to be anything that responds to the method each), this method needs + # to be overridden in order to still return a string. + # + # source://actionpack//lib/abstract_controller/rendering.rb#44 + def render_to_string(*args, &block); end + + # Returns `Content-Type` of rendered content. + # + # source://actionpack//lib/abstract_controller/rendering.rb#54 + def rendered_format; end + + # This method should return a hash with assigns. You can overwrite this + # configuration per controller. + # + # source://actionpack//lib/abstract_controller/rendering.rb#62 + def view_assigns; end + + private + + # Normalize args by converting `render "foo"` to `render action: "foo"` and + # `render "foo/bar"` to `render file: "foo/bar"`. + # + # source://actionpack//lib/abstract_controller/rendering.rb#73 + def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end + + # Normalize options. + # + # source://actionpack//lib/abstract_controller/rendering.rb#88 + def _normalize_options(options); end + + # Normalize args and options. + # + # source://actionpack//lib/abstract_controller/rendering.rb#114 + def _normalize_render(*args, &block); end + + # Process the rendered format. + # + # source://actionpack//lib/abstract_controller/rendering.rb#98 + def _process_format(format); end + + # Process extra options. + # + # source://actionpack//lib/abstract_controller/rendering.rb#93 + def _process_options(options); end + + # source://actionpack//lib/abstract_controller/rendering.rb#101 + def _process_variant(options); end + + # source://actionpack//lib/abstract_controller/rendering.rb#121 + def _protected_ivars; end + + # source://actionpack//lib/abstract_controller/rendering.rb#104 + def _set_html_content_type; end + + # source://actionpack//lib/abstract_controller/rendering.rb#110 + def _set_rendered_content_type(format); end + + # source://actionpack//lib/abstract_controller/rendering.rb#107 + def _set_vary_header; end +end + +# source://actionpack//lib/abstract_controller/rendering.rb#58 +AbstractController::Rendering::DEFAULT_PROTECTED_INSTANCE_VARIABLES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/abstract_controller/translation.rb#8 +module AbstractController::Translation + # Delegates to `I18n.localize`. + # + # source://actionpack//lib/abstract_controller/translation.rb#40 + def l(object, **options); end + + # Delegates to `I18n.localize`. + # + # source://actionpack//lib/abstract_controller/translation.rb#37 + def localize(object, **options); end + + # Delegates to `I18n.translate`. + # + # When the given key starts with a period, it will be scoped by the current + # controller and action. So if you call `translate(".foo")` from + # `PeopleController#index`, it will convert the call to + # `I18n.translate("people.index.foo")`. This makes it less repetitive to + # translate many keys within the same controller / action and gives you a simple + # framework for scoping them consistently. + # + # source://actionpack//lib/abstract_controller/translation.rb#34 + def t(key, **options); end + + # Delegates to `I18n.translate`. + # + # When the given key starts with a period, it will be scoped by the current + # controller and action. So if you call `translate(".foo")` from + # `PeopleController#index`, it will convert the call to + # `I18n.translate("people.index.foo")`. This makes it less repetitive to + # translate many keys within the same controller / action and gives you a simple + # framework for scoping them consistently. + # + # source://actionpack//lib/abstract_controller/translation.rb#17 + def translate(key, **options); end +end + +# # URL For +# +# Includes `url_for` into the host class (e.g. an abstract controller or +# mailer). The class has to provide a `RouteSet` by implementing the `_routes` +# methods. Otherwise, an exception will be raised. +# +# Note that this module is completely decoupled from HTTP - the only requirement +# is a valid `_routes` implementation. +# +# source://actionpack//lib/abstract_controller/url_for.rb#14 +module AbstractController::UrlFor + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Routing::UrlFor + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods + + # source://actionpack//lib/abstract_controller/url_for.rb#18 + def _routes; end + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end + +# source://actionpack//lib/abstract_controller/url_for.rb#23 +module AbstractController::UrlFor::ClassMethods + # source://actionpack//lib/abstract_controller/url_for.rb#24 + def _routes; end + + # source://actionpack//lib/abstract_controller/url_for.rb#28 + def action_methods; end +end + +# # Action Controller +# +# Action Controller is a module of Action Pack. +# +# Action Controller provides a base controller class that can be subclassed to +# implement filters and actions to handle requests. The result of an action is +# typically content generated from views. +# +# source://actionpack//lib/action_controller/deprecator.rb#5 +module ActionController + extend ::ActiveSupport::Autoload + + class << self + # See Renderers.add + # + # source://actionpack//lib/action_controller/metal/renderers.rb#7 + def add_renderer(key, &block); end + + # source://actionpack//lib/action_controller/deprecator.rb#6 + def deprecator; end + + # See Renderers.remove + # + # source://actionpack//lib/action_controller/metal/renderers.rb#12 + def remove_renderer(key); end + end +end + +# # Action Controller API +# +# API Controller is a lightweight version of ActionController::Base, created for +# applications that don't require all functionalities that a complete Rails +# controller provides, allowing you to create controllers with just the features +# that you need for API only applications. +# +# An API Controller is different from a normal controller in the sense that by +# default it doesn't include a number of features that are usually required by +# browser access only: layouts and templates rendering, flash, assets, and so +# on. This makes the entire controller stack thinner, suitable for API +# applications. It doesn't mean you won't have such features if you need them: +# they're all available for you to include in your application, they're just not +# part of the default API controller stack. +# +# Normally, `ApplicationController` is the only controller that inherits from +# `ActionController::API`. All other controllers in turn inherit from +# `ApplicationController`. +# +# A sample controller could look like this: +# +# class PostsController < ApplicationController +# def index +# posts = Post.all +# render json: posts +# end +# end +# +# Request, response, and parameters objects all work the exact same way as +# ActionController::Base. +# +# ## Renders +# +# The default API Controller stack includes all renderers, which means you can +# use `render :json` and siblings freely in your controllers. Keep in mind that +# templates are not going to be rendered, so you need to ensure your controller +# is calling either `render` or `redirect_to` in all actions, otherwise it will +# return `204 No Content`. +# +# def show +# post = Post.find(params[:id]) +# render json: post +# end +# +# ## Redirects +# +# Redirects are used to move from one action to another. You can use the +# `redirect_to` method in your controllers in the same way as in +# ActionController::Base. For example: +# +# def create +# redirect_to root_url and return if not_authorized? +# # do stuff here +# end +# +# ## Adding New Behavior +# +# In some scenarios you may want to add back some functionality provided by +# ActionController::Base that is not present by default in +# `ActionController::API`, for instance `MimeResponds`. This module gives you +# the `respond_to` method. Adding it is quite simple, you just need to include +# the module in a specific controller or in `ApplicationController` in case you +# want it available in your entire application: +# +# class ApplicationController < ActionController::API +# include ActionController::MimeResponds +# end +# +# class PostsController < ApplicationController +# def index +# posts = Post.all +# +# respond_to do |format| +# format.json { render json: posts } +# format.xml { render xml: posts } +# end +# end +# end +# +# Make sure to check the modules included in ActionController::Base if you want +# to use any other functionality that is not provided by `ActionController::API` +# out of the box. +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://actionpack//lib/action_controller/api.rb#93 +class ActionController::API < ::ActionController::Metal + include ::ActionView::ViewPaths + include ::AbstractController::Rendering + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + include ::AbstractController::UrlFor + include ::ActionController::UrlFor + include ::AbstractController::Logger + include ::ActiveSupport::Benchmarkable + include ::ActionController::Redirecting + include ::ActionController::ApiRendering + include ::ActionController::Rendering + include ::ActionController::Renderers + include ::ActionController::Renderers::All + include ::ActionController::Head + include ::ActionController::ConditionalGet + include ::ActionController::BasicImplicitRender + include ::ActionController::StrongParameters + include ::ActionController::RateLimiting + include ::ActionController::Caching + include ::AbstractController::Caching::Fragments + include ::AbstractController::Caching::ConfigMethods + include ::AbstractController::Caching + include ::ActionController::DataStreaming + include ::ActionController::DefaultHeaders + include ::ActionController::Logging + include ::ActiveSupport::Callbacks + include ::AbstractController::Callbacks + include ::ActiveSupport::Rescuable + include ::ActionController::Rescue + include ::ActionController::Instrumentation + include ::ActionController::ParamsWrapper + extend ::ActionView::ViewPaths::ClassMethods + extend ::AbstractController::UrlFor::ClassMethods + extend ::ActionController::Redirecting::ClassMethods + extend ::ActionController::Rendering::ClassMethods + extend ::ActionController::Renderers::ClassMethods + extend ::ActionController::ConditionalGet::ClassMethods + extend ::ActionController::RateLimiting::ClassMethods + extend ::AbstractController::Caching::Fragments::ClassMethods + extend ::AbstractController::Caching::ClassMethods + extend ::AbstractController::Caching::ConfigMethods + extend ::ActionController::DefaultHeaders::ClassMethods + extend ::ActionController::Logging::ClassMethods + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::AbstractController::Callbacks::ClassMethods + extend ::ActiveSupport::Rescuable::ClassMethods + extend ::ActionController::Rescue::ClassMethods + extend ::ActionController::Instrumentation::ClassMethods + extend ::ActionController::ParamsWrapper::ClassMethods + extend ::ActionController::Renderers::DeprecatedEscapeJsonResponses + + # source://actionpack//lib/action_controller/api.rb#150 + def __callbacks; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _process_action_callbacks; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _renderers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _renderers=(_arg0); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _renderers?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _run_process_action_callbacks; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _run_process_action_callbacks!(&block); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _view_cache_dependencies; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _view_cache_dependencies=(_arg0); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _view_cache_dependencies?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _wrapper_options; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _wrapper_options=(_arg0); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _wrapper_options?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_open_redirect; end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_open_redirect=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_path_relative_redirect; end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_path_relative_redirect=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_static_extension(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_static_extension=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_url_options; end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_url_options=(_arg0); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_url_options?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def enable_fragment_cache_logging(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def enable_fragment_cache_logging=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def etaggers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def etaggers=(_arg0); end + + # source://actionpack//lib/action_controller/api.rb#150 + def etaggers?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def fragment_cache_keys; end + + # source://actionpack//lib/action_controller/api.rb#150 + def fragment_cache_keys=(_arg0); end + + # source://actionpack//lib/action_controller/api.rb#150 + def fragment_cache_keys?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def logger(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def logger=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def perform_caching(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def perform_caching=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_missing_callback_actions; end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_missing_callback_actions=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_open_redirects; end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_open_redirects=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def rescue_handlers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def rescue_handlers=(_arg0); end + + # source://actionpack//lib/action_controller/api.rb#150 + def rescue_handlers?; end + + class << self + # source://actionpack//lib/action_controller/api.rb#150 + def __callbacks; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __callbacks=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _allowed_redirect_hosts; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _allowed_redirect_hosts=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _process_action_callbacks; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _process_action_callbacks=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _renderers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _renderers=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _renderers?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _view_cache_dependencies; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _view_cache_dependencies=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _view_cache_dependencies?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _wrapper_options; end + + # source://actionpack//lib/action_controller/api.rb#150 + def _wrapper_options=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def _wrapper_options?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_open_redirect; end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_open_redirect=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_path_relative_redirect; end + + # source://actionpack//lib/action_controller/api.rb#150 + def action_on_path_relative_redirect=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def allowed_redirect_hosts; end + + # source://actionpack//lib/action_controller/api.rb#150 + def allowed_redirect_hosts_permissions; end + + # source://actionpack//lib/action_controller/api.rb#150 + def allowed_redirect_hosts_permissions=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_static_extension(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_static_extension=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_url_options; end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_url_options=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def default_url_options?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def enable_fragment_cache_logging(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def enable_fragment_cache_logging=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def escape_json_responses; end + + # source://actionpack//lib/action_controller/api.rb#150 + def escape_json_responses=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def escape_json_responses?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def etaggers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def etaggers=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def etaggers?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def fragment_cache_keys; end + + # source://actionpack//lib/action_controller/api.rb#150 + def fragment_cache_keys=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def fragment_cache_keys?; end + + # source://actionpack//lib/action_controller/api.rb#150 + def logger(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def logger=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def perform_caching(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/api.rb#150 + def perform_caching=(arg); end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_missing_callback_actions; end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_missing_callback_actions=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_open_redirects; end + + # source://actionpack//lib/action_controller/api.rb#150 + def raise_on_open_redirects=(val); end + + # source://actionpack//lib/action_controller/api.rb#150 + def rescue_handlers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def rescue_handlers=(value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def rescue_handlers?; end + + # Shortcut helper that returns all the ActionController::API modules except the + # ones passed as arguments: + # + # class MyAPIBaseController < ActionController::Metal + # ActionController::API.without_modules(:UrlFor).each do |left| + # include left + # end + # end + # + # This gives better control over what you want to exclude and makes it easier to + # create an API controller class, instead of listing the modules required + # manually. + # + # source://actionpack//lib/action_controller/api.rb#108 + def without_modules(*modules); end + + private + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr___callbacks; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr___callbacks=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__allowed_redirect_hosts; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__allowed_redirect_hosts=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__renderers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__renderers=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__view_cache_dependencies; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__view_cache_dependencies=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__wrapper_options; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr__wrapper_options=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_allowed_redirect_hosts_permissions; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_allowed_redirect_hosts_permissions=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#93 + def __class_attr_config; end + + # source://actionpack//lib/action_controller/api.rb#93 + def __class_attr_config=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_default_url_options; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_default_url_options=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_escape_json_responses; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_escape_json_responses=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_etaggers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_etaggers=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_fragment_cache_keys; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_fragment_cache_keys=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#93 + def __class_attr_middleware_stack; end + + # source://actionpack//lib/action_controller/api.rb#93 + def __class_attr_middleware_stack=(new_value); end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_rescue_handlers; end + + # source://actionpack//lib/action_controller/api.rb#150 + def __class_attr_rescue_handlers=(new_value); end + end +end + +# source://actionpack//lib/action_controller/api.rb#116 +ActionController::API::MODULES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_controller/metal/exceptions.rb#6 +class ActionController::ActionControllerError < ::StandardError; end + +# source://actionpack//lib/action_controller/metal/allow_browser.rb#6 +module ActionController::AllowBrowser + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::AllowBrowser::ClassMethods + + private + + # source://actionpack//lib/action_controller/metal/allow_browser.rb#63 + def allow_browser(versions:, block:); end +end + +# source://actionpack//lib/action_controller/metal/allow_browser.rb#73 +class ActionController::AllowBrowser::BrowserBlocker + # @return [BrowserBlocker] a new instance of BrowserBlocker + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#80 + def initialize(request, versions:); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#84 + def blocked?; end + + # Returns the value of attribute request. + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#78 + def request; end + + # Returns the value of attribute versions. + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#78 + def versions; end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#105 + def bot?; end + + # source://actionpack//lib/action_controller/metal/allow_browser.rb#121 + def expanded_versions; end + + # source://actionpack//lib/action_controller/metal/allow_browser.rb#117 + def minimum_browser_version_for_browser; end + + # source://actionpack//lib/action_controller/metal/allow_browser.rb#125 + def normalized_browser_name; end + + # source://actionpack//lib/action_controller/metal/allow_browser.rb#89 + def parsed_user_agent; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#97 + def unsupported_browser?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#93 + def user_agent_version_reported?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#109 + def version_below_minimum_required?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#101 + def version_guarded_browser?; end +end + +# source://actionpack//lib/action_controller/metal/allow_browser.rb#74 +ActionController::AllowBrowser::BrowserBlocker::SETS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_controller/metal/allow_browser.rb#9 +module ActionController::AllowBrowser::ClassMethods + # Specify the browser versions that will be allowed to access all actions (or + # some, as limited by `only:` or `except:`). Only browsers matched in the hash + # or named set passed to `versions:` will be blocked if they're below the + # versions specified. This means that all other browsers, as well as agents that + # aren't reporting a user-agent header, will be allowed access. + # + # A browser that's blocked will by default be served the file in + # public/406-unsupported-browser.html with an HTTP status code of "406 Not + # Acceptable". + # + # In addition to specifically named browser versions, you can also pass + # `:modern` as the set to restrict support to browsers natively supporting webp + # images, web push, badges, import maps, CSS nesting, and CSS :has. This + # includes Safari 17.2+, Chrome 120+, Firefox 121+, Opera 106+. + # + # You can use https://caniuse.com to check for browser versions supporting the + # features you use. + # + # You can use `ActiveSupport::Notifications` to subscribe to events of browsers + # being blocked using the `browser_block.action_controller` event name. + # + # Examples: + # + # class ApplicationController < ActionController::Base + # # Allow only browsers natively supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has + # allow_browser versions: :modern + # end + # + # class ApplicationController < ActionController::Base + # # Allow only browsers natively supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has + # allow_browser versions: :modern, block: :handle_outdated_browser + # + # private + # def handle_outdated_browser + # render file: Rails.root.join("public/custom-error.html"), status: :not_acceptable + # end + # end + # + # class ApplicationController < ActionController::Base + # # All versions of Chrome and Opera will be allowed, but no versions of "internet explorer" (ie). Safari needs to be 16.4+ and Firefox 121+. + # allow_browser versions: { safari: 16.4, firefox: 121, ie: false } + # end + # + # class MessagesController < ApplicationController + # # In addition to the browsers blocked by ApplicationController, also block Opera below 104 and Chrome below 119 for the show action. + # allow_browser versions: { opera: 104, chrome: 119 }, only: :show + # end + # + # source://actionpack//lib/action_controller/metal/allow_browser.rb#57 + def allow_browser(versions:, block: T.unsafe(nil), **options); end +end + +# source://actionpack//lib/action_controller/api/api_rendering.rb#6 +module ActionController::ApiRendering + extend ::ActiveSupport::Concern + include ::ActionController::Rendering + + mixes_in_class_methods ::ActionController::Rendering::ClassMethods + + # source://actionpack//lib/action_controller/api/api_rendering.rb#13 + def render_to_body(options = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#9 +class ActionController::BadRequest < ::ActionController::ActionControllerError + # @return [BadRequest] a new instance of BadRequest + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#10 + def initialize(msg = T.unsafe(nil)); end +end + +# # Action Controller Base +# +# Action Controllers are the core of a web request in Rails. They are made up of +# one or more actions that are executed on request and then either it renders a +# template or redirects to another action. An action is defined as a public +# method on the controller, which will automatically be made accessible to the +# web-server through Rails Routes. +# +# By default, only the ApplicationController in a Rails application inherits +# from `ActionController::Base`. All other controllers inherit from +# ApplicationController. This gives you one class to configure things such as +# request forgery protection and filtering of sensitive request parameters. +# +# A sample controller could look like this: +# +# class PostsController < ApplicationController +# def index +# @posts = Post.all +# end +# +# def create +# @post = Post.create params[:post] +# redirect_to posts_path +# end +# end +# +# Actions, by default, render a template in the `app/views` directory +# corresponding to the name of the controller and action after executing code in +# the action. For example, the `index` action of the PostsController would +# render the template `app/views/posts/index.html.erb` by default after +# populating the `@posts` instance variable. +# +# Unlike index, the create action will not render a template. After performing +# its main purpose (creating a new post), it initiates a redirect instead. This +# redirect works by returning an external `302 Moved` HTTP response that takes +# the user to the index action. +# +# These two methods represent the two basic action archetypes used in Action +# Controllers: Get-and-show and do-and-redirect. Most actions are variations on +# these themes. +# +# ## Requests +# +# For every request, the router determines the value of the `controller` and +# `action` keys. These determine which controller and action are called. The +# remaining request parameters, the session (if one is available), and the full +# request with all the HTTP headers are made available to the action through +# accessor methods. Then the action is performed. +# +# The full request object is available via the request accessor and is primarily +# used to query for HTTP headers: +# +# def server_ip +# location = request.env["REMOTE_ADDR"] +# render plain: "This server hosted at #{location}" +# end +# +# ## Parameters +# +# All request parameters, whether they come from a query string in the URL or +# form data submitted through a POST request are available through the `params` +# method which returns a hash. For example, an action that was performed through +# `/posts?category=All&limit=5` will include `{ "category" => "All", "limit" => +# "5" }` in `params`. +# +# It's also possible to construct multi-dimensional parameter hashes by +# specifying keys using brackets, such as: +# +# +# +# +# A request coming from a form holding these inputs will include `{ "post" => { +# "name" => "david", "address" => "hyacintvej" } }`. If the address input had +# been named `post[address][street]`, the `params` would have included `{ "post" +# => { "address" => { "street" => "hyacintvej" } } }`. There's no limit to the +# depth of the nesting. +# +# ## Sessions +# +# Sessions allow you to store objects in between requests. This is useful for +# objects that are not yet ready to be persisted, such as a Signup object +# constructed in a multi-paged process, or objects that don't change much and +# are needed all the time, such as a User object for a system that requires +# login. The session should not be used, however, as a cache for objects where +# it's likely they could be changed unknowingly. It's usually too much work to +# keep it all synchronized -- something databases already excel at. +# +# You can place objects in the session by using the `session` method, which +# accesses a hash: +# +# session[:person] = Person.authenticate(user_name, password) +# +# You can retrieve it again through the same hash: +# +# "Hello #{session[:person]}" +# +# For removing objects from the session, you can either assign a single key to +# `nil`: +# +# # removes :person from session +# session[:person] = nil +# +# or you can remove the entire session with `reset_session`. +# +# By default, sessions are stored in an encrypted browser cookie (see +# ActionDispatch::Session::CookieStore). Thus the user will not be able to read +# or edit the session data. However, the user can keep a copy of the cookie even +# after it has expired, so you should avoid storing sensitive information in +# cookie-based sessions. +# +# ## Responses +# +# Each action results in a response, which holds the headers and document to be +# sent to the user's browser. The actual response object is generated +# automatically through the use of renders and redirects and requires no user +# intervention. +# +# ## Renders +# +# Action Controller sends content to the user by using one of five rendering +# methods. The most versatile and common is the rendering of a template. +# Also included with \Rails is Action View, which enables rendering of ERB +# templates. It's automatically configured. The controller passes objects to the +# view by assigning instance variables: +# +# def show +# @post = Post.find(params[:id]) +# end +# +# Which are then automatically available to the view: +# +# Title: <%= @post.title %> +# +# You don't have to rely on the automated rendering. For example, actions that +# could result in the rendering of different templates will use the manual +# rendering methods: +# +# def search +# @results = Search.find(params[:query]) +# case @results.count +# when 0 then render action: "no_results" +# when 1 then render action: "show" +# when 2..10 then render action: "show_many" +# end +# end +# +# Read more about writing ERB and Builder templates in ActionView::Base. +# +# ## Redirects +# +# Redirects are used to move from one action to another. For example, after a +# `create` action, which stores a blog entry to the database, we might like to +# show the user the new entry. Because we're following good DRY principles +# (Don't Repeat Yourself), we're going to reuse (and redirect to) a `show` +# action that we'll assume has already been created. The code might look like +# this: +# +# def create +# @entry = Entry.new(params[:entry]) +# if @entry.save +# # The entry was saved correctly, redirect to show +# redirect_to action: 'show', id: @entry.id +# else +# # things didn't go so well, do something else +# end +# end +# +# In this case, after saving our new entry to the database, the user is +# redirected to the `show` method, which is then executed. Note that this is an +# external HTTP-level redirection which will cause the browser to make a second +# request (a GET to the show action), and not some internal re-routing which +# calls both "create" and then "show" within one request. +# +# Learn more about `redirect_to` and what options you have in +# ActionController::Redirecting. +# +# ## Calling multiple redirects or renders +# +# An action may perform only a single render or a single redirect. Attempting to +# do either again will result in a DoubleRenderError: +# +# def do_something +# redirect_to action: "elsewhere" +# render action: "overthere" # raises DoubleRenderError +# end +# +# If you need to redirect on the condition of something, then be sure to add +# "return" to halt execution. +# +# def do_something +# if monkeys.nil? +# redirect_to(action: "elsewhere") +# return +# end +# render action: "overthere" # won't be called if monkeys is nil +# end +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://actionpack//lib/action_controller/base.rb#208 +class ActionController::Base < ::ActionController::Metal + include ::ActionView::ViewPaths + include ::AbstractController::Rendering + include ::AbstractController::Translation + include ::AbstractController::AssetPaths + include ::AbstractController::Helpers + include ::ActionController::Helpers + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + include ::AbstractController::UrlFor + include ::ActionController::UrlFor + include ::AbstractController::Logger + include ::ActiveSupport::Benchmarkable + include ::ActionController::Redirecting + include ::ActionView::Rendering + include ::ActionView::Layouts + include ::ActionController::Rendering + include ::ActionController::Renderers + include ::ActionController::Renderers::All + include ::ActionController::Head + include ::ActionController::ConditionalGet + include ::ActionController::EtagWithTemplateDigest + include ::ActionController::EtagWithFlash + include ::ActionController::Caching + include ::AbstractController::Caching::Fragments + include ::AbstractController::Caching::ConfigMethods + include ::AbstractController::Caching + include ::ActionController::MimeResponds + include ::ActionController::BasicImplicitRender + include ::ActionController::ImplicitRender + include ::ActionController::StrongParameters + include ::ActionController::ParameterEncoding + include ::ActionController::Cookies + include ::ActionController::Flash + include ::ActionController::FormBuilder + include ::ActiveSupport::Callbacks + include ::AbstractController::Callbacks + include ::ActionController::RequestForgeryProtection + include ::ActionController::ContentSecurityPolicy + include ::ActionController::PermissionsPolicy + include ::ActionController::RateLimiting + include ::ActionController::AllowBrowser + include ::ActionController::Streaming + include ::ActionController::DataStreaming + include ::ActionController::HttpAuthentication::Basic::ControllerMethods + include ::ActionController::HttpAuthentication::Digest::ControllerMethods + include ::ActionController::HttpAuthentication::Token::ControllerMethods + include ::ActionController::DefaultHeaders + include ::ActionController::Logging + include ::ActiveSupport::Rescuable + include ::ActionController::Rescue + include ::ActionController::Instrumentation + include ::ActionController::ParamsWrapper + extend ::ActionView::ViewPaths::ClassMethods + extend ::AbstractController::Helpers::Resolution + extend ::AbstractController::Helpers::ClassMethods + extend ::ActionController::Helpers::ClassMethods + extend ::AbstractController::UrlFor::ClassMethods + extend ::ActionController::Redirecting::ClassMethods + extend ::ActionView::Rendering::ClassMethods + extend ::ActionView::Layouts::ClassMethods + extend ::ActionController::Rendering::ClassMethods + extend ::ActionController::Renderers::ClassMethods + extend ::ActionController::ConditionalGet::ClassMethods + extend ::AbstractController::Caching::Fragments::ClassMethods + extend ::AbstractController::Caching::ClassMethods + extend ::AbstractController::Caching::ConfigMethods + extend ::ActionController::ParameterEncoding::ClassMethods + extend ::ActionController::Flash::ClassMethods + extend ::ActionController::FormBuilder::ClassMethods + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::AbstractController::Callbacks::ClassMethods + extend ::ActionController::RequestForgeryProtection::ClassMethods + extend ::ActionController::ContentSecurityPolicy::ClassMethods + extend ::ActionController::PermissionsPolicy::ClassMethods + extend ::ActionController::RateLimiting::ClassMethods + extend ::ActionController::AllowBrowser::ClassMethods + extend ::ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods + extend ::ActionController::DefaultHeaders::ClassMethods + extend ::ActionController::Logging::ClassMethods + extend ::ActiveSupport::Rescuable::ClassMethods + extend ::ActionController::Rescue::ClassMethods + extend ::ActionController::Instrumentation::ClassMethods + extend ::ActionController::ParamsWrapper::ClassMethods + extend ::ActionController::Renderers::DeprecatedEscapeJsonResponses + + # source://actionpack//lib/action_controller/base.rb#292 + def __callbacks; end + + # source://actionpack//lib/action_controller/base.rb#275 + def _helper_methods; end + + # source://actionpack//lib/action_controller/base.rb#275 + def _helper_methods=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#275 + def _helper_methods?; end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout_conditions; end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout_conditions?; end + + # source://actionpack//lib/action_controller/base.rb#292 + def _process_action_callbacks; end + + # source://actionpack//lib/action_controller/base.rb#280 + def _renderers; end + + # source://actionpack//lib/action_controller/base.rb#280 + def _renderers=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#280 + def _renderers?; end + + # source://actionpack//lib/action_controller/base.rb#292 + def _run_process_action_callbacks; end + + # source://actionpack//lib/action_controller/base.rb#292 + def _run_process_action_callbacks!(&block); end + + # source://actionpack//lib/action_controller/base.rb#284 + def _view_cache_dependencies; end + + # source://actionpack//lib/action_controller/base.rb#284 + def _view_cache_dependencies=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#284 + def _view_cache_dependencies?; end + + # source://actionpack//lib/action_controller/base.rb#314 + def _wrapper_options; end + + # source://actionpack//lib/action_controller/base.rb#314 + def _wrapper_options=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#314 + def _wrapper_options?; end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_open_redirect; end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_open_redirect=(val); end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_path_relative_redirect; end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_path_relative_redirect=(val); end + + # source://actionpack//lib/action_controller/base.rb#292 + def allow_forgery_protection(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def allow_forgery_protection=(arg); end + + # source://actionpack//lib/action_controller/base.rb#274 + def asset_host(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def asset_host=(arg); end + + # source://actionpack//lib/action_controller/base.rb#274 + def assets_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def assets_dir=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def csrf_token_storage_strategy(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def csrf_token_storage_strategy=(arg); end + + # source://actionpack//lib/action_controller/base.rb#274 + def default_asset_host_protocol(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def default_asset_host_protocol=(arg); end + + # source://actionpack//lib/action_controller/base.rb#284 + def default_static_extension(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def default_static_extension=(arg); end + + # source://actionpack//lib/action_controller/base.rb#276 + def default_url_options; end + + # source://actionpack//lib/action_controller/base.rb#276 + def default_url_options=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#276 + def default_url_options?; end + + # source://actionpack//lib/action_controller/base.rb#284 + def enable_fragment_cache_logging(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def enable_fragment_cache_logging=(arg); end + + # source://actionpack//lib/action_controller/base.rb#282 + def etag_with_template_digest; end + + # source://actionpack//lib/action_controller/base.rb#282 + def etag_with_template_digest=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#282 + def etag_with_template_digest?; end + + # source://actionpack//lib/action_controller/base.rb#281 + def etaggers; end + + # source://actionpack//lib/action_controller/base.rb#281 + def etaggers=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#281 + def etaggers?; end + + # source://actionpack//lib/action_controller/base.rb#290 + def flash(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_origin_check(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_origin_check=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_strategy(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_strategy=(arg); end + + # source://actionpack//lib/action_controller/base.rb#284 + def fragment_cache_keys; end + + # source://actionpack//lib/action_controller/base.rb#284 + def fragment_cache_keys=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#284 + def fragment_cache_keys?; end + + # source://actionpack//lib/action_controller/base.rb#275 + def helpers_path; end + + # source://actionpack//lib/action_controller/base.rb#275 + def helpers_path=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#275 + def helpers_path?; end + + # source://actionpack//lib/action_controller/base.rb#275 + def include_all_helpers; end + + # source://actionpack//lib/action_controller/base.rb#275 + def include_all_helpers=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#275 + def include_all_helpers?; end + + # source://actionpack//lib/action_controller/base.rb#274 + def javascripts_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def javascripts_dir=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def log_warning_on_csrf_failure(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def log_warning_on_csrf_failure=(arg); end + + # source://actionpack//lib/action_controller/base.rb#277 + def logger(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#277 + def logger=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def per_form_csrf_tokens(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def per_form_csrf_tokens=(arg); end + + # source://actionpack//lib/action_controller/base.rb#284 + def perform_caching(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def perform_caching=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def raise_on_missing_callback_actions; end + + # source://actionpack//lib/action_controller/base.rb#292 + def raise_on_missing_callback_actions=(val); end + + # source://actionpack//lib/action_controller/base.rb#277 + def raise_on_open_redirects; end + + # source://actionpack//lib/action_controller/base.rb#277 + def raise_on_open_redirects=(val); end + + # source://actionpack//lib/action_controller/base.rb#274 + def relative_url_root(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def relative_url_root=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def request_forgery_protection_token(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def request_forgery_protection_token=(arg); end + + # source://actionpack//lib/action_controller/base.rb#308 + def rescue_handlers; end + + # source://actionpack//lib/action_controller/base.rb#308 + def rescue_handlers=(_arg0); end + + # source://actionpack//lib/action_controller/base.rb#308 + def rescue_handlers?; end + + # source://actionpack//lib/action_controller/base.rb#274 + def stylesheets_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def stylesheets_dir=(arg); end + + private + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout(lookup_context, formats, keys); end + + # source://actionpack//lib/action_controller/base.rb#325 + def _protected_ivars; end + + # source://actionpack//lib/action_controller/base.rb#290 + def alert; end + + # source://actionpack//lib/action_controller/base.rb#290 + def notice; end + + class << self + # source://actionpack//lib/action_controller/base.rb#292 + def __callbacks; end + + # source://actionpack//lib/action_controller/base.rb#292 + def __callbacks=(value); end + + # source://actionpack//lib/action_controller/base.rb#277 + def _allowed_redirect_hosts; end + + # source://actionpack//lib/action_controller/base.rb#277 + def _allowed_redirect_hosts=(value); end + + # source://actionpack//lib/action_controller/base.rb#291 + def _default_form_builder; end + + # source://actionpack//lib/action_controller/base.rb#291 + def _default_form_builder=(value); end + + # source://actionpack//lib/action_controller/base.rb#291 + def _default_form_builder?; end + + # source://actionpack//lib/action_controller/base.rb#290 + def _flash_types; end + + # source://actionpack//lib/action_controller/base.rb#290 + def _flash_types=(value); end + + # source://actionpack//lib/action_controller/base.rb#290 + def _flash_types?; end + + # source://actionpack//lib/action_controller/base.rb#275 + def _helper_methods; end + + # source://actionpack//lib/action_controller/base.rb#275 + def _helper_methods=(value); end + + # source://actionpack//lib/action_controller/base.rb#275 + def _helper_methods?; end + + # source://actionpack//lib/action_controller/base.rb#275 + def _helpers; end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout; end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout=(value); end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout?; end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout_conditions; end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout_conditions=(value); end + + # source://actionpack//lib/action_controller/base.rb#278 + def _layout_conditions?; end + + # source://actionpack//lib/action_controller/base.rb#292 + def _process_action_callbacks; end + + # source://actionpack//lib/action_controller/base.rb#292 + def _process_action_callbacks=(value); end + + # source://actionpack//lib/action_controller/base.rb#280 + def _renderers; end + + # source://actionpack//lib/action_controller/base.rb#280 + def _renderers=(value); end + + # source://actionpack//lib/action_controller/base.rb#280 + def _renderers?; end + + # source://actionpack//lib/action_controller/base.rb#284 + def _view_cache_dependencies; end + + # source://actionpack//lib/action_controller/base.rb#284 + def _view_cache_dependencies=(value); end + + # source://actionpack//lib/action_controller/base.rb#284 + def _view_cache_dependencies?; end + + # source://actionpack//lib/action_controller/base.rb#314 + def _wrapper_options; end + + # source://actionpack//lib/action_controller/base.rb#314 + def _wrapper_options=(value); end + + # source://actionpack//lib/action_controller/base.rb#314 + def _wrapper_options?; end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_open_redirect; end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_open_redirect=(val); end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_path_relative_redirect; end + + # source://actionpack//lib/action_controller/base.rb#277 + def action_on_path_relative_redirect=(val); end + + # source://actionpack//lib/action_controller/base.rb#292 + def allow_forgery_protection(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def allow_forgery_protection=(arg); end + + # source://actionpack//lib/action_controller/base.rb#277 + def allowed_redirect_hosts; end + + # source://actionpack//lib/action_controller/base.rb#277 + def allowed_redirect_hosts_permissions; end + + # source://actionpack//lib/action_controller/base.rb#277 + def allowed_redirect_hosts_permissions=(value); end + + # source://actionpack//lib/action_controller/base.rb#274 + def asset_host(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def asset_host=(arg); end + + # source://actionpack//lib/action_controller/base.rb#274 + def assets_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def assets_dir=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def csrf_token_storage_strategy(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def csrf_token_storage_strategy=(arg); end + + # source://actionpack//lib/action_controller/base.rb#274 + def default_asset_host_protocol(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def default_asset_host_protocol=(arg); end + + # source://actionpack//lib/action_controller/base.rb#284 + def default_static_extension(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def default_static_extension=(arg); end + + # source://actionpack//lib/action_controller/base.rb#276 + def default_url_options; end + + # source://actionpack//lib/action_controller/base.rb#276 + def default_url_options=(value); end + + # source://actionpack//lib/action_controller/base.rb#276 + def default_url_options?; end + + # source://actionpack//lib/action_controller/base.rb#284 + def enable_fragment_cache_logging(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def enable_fragment_cache_logging=(arg); end + + # source://actionpack//lib/action_controller/base.rb#280 + def escape_json_responses; end + + # source://actionpack//lib/action_controller/base.rb#280 + def escape_json_responses=(value); end + + # source://actionpack//lib/action_controller/base.rb#280 + def escape_json_responses?; end + + # source://actionpack//lib/action_controller/base.rb#282 + def etag_with_template_digest; end + + # source://actionpack//lib/action_controller/base.rb#282 + def etag_with_template_digest=(value); end + + # source://actionpack//lib/action_controller/base.rb#282 + def etag_with_template_digest?; end + + # source://actionpack//lib/action_controller/base.rb#281 + def etaggers; end + + # source://actionpack//lib/action_controller/base.rb#281 + def etaggers=(value); end + + # source://actionpack//lib/action_controller/base.rb#281 + def etaggers?; end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_origin_check(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_origin_check=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_strategy(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def forgery_protection_strategy=(arg); end + + # source://actionpack//lib/action_controller/base.rb#284 + def fragment_cache_keys; end + + # source://actionpack//lib/action_controller/base.rb#284 + def fragment_cache_keys=(value); end + + # source://actionpack//lib/action_controller/base.rb#284 + def fragment_cache_keys?; end + + # source://actionpack//lib/action_controller/base.rb#275 + def helpers_path; end + + # source://actionpack//lib/action_controller/base.rb#275 + def helpers_path=(value); end + + # source://actionpack//lib/action_controller/base.rb#275 + def helpers_path?; end + + # source://actionpack//lib/action_controller/base.rb#275 + def include_all_helpers; end + + # source://actionpack//lib/action_controller/base.rb#275 + def include_all_helpers=(value); end + + # source://actionpack//lib/action_controller/base.rb#275 + def include_all_helpers?; end + + # source://actionpack//lib/action_controller/base.rb#274 + def javascripts_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def javascripts_dir=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def log_warning_on_csrf_failure(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def log_warning_on_csrf_failure=(arg); end + + # source://actionpack//lib/action_controller/base.rb#277 + def logger(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#277 + def logger=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def per_form_csrf_tokens(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def per_form_csrf_tokens=(arg); end + + # source://actionpack//lib/action_controller/base.rb#284 + def perform_caching(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def perform_caching=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def raise_on_missing_callback_actions; end + + # source://actionpack//lib/action_controller/base.rb#292 + def raise_on_missing_callback_actions=(val); end + + # source://actionpack//lib/action_controller/base.rb#277 + def raise_on_open_redirects; end + + # source://actionpack//lib/action_controller/base.rb#277 + def raise_on_open_redirects=(val); end + + # source://actionpack//lib/action_controller/base.rb#274 + def relative_url_root(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def relative_url_root=(arg); end + + # source://actionpack//lib/action_controller/base.rb#292 + def request_forgery_protection_token(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def request_forgery_protection_token=(arg); end + + # source://actionpack//lib/action_controller/base.rb#308 + def rescue_handlers; end + + # source://actionpack//lib/action_controller/base.rb#308 + def rescue_handlers=(value); end + + # source://actionpack//lib/action_controller/base.rb#308 + def rescue_handlers?; end + + # source://actionpack//lib/action_controller/base.rb#274 + def stylesheets_dir(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#274 + def stylesheets_dir=(arg); end + + # Shortcut helper that returns all the modules included in + # ActionController::Base except the ones passed as arguments: + # + # class MyBaseController < ActionController::Metal + # ActionController::Base.without_modules(:ParamsWrapper, :Streaming).each do |left| + # include left + # end + # end + # + # This gives better control over what you want to exclude and makes it easier to + # create a bare controller class, instead of listing the modules required + # manually. + # + # source://actionpack//lib/action_controller/base.rb#223 + def without_modules(*modules); end + + private + + # source://actionpack//lib/action_controller/base.rb#292 + def __class_attr___callbacks; end + + # source://actionpack//lib/action_controller/base.rb#292 + def __class_attr___callbacks=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#277 + def __class_attr__allowed_redirect_hosts; end + + # source://actionpack//lib/action_controller/base.rb#277 + def __class_attr__allowed_redirect_hosts=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#291 + def __class_attr__default_form_builder; end + + # source://actionpack//lib/action_controller/base.rb#291 + def __class_attr__default_form_builder=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#290 + def __class_attr__flash_types; end + + # source://actionpack//lib/action_controller/base.rb#290 + def __class_attr__flash_types=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#275 + def __class_attr__helper_methods; end + + # source://actionpack//lib/action_controller/base.rb#275 + def __class_attr__helper_methods=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#278 + def __class_attr__layout; end + + # source://actionpack//lib/action_controller/base.rb#278 + def __class_attr__layout=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#278 + def __class_attr__layout_conditions; end + + # source://actionpack//lib/action_controller/base.rb#278 + def __class_attr__layout_conditions=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#280 + def __class_attr__renderers; end + + # source://actionpack//lib/action_controller/base.rb#280 + def __class_attr__renderers=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#284 + def __class_attr__view_cache_dependencies; end + + # source://actionpack//lib/action_controller/base.rb#284 + def __class_attr__view_cache_dependencies=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#314 + def __class_attr__wrapper_options; end + + # source://actionpack//lib/action_controller/base.rb#314 + def __class_attr__wrapper_options=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#277 + def __class_attr_allowed_redirect_hosts_permissions; end + + # source://actionpack//lib/action_controller/base.rb#277 + def __class_attr_allowed_redirect_hosts_permissions=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#208 + def __class_attr_config; end + + # source://actionpack//lib/action_controller/base.rb#208 + def __class_attr_config=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#276 + def __class_attr_default_url_options; end + + # source://actionpack//lib/action_controller/base.rb#276 + def __class_attr_default_url_options=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#280 + def __class_attr_escape_json_responses; end + + # source://actionpack//lib/action_controller/base.rb#280 + def __class_attr_escape_json_responses=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#282 + def __class_attr_etag_with_template_digest; end + + # source://actionpack//lib/action_controller/base.rb#282 + def __class_attr_etag_with_template_digest=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#281 + def __class_attr_etaggers; end + + # source://actionpack//lib/action_controller/base.rb#281 + def __class_attr_etaggers=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#284 + def __class_attr_fragment_cache_keys; end + + # source://actionpack//lib/action_controller/base.rb#284 + def __class_attr_fragment_cache_keys=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#275 + def __class_attr_helpers_path; end + + # source://actionpack//lib/action_controller/base.rb#275 + def __class_attr_helpers_path=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#275 + def __class_attr_include_all_helpers; end + + # source://actionpack//lib/action_controller/base.rb#275 + def __class_attr_include_all_helpers=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#208 + def __class_attr_middleware_stack; end + + # source://actionpack//lib/action_controller/base.rb#208 + def __class_attr_middleware_stack=(new_value); end + + # source://actionpack//lib/action_controller/base.rb#308 + def __class_attr_rescue_handlers; end + + # source://actionpack//lib/action_controller/base.rb#308 + def __class_attr_rescue_handlers=(new_value); end + end +end + +# source://actionpack//lib/action_controller/base.rb#275 +module ActionController::Base::HelperMethods + # source://actionpack//lib/action_controller/base.rb#290 + def alert(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def combined_fragment_cache_key(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#293 + def content_security_policy?(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#293 + def content_security_policy_nonce(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#289 + def cookies(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def form_authenticity_token(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#290 + def notice(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#292 + def protect_against_forgery?(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/base.rb#284 + def view_cache_dependencies(*_arg0, **_arg1, &_arg2); end +end + +# source://actionpack//lib/action_controller/base.rb#231 +ActionController::Base::MODULES = T.let(T.unsafe(nil), Array) + +# Define some internal variables that should not be propagated to the view. +# +# source://actionpack//lib/action_controller/base.rb#319 +ActionController::Base::PROTECTED_IVARS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#6 +module ActionController::BasicImplicitRender + # source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#13 + def default_render; end + + # source://actionpack//lib/action_controller/metal/basic_implicit_render.rb#7 + def send_action(method, *args); end +end + +# # Action Controller Caching +# +# Caching is a cheap way of speeding up slow applications by keeping the result +# of calculations, renderings, and database calls around for subsequent +# requests. +# +# Note: To turn off all caching provided by Action Controller, set +# +# config.action_controller.perform_caching = false +# +# ## Caching stores +# +# All the caching stores from ActiveSupport::Cache are available to be used as +# backends for Action Controller caching. +# +# Configuration examples (FileStore is the default): +# +# config.action_controller.cache_store = :memory_store +# config.action_controller.cache_store = :file_store, '/path/to/cache/directory' +# config.action_controller.cache_store = :mem_cache_store, 'localhost' +# config.action_controller.cache_store = :mem_cache_store, Memcached::Rails.new('localhost:11211') +# config.action_controller.cache_store = MyOwnStore.new('parameter') +# +# source://actionpack//lib/action_controller/caching.rb#28 +module ActionController::Caching + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::AbstractController::Caching::Fragments + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Caching::Fragments::ClassMethods + mixes_in_class_methods ::AbstractController::Caching::ClassMethods + mixes_in_class_methods ::AbstractController::Caching::ConfigMethods + + private + + # source://actionpack//lib/action_controller/caching.rb#44 + def instrument_name; end + + # source://actionpack//lib/action_controller/caching.rb#36 + def instrument_payload(key); end + + module GeneratedClassMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end +end + +# source://actionpack//lib/action_controller/metal/conditional_get.rb#9 +module ActionController::ConditionalGet + include ::ActionController::Head + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods + + # Sets the `Cache-Control` header, overwriting existing directives. This method + # will also ensure an HTTP `Date` header for client compatibility. + # + # Defaults to issuing the `private` directive, so that intermediate caches must + # not cache the response. + # + # #### Options + # + # `:public` + # directive. + # + # `:must_revalidate` + # + # `:stale_while_revalidate` + # + # `:stale_if_error` + # + # `:immutable` + # + # + # Any additional key-value pairs are concatenated as directives. For a list of + # supported `Cache-Control` directives, see the [article on + # MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control). + # + # #### Examples + # + # expires_in 10.minutes + # # => Cache-Control: max-age=600, private + # + # expires_in 10.minutes, public: true + # # => Cache-Control: max-age=600, public + # + # expires_in 10.minutes, public: true, must_revalidate: true + # # => Cache-Control: max-age=600, public, must-revalidate + # + # expires_in 1.hour, stale_while_revalidate: 60.seconds + # # => Cache-Control: max-age=3600, private, stale-while-revalidate=60 + # + # expires_in 1.hour, stale_if_error: 5.minutes + # # => Cache-Control: max-age=3600, private, stale-if-error=300 + # + # expires_in 1.hour, public: true, "s-maxage": 3.hours, "no-transform": true + # # => Cache-Control: max-age=3600, public, s-maxage=10800, no-transform=true + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#290 + def expires_in(seconds, options = T.unsafe(nil)); end + + # Sets an HTTP 1.1 `Cache-Control` header of `no-cache`. This means the resource + # will be marked as stale, so clients must always revalidate. + # Intermediate/browser caches may still store the asset. + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#309 + def expires_now; end + + # Sets the `etag`, `last_modified`, or both on the response, and renders a `304 + # Not Modified` response if the request is already fresh. + # + # #### Options + # + # `:etag` + # + # `:weak_etag` + # `If-None-Match` header may receive a `304 Not Modified` response if the + # ETag matches exactly. + # + # they're good for caching HTML pages in browser caches. They can't be used + # for responses that must be byte-identical, like serving `Range` requests + # within a PDF file. + # + # `:strong_etag` + # `If-None-Match` header may receive a `304 Not Modified` response if the + # ETag matches exactly. + # + # byte. This is necessary for serving `Range` requests within a large video + # or PDF file, for example, or for compatibility with some CDNs that don't + # support weak ETags. + # + # `:last_modified` + # that specify an `If-Modified-Since` header may receive a `304 Not + # Modified` response if `last_modified` <= `If-Modified-Since`. + # + # `:public` + # `true` if you want your application to be cacheable by other devices, such + # as proxy caches. + # + # `:cache_control` + # of `Cache-Control` directives, see the [article on + # MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control). + # + # `:template` + # included in ETags. If the action renders a different template, you can + # include its digest instead. If the action doesn't render a template at + # all, you can pass `template: false` to skip any attempt to check for a + # template digest. + # + # + # #### Examples + # + # def show + # @article = Article.find(params[:id]) + # fresh_when(etag: @article, last_modified: @article.updated_at, public: true) + # end + # + # This will send a `304 Not Modified` response if the request specifies a + # matching ETag and `If-Modified-Since` header. Otherwise, it will render the + # `show` template. + # + # You can also just pass a record: + # + # def show + # @article = Article.find(params[:id]) + # fresh_when(@article) + # end + # + # `etag` will be set to the record, and `last_modified` will be set to the + # record's `updated_at`. + # + # You can also pass an object that responds to `maximum`, such as a collection + # of records: + # + # def index + # @articles = Article.all + # fresh_when(@articles) + # end + # + # In this case, `etag` will be set to the collection, and `last_modified` will + # be set to `maximum(:updated_at)` (the timestamp of the most recently updated + # record). + # + # When passing a record or a collection, you can still specify other options, + # such as `:public` and `:cache_control`: + # + # def show + # @article = Article.find(params[:id]) + # fresh_when(@article, public: true, cache_control: { no_cache: true }) + # end + # + # The above will set `Cache-Control: public, no-cache` in the response. + # + # When rendering a different template than the controller/action's default + # template, you can indicate which digest to include in the ETag: + # + # before_action { fresh_when @article, template: "widgets/show" } + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#137 + def fresh_when(object = T.unsafe(nil), etag: T.unsafe(nil), weak_etag: T.unsafe(nil), strong_etag: T.unsafe(nil), last_modified: T.unsafe(nil), public: T.unsafe(nil), cache_control: T.unsafe(nil), template: T.unsafe(nil)); end + + # Cache or yield the block. The cache is supposed to never expire. + # + # You can use this method when you have an HTTP response that never changes, and + # the browser and proxies should cache it indefinitely. + # + # * `public`: By default, HTTP responses are private, cached only on the + # user's web browser. To allow proxies to cache the response, set `true` to + # indicate that they can serve the cached response to all users. + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#321 + def http_cache_forever(public: T.unsafe(nil)); end + + # Adds the `must-understand` directive to the `Cache-Control` header, which indicates + # that a cache MUST understand the semantics of the response status code that has been + # received, or discard the response. + # + # This is particularly useful when returning responses with new or uncommon + # status codes that might not be properly interpreted by older caches. + # + # #### Example + # + # def show + # @article = Article.find(params[:id]) + # + # if @article.early_access? + # must_understand + # render status: 203 # Non-Authoritative Information + # else + # fresh_when @article + # end + # end + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#355 + def must_understand; end + + # Sets an HTTP 1.1 `Cache-Control` header of `no-store`. This means the resource + # may not be stored in any cache. + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#331 + def no_store; end + + # Sets the `etag` and/or `last_modified` on the response and checks them against + # the request. If the request doesn't match the provided options, it is + # considered stale, and the response should be rendered from scratch. Otherwise, + # it is fresh, and a `304 Not Modified` is sent. + # + # #### Options + # + # See #fresh_when for supported options. + # + # #### Examples + # + # def show + # @article = Article.find(params[:id]) + # + # if stale?(etag: @article, last_modified: @article.updated_at) + # @statistics = @article.really_expensive_call + # respond_to do |format| + # # all the supported formats + # end + # end + # end + # + # You can also just pass a record: + # + # def show + # @article = Article.find(params[:id]) + # + # if stale?(@article) + # @statistics = @article.really_expensive_call + # respond_to do |format| + # # all the supported formats + # end + # end + # end + # + # `etag` will be set to the record, and `last_modified` will be set to the + # record's `updated_at`. + # + # You can also pass an object that responds to `maximum`, such as a collection + # of records: + # + # def index + # @articles = Article.all + # + # if stale?(@articles) + # @statistics = @articles.really_expensive_call + # respond_to do |format| + # # all the supported formats + # end + # end + # end + # + # In this case, `etag` will be set to the collection, and `last_modified` will + # be set to `maximum(:updated_at)` (the timestamp of the most recently updated + # record). + # + # When passing a record or a collection, you can still specify other options, + # such as `:public` and `:cache_control`: + # + # def show + # @article = Article.find(params[:id]) + # + # if stale?(@article, public: true, cache_control: { no_cache: true }) + # @statistics = @articles.really_expensive_call + # respond_to do |format| + # # all the supported formats + # end + # end + # end + # + # The above will set `Cache-Control: public, no-cache` in the response. + # + # When rendering a different template than the controller/action's default + # template, you can indicate which digest to include in the ETag: + # + # def show + # super if stale?(@article, template: "widgets/show") + # end + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#236 + def stale?(object = T.unsafe(nil), **freshness_kwargs); end + + private + + # source://actionpack//lib/action_controller/metal/conditional_get.rb#361 + def combine_etags(validator, options); end + + module GeneratedClassMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end + + module GeneratedInstanceMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end +end + +# source://actionpack//lib/action_controller/metal/conditional_get.rb#18 +module ActionController::ConditionalGet::ClassMethods + # Allows you to consider additional controller-wide information when generating + # an ETag. For example, if you serve pages tailored depending on who's logged in + # at the moment, you may want to add the current user id to be part of the ETag + # to prevent unauthorized displaying of cached pages. + # + # class InvoicesController < ApplicationController + # etag { current_user&.id } + # + # def show + # # Etag will differ even for the same invoice when it's viewed by a different current_user + # @invoice = Invoice.find(params[:id]) + # fresh_when etag: @invoice + # end + # end + # + # source://actionpack//lib/action_controller/metal/conditional_get.rb#33 + def etag(&etagger); end +end + +# source://actionpack//lib/action_controller/metal/content_security_policy.rb#6 +module ActionController::ContentSecurityPolicy + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::AbstractController::Helpers + include ::ActiveSupport::Callbacks + include ::AbstractController::Callbacks + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods + mixes_in_class_methods ::ActiveSupport::DescendantsTracker + mixes_in_class_methods ::AbstractController::Callbacks::ClassMethods + mixes_in_class_methods ::ActionController::ContentSecurityPolicy::ClassMethods + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/content_security_policy.rb#74 + def content_security_policy?; end + + # source://actionpack//lib/action_controller/metal/content_security_policy.rb#78 + def content_security_policy_nonce; end + + # source://actionpack//lib/action_controller/metal/content_security_policy.rb#82 + def current_content_security_policy; end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end +end + +# source://actionpack//lib/action_controller/metal/content_security_policy.rb#17 +module ActionController::ContentSecurityPolicy::ClassMethods + # Overrides parts of the globally configured `Content-Security-Policy` header: + # + # class PostsController < ApplicationController + # content_security_policy do |policy| + # policy.base_uri "https://www.example.com" + # end + # end + # + # Options can be passed similar to `before_action`. For example, pass `only: + # :index` to override the header on the index action only: + # + # class PostsController < ApplicationController + # content_security_policy(only: :index) do |policy| + # policy.default_src :self, :https + # end + # end + # + # Pass `false` to remove the `Content-Security-Policy` header: + # + # class PostsController < ApplicationController + # content_security_policy false, only: :index + # end + # + # source://actionpack//lib/action_controller/metal/content_security_policy.rb#40 + def content_security_policy(enabled = T.unsafe(nil), **options, &block); end + + # Overrides the globally configured `Content-Security-Policy-Report-Only` + # header: + # + # class PostsController < ApplicationController + # content_security_policy_report_only only: :index + # end + # + # Pass `false` to remove the `Content-Security-Policy-Report-Only` header: + # + # class PostsController < ApplicationController + # content_security_policy_report_only false, only: :index + # end + # + # source://actionpack//lib/action_controller/metal/content_security_policy.rb#66 + def content_security_policy_report_only(report_only = T.unsafe(nil), **options); end +end + +# source://actionpack//lib/action_controller/metal/cookies.rb#6 +module ActionController::Cookies + extend ::ActiveSupport::Concern + + private + + # The cookies for the current request. See ActionDispatch::Cookies for more + # information. + # + # source://actionpack//lib/action_controller/metal/cookies.rb#16 + def cookies; end +end + +# # Action Controller Data Streaming +# +# Methods for sending arbitrary data and for streaming files to the browser, +# instead of rendering. +# +# source://actionpack//lib/action_controller/metal/data_streaming.rb#13 +module ActionController::DataStreaming + extend ::ActiveSupport::Concern + include ::ActionController::Rendering + + mixes_in_class_methods ::ActionController::Rendering::ClassMethods + + private + + # Sends the given binary data to the browser. This method is similar to `render + # plain: data`, but also allows you to specify whether the browser should + # display the response as a file attachment (i.e. in a download dialog) or as + # inline data. You may also set the content type, the file name, and other + # things. + # + # #### Options: + # + # * `:filename` - suggests a filename for the browser to use. + # * `:type` - specifies an HTTP content type. Defaults to + # `application/octet-stream`. You can specify either a string or a symbol + # for a registered type with `Mime::Type.register`, for example `:json`. If + # omitted, type will be inferred from the file extension specified in + # `:filename`. If no content type is registered for the extension, the + # default type `application/octet-stream` will be used. + # * `:disposition` - specifies whether the file will be shown inline or + # downloaded. Valid values are `"inline"` and `"attachment"` (default). + # * `:status` - specifies the status code to send with the response. Defaults + # to 200. + # + # + # Generic data download: + # + # send_data buffer + # + # Download a dynamically-generated tarball: + # + # send_data generate_tgz('dir'), filename: 'dir.tgz' + # + # Display an image Active Record in the browser: + # + # send_data image.data, type: image.content_type, disposition: 'inline' + # + # See `send_file` for more information on HTTP `Content-*` headers and caching. + # + # source://actionpack//lib/action_controller/metal/data_streaming.rb#122 + def send_data(data, options = T.unsafe(nil)); end + + # Sends the file. This uses a server-appropriate method (such as `X-Sendfile`) + # via the `Rack::Sendfile` middleware. The header to use is set via + # `config.action_dispatch.x_sendfile_header`. Your server can also configure + # this for you by setting the `X-Sendfile-Type` header. + # + # Be careful to sanitize the path parameter if it is coming from a web page. + # `send_file(params[:path])` allows a malicious user to download any file on + # your server. + # + # #### Options: + # + # * `:filename` - suggests a filename for the browser to use. Defaults to + # `File.basename(path)`. + # * `:type` - specifies an HTTP content type. You can specify either a string + # or a symbol for a registered type with `Mime::Type.register`, for example + # `:json`. If omitted, the type will be inferred from the file extension + # specified in `:filename`. If no content type is registered for the + # extension, the default type `application/octet-stream` will be used. + # * `:disposition` - specifies whether the file will be shown inline or + # downloaded. Valid values are `"inline"` and `"attachment"` (default). + # * `:status` - specifies the status code to send with the response. Defaults + # to 200. + # * `:url_based_filename` - set to `true` if you want the browser to guess the + # filename from the URL, which is necessary for i18n filenames on certain + # browsers (setting `:filename` overrides this option). + # + # + # The default `Content-Type` and `Content-Disposition` headers are set to + # download arbitrary binary files in as many browsers as possible. IE versions + # 4, 5, 5.5, and 6 are all known to have a variety of quirks (especially when + # downloading over SSL). + # + # Simple download: + # + # send_file '/path/to.zip' + # + # Show a JPEG in the browser: + # + # send_file '/path/to.jpeg', type: 'image/jpeg', disposition: 'inline' + # + # Show a 404 page in the browser: + # + # send_file '/path/to/404.html', type: 'text/html; charset=utf-8', disposition: 'inline', status: 404 + # + # You can use other `Content-*` HTTP headers to provide additional information + # to the client. See MDN for a [list of HTTP + # headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers). + # + # Also be aware that the document may be cached by proxies and browsers. The + # `Pragma` and `Cache-Control` headers declare how the file may be cached by + # intermediaries. They default to require clients to validate with the server + # before releasing cached responses. See https://www.mnot.net/cache_docs/ for an + # overview of web caching and [RFC + # 9111](https://www.rfc-editor.org/rfc/rfc9111.html#name-cache-control) for the + # `Cache-Control` header spec. + # + # @raise [MissingFile] + # + # source://actionpack//lib/action_controller/metal/data_streaming.rb#77 + def send_file(path, options = T.unsafe(nil)); end + + # @raise [ArgumentError] + # + # source://actionpack//lib/action_controller/metal/data_streaming.rb#127 + def send_file_headers!(options); end +end + +# source://actionpack//lib/action_controller/metal/data_streaming.rb#19 +ActionController::DataStreaming::DEFAULT_SEND_FILE_DISPOSITION = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_controller/metal/data_streaming.rb#18 +ActionController::DataStreaming::DEFAULT_SEND_FILE_TYPE = T.let(T.unsafe(nil), String) + +# # Action Controller Default Headers +# +# Allows configuring default headers that will be automatically merged into each +# response. +# +# source://actionpack//lib/action_controller/metal/default_headers.rb#10 +module ActionController::DefaultHeaders + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::DefaultHeaders::ClassMethods +end + +# source://actionpack//lib/action_controller/metal/default_headers.rb#13 +module ActionController::DefaultHeaders::ClassMethods + # source://actionpack//lib/action_controller/metal/default_headers.rb#14 + def make_response!(request); end +end + +# # Action Controller Etag With Flash +# +# When you're using the flash, it's generally used as a conditional on the view. +# This means the content of the view depends on the flash. Which in turn means +# that the ETag for a response should be computed with the content of the flash +# in mind. This does that by including the content of the flash as a component +# in the ETag that's generated for a response. +# +# source://actionpack//lib/action_controller/metal/etag_with_flash.rb#13 +module ActionController::EtagWithFlash + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionController::ConditionalGet + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods + + module GeneratedClassMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end + + module GeneratedInstanceMethods + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end +end + +# # Action Controller Etag With Template Digest +# +# When our views change, they should bubble up into HTTP cache freshness and +# bust browser caches. So the template digest for the current action is +# automatically included in the ETag. +# +# Enabled by default for apps that use Action View. Disable by setting +# +# config.action_controller.etag_with_template_digest = false +# +# Override the template to digest by passing `:template` to `fresh_when` and +# `stale?` calls. For example: +# +# # We're going to render widgets/show, not posts/show +# fresh_when @post, template: 'widgets/show' +# +# # We're not going to render a template, so omit it from the ETag. +# fresh_when @post, template: false +# +# source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#25 +module ActionController::EtagWithTemplateDigest + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionController::ConditionalGet + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods + + private + + # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#39 + def determine_template_etag(options); end + + # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#55 + def lookup_and_digest_template(template); end + + # Pick the template digest to include in the ETag. If the `:template` option is + # present, use the named template. If `:template` is `nil` or absent, use the + # default controller/action template. If `:template` is false, omit the template + # digest from the ETag. + # + # source://actionpack//lib/action_controller/metal/etag_with_template_digest.rb#49 + def pick_template_for_etag(options); end + + module GeneratedClassMethods + def etag_with_template_digest; end + def etag_with_template_digest=(value); end + def etag_with_template_digest?; end + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end + + module GeneratedInstanceMethods + def etag_with_template_digest; end + def etag_with_template_digest=(value); end + def etag_with_template_digest?; end + def etaggers; end + def etaggers=(value); end + def etaggers?; end + end +end + +# Raised from `expect!` when an expected parameter is missing or is of an +# incompatible type. +# +# params = ActionController::Parameters.new(a: {}) +# params.expect!(:a) +# # => ActionController::ExpectedParameterMissing: param is missing or the value is empty or invalid: a +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#49 +class ActionController::ExpectedParameterMissing < ::ActionController::ParameterMissing; end + +# source://actionpack//lib/action_controller/metal/flash.rb#6 +module ActionController::Flash + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::Flash::ClassMethods + + private + + # source://actionpack//lib/action_controller/metal/flash.rb#50 + def redirect_to(options = T.unsafe(nil), response_options_and_flash = T.unsafe(nil)); end + + module GeneratedClassMethods + def _flash_types; end + def _flash_types=(value); end + def _flash_types?; end + end + + module GeneratedInstanceMethods; end +end + +# source://actionpack//lib/action_controller/metal/flash.rb#16 +module ActionController::Flash::ClassMethods + # Creates new flash types. You can pass as many types as you want to create + # flash types other than the default `alert` and `notice` in your controllers + # and views. For instance: + # + # # in application_controller.rb + # class ApplicationController < ActionController::Base + # add_flash_types :warning + # end + # + # # in your controller + # redirect_to user_path(@user), warning: "Incomplete profile" + # + # # in your view + # <%= warning %> + # + # This method will automatically define a new method for each of the given + # names, and it will be available in your views. + # + # source://actionpack//lib/action_controller/metal/flash.rb#34 + def add_flash_types(*types); end +end + +# # Action Controller Form Builder +# +# Override the default form builder for all views rendered by this controller +# and any of its descendants. Accepts a subclass of +# ActionView::Helpers::FormBuilder. +# +# For example, given a form builder: +# +# class AdminFormBuilder < ActionView::Helpers::FormBuilder +# def special_field(name) +# end +# end +# +# The controller specifies a form builder as its default: +# +# class AdminAreaController < ApplicationController +# default_form_builder AdminFormBuilder +# end +# +# Then in the view any form using `form_with` or `form_for` will be an +# instance of the specified form builder: +# +# <%= form_with(model: @instance) do |builder| %> +# <%= builder.special_field(:name) %> +# <% end %> +# +# source://actionpack//lib/action_controller/form_builder.rb#31 +module ActionController::FormBuilder + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::FormBuilder::ClassMethods + + # Default form builder for the controller + # + # source://actionpack//lib/action_controller/form_builder.rb#51 + def default_form_builder; end + + module GeneratedClassMethods + def _default_form_builder; end + def _default_form_builder=(value); end + def _default_form_builder?; end + end + + module GeneratedInstanceMethods; end +end + +# source://actionpack//lib/action_controller/form_builder.rb#38 +module ActionController::FormBuilder::ClassMethods + # Set the form builder to be used as the default for all forms in the views + # rendered by this controller and its subclasses. + # + # #### Parameters + # * `builder` - Default form builder. Accepts a subclass of + # ActionView::Helpers::FormBuilder + # + # source://actionpack//lib/action_controller/form_builder.rb#45 + def default_form_builder(builder); end +end + +# source://actionpack//lib/action_controller/metal/head.rb#6 +module ActionController::Head + # Returns a response that has no content (merely headers). The options argument + # is interpreted to be a hash of header names and values. This allows you to + # easily return a response that consists only of significant headers: + # + # head :created, location: person_path(@person) + # + # head :created, location: @person + # + # It can also be used to return exceptional conditions: + # + # return head(:method_not_allowed) unless request.post? + # return head(:bad_request) unless valid_request? + # render + # + # See `Rack::Utils::SYMBOL_TO_STATUS_CODE` for a full list of valid `status` + # symbols. + # + # @raise [::AbstractController::DoubleRenderError] + # + # source://actionpack//lib/action_controller/metal/head.rb#23 + def head(status, options = T.unsafe(nil)); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/head.rb#58 + def include_content?(status); end +end + +# # Action Controller Helpers +# +# The Rails framework provides a large number of helpers for working with +# assets, dates, forms, numbers and model objects, to name a few. These helpers +# are available to all templates by default. +# +# In addition to using the standard template helpers provided, creating custom +# helpers to extract complicated logic or reusable functionality is strongly +# encouraged. By default, each controller will include all helpers. These +# helpers are only accessible on the controller through `#helpers` +# +# In previous versions of Rails the controller will include a helper which +# matches the name of the controller, e.g., `MyController` will automatically +# include `MyHelper`. You can revert to the old behavior with the following: +# +# # config/application.rb +# class Application < Rails::Application +# config.action_controller.include_all_helpers = false +# end +# +# Additional helpers can be specified using the `helper` class method in +# ActionController::Base or any controller which inherits from it. +# +# The `to_s` method from the Time class can be wrapped in a helper method to +# display a custom message if a Time object is blank: +# +# module FormattedTimeHelper +# def format_time(time, format=:long, blank_message=" ") +# time.blank? ? blank_message : time.to_fs(format) +# end +# end +# +# FormattedTimeHelper can now be included in a controller, using the `helper` +# class method: +# +# class EventsController < ActionController::Base +# helper FormattedTimeHelper +# def index +# @events = Event.all +# end +# end +# +# Then, in any view rendered by `EventsController`, the `format_time` method can +# be called: +# +# <% @events.each do |event| -%> +#

+# <%= format_time(event.time, :short, "N/A") %> | <%= event.name %> +#

+# <% end -%> +# +# Finally, assuming we have two event instances, one which has a time and one +# which does not, the output might look like this: +# +# 23 Aug 11:30 | Carolina Railhawks Soccer Match +# N/A | Carolina Railhawks Training Workshop +# +# source://actionpack//lib/action_controller/metal/helpers.rb#63 +module ActionController::Helpers + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::AbstractController::Helpers + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + mixes_in_class_methods ::ActionController::Helpers::ClassMethods + + # Provides a proxy to access helper methods from outside the view. + # + # source://actionpack//lib/action_controller/metal/helpers.rb#125 + def helpers; end + + class << self + # Returns the value of attribute helpers_path. + # + # source://actionpack//lib/action_controller/metal/helpers.rb#66 + def helpers_path; end + + # Sets the attribute helpers_path + # + # @param value the value to set the attribute helpers_path to. + # + # source://actionpack//lib/action_controller/metal/helpers.rb#66 + def helpers_path=(_arg0); end + end + + module GeneratedClassMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + def helpers_path; end + def helpers_path=(value); end + def helpers_path?; end + def include_all_helpers; end + def include_all_helpers=(value); end + def include_all_helpers?; end + end + + module GeneratedInstanceMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + def helpers_path; end + def helpers_path=(value); end + def helpers_path?; end + def include_all_helpers; end + def include_all_helpers=(value); end + def include_all_helpers?; end + end +end + +# source://actionpack//lib/action_controller/metal/helpers.rb#74 +module ActionController::Helpers::ClassMethods + # Declares helper accessors for controller attributes. For example, the + # following adds new `name` and `name=` instance methods to a controller and + # makes them available to the view: + # attr_accessor :name + # helper_attr :name + # + # #### Parameters + # * `attrs` - Names of attributes to be converted into helpers. + # + # source://actionpack//lib/action_controller/metal/helpers.rb#84 + def helper_attr(*attrs); end + + # Provides a proxy to access helper methods from outside the view. + # + # Note that the proxy is rendered under a different view context. This may cause + # incorrect behavior with capture methods. Consider using + # [helper](rdoc-ref:AbstractController::Helpers::ClassMethods#helper) instead + # when using `capture`. + # + # source://actionpack//lib/action_controller/metal/helpers.rb#94 + def helpers; end + + # Override modules_for_helpers to accept `:all` as argument, which loads all + # helpers in helpers_path. + # + # #### Parameters + # * `args` - A list of helpers + # + # + # #### Returns + # * `array` - A normalized list of modules for the list of helpers provided. + # + # source://actionpack//lib/action_controller/metal/helpers.rb#112 + def modules_for_helpers(args); end + + private + + # Extract helper names from files in `app/helpers/***/**_helper.rb` + # + # source://actionpack//lib/action_controller/metal/helpers.rb#119 + def all_application_helpers; end +end + +# HTTP Basic, Digest, and Token authentication. +# +# source://actionpack//lib/action_controller/metal/http_authentication.rb#11 +module ActionController::HttpAuthentication; end + +# # HTTP Basic authentication +# +# ### Simple Basic example +# +# class PostsController < ApplicationController +# http_basic_authenticate_with name: "dhh", password: "secret", except: :index +# +# def index +# render plain: "Everyone can see me!" +# end +# +# def edit +# render plain: "I'm only accessible if you know the password" +# end +# end +# +# ### Advanced Basic example +# +# Here is a more advanced Basic example where only Atom feeds and the XML API +# are protected by HTTP authentication. The regular HTML interface is protected +# by a session approach: +# +# class ApplicationController < ActionController::Base +# before_action :set_account, :authenticate +# +# private +# def set_account +# @account = Account.find_by(url_name: request.subdomains.first) +# end +# +# def authenticate +# case request.format +# when Mime[:xml], Mime[:atom] +# if user = authenticate_with_http_basic { |u, p| @account.users.authenticate(u, p) } +# @current_user = user +# else +# request_http_basic_authentication +# end +# else +# if session_authenticated? +# @current_user = @account.users.find(session[:authenticated][:user_id]) +# else +# redirect_to(login_url) and return false +# end +# end +# end +# end +# +# In your integration tests, you can do something like this: +# +# def test_access_granted_from_xml +# authorization = ActionController::HttpAuthentication::Basic.encode_credentials(users(:dhh).name, users(:dhh).password) +# +# get "/notes/1.xml", headers: { 'HTTP_AUTHORIZATION' => authorization } +# +# assert_equal 200, status +# end +# +# source://actionpack//lib/action_controller/metal/http_authentication.rb#69 +module ActionController::HttpAuthentication::Basic + extend ::ActionController::HttpAuthentication::Basic + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#130 + def auth_param(request); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#126 + def auth_scheme(request); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#108 + def authenticate(request, &login_procedure); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#138 + def authentication_request(controller, realm, message); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#122 + def decode_credentials(request); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#134 + def encode_credentials(user_name, password); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#114 + def has_basic_credentials?(request); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#118 + def user_name_and_password(request); end +end + +# source://actionpack//lib/action_controller/metal/http_authentication.rb#72 +module ActionController::HttpAuthentication::Basic::ControllerMethods + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#95 + def authenticate_or_request_with_http_basic(realm = T.unsafe(nil), message = T.unsafe(nil), &login_procedure); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#99 + def authenticate_with_http_basic(&login_procedure); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#86 + def http_basic_authenticate_or_request_with(name:, password:, realm: T.unsafe(nil), message: T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#103 + def request_http_basic_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_controller/metal/http_authentication.rb#75 +module ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods + # Enables HTTP Basic authentication. + # + # See ActionController::HttpAuthentication::Basic for example usage. + # + # @raise [ArgumentError] + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#79 + def http_basic_authenticate_with(name:, password:, realm: T.unsafe(nil), **options); end +end + +# # HTTP Digest authentication +# +# ### Simple Digest example +# +# require "openssl" +# class PostsController < ApplicationController +# REALM = "SuperSecret" +# USERS = {"dhh" => "secret", #plain text password +# "dap" => OpenSSL::Digest::MD5.hexdigest(["dap",REALM,"secret"].join(":"))} #ha1 digest password +# +# before_action :authenticate, except: [:index] +# +# def index +# render plain: "Everyone can see me!" +# end +# +# def edit +# render plain: "I'm only accessible if you know the password" +# end +# +# private +# def authenticate +# authenticate_or_request_with_http_digest(REALM) do |username| +# USERS[username] +# end +# end +# end +# +# ### Notes +# +# The `authenticate_or_request_with_http_digest` block must return the user's +# password or the ha1 digest hash so the framework can appropriately hash to +# check the user's credentials. Returning `nil` will cause authentication to +# fail. +# +# Storing the ha1 hash: MD5(username:realm:password), is better than storing a +# plain password. If the password file or database is compromised, the attacker +# would be able to use the ha1 hash to authenticate as the user at this `realm`, +# but would not have the user's password to try using at other sites. +# +# In rare instances, web servers or front proxies strip authorization headers +# before they reach your application. You can debug this situation by logging +# all environment variables, and check for HTTP_AUTHORIZATION, amongst others. +# +# source://actionpack//lib/action_controller/metal/http_authentication.rb#189 +module ActionController::HttpAuthentication::Digest + extend ::ActionController::HttpAuthentication::Digest + + # Returns true on a valid response, false otherwise. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#215 + def authenticate(request, realm, &password_procedure); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#274 + def authentication_header(controller, realm); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#281 + def authentication_request(controller, realm, message = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#267 + def decode_credentials(header); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#263 + def decode_credentials_header(request); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#258 + def encode_credentials(http_method, credentials, password, password_is_ha1); end + + # Returns the expected response for a request of `http_method` to `uri` with the + # decoded `credentials` and the expected `password` Optional parameter + # `password_is_ha1` is set to `true` by default, since best practice is to store + # ha1 digest instead of a plain-text password. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#248 + def expected_response(http_method, uri, credentials, password, password_is_ha1 = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#254 + def ha1(credentials, password); end + + # Uses an MD5 digest based on time to generate a value to be used only once. + # + # A server-specified data string which should be uniquely generated each time a + # 401 response is made. It is recommended that this string be base64 or + # hexadecimal data. Specifically, since the string is passed in the header lines + # as a quoted string, the double-quote character is not allowed. + # + # The contents of the nonce are implementation dependent. The quality of the + # implementation depends on a good choice. A nonce might, for example, be + # constructed as the base 64 encoding of + # + # time-stamp H(time-stamp ":" ETag ":" private-key) + # + # where time-stamp is a server-generated time or other non-repeating value, ETag + # is the value of the HTTP ETag header associated with the requested entity, and + # private-key is data known only to the server. With a nonce of this form a + # server would recalculate the hash portion after receiving the client + # authentication header and reject the request if it did not match the nonce + # from that header or if the time-stamp value is not recent enough. In this way + # the server can limit the time of the nonce's validity. The inclusion of the + # ETag prevents a replay request for an updated version of the resource. (Note: + # including the IP address of the client in the nonce would appear to offer the + # server the ability to limit the reuse of the nonce to the same client that + # originally got it. However, that would break proxy farms, where requests from + # a single user often go through different proxies in the farm. Also, IP address + # spoofing is not that hard.) + # + # An implementation might choose not to accept a previously used nonce or a + # previously used digest, in order to protect against a replay attack. Or, an + # implementation might choose to use one-time nonces or digests for POST, PUT, + # or PATCH requests, and a time-stamp for GET requests. For more details on the + # issues involved see Section 4 of this document. + # + # The nonce is opaque to the client. Composed of Time, and hash of Time with + # secret key from the Rails session secret generated upon creation of project. + # Ensures the time cannot be modified by client. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#330 + def nonce(secret_key, time = T.unsafe(nil)); end + + # Opaque based on digest of secret key + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#348 + def opaque(secret_key); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#288 + def secret_token(request); end + + # Returns false unless the request credentials response value matches the + # expected value. First try the password as a ha1 digest password. If this + # fails, then try it as a plain text password. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#222 + def validate_digest_response(request, realm, &password_procedure); end + + # Might want a shorter timeout depending on whether the request is a PATCH, PUT, + # or POST, and if the client is a browser or web service. Can be much shorter if + # the Stale directive is implemented. This would allow a user to use new nonce + # without prompting the user again for their username and password. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#341 + def validate_nonce(secret_key, request, value, seconds_to_timeout = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_controller/metal/http_authentication.rb#192 +module ActionController::HttpAuthentication::Digest::ControllerMethods + # Authenticate using an HTTP Digest, or otherwise render an HTTP header + # requesting the client to send a Digest. + # + # See ActionController::HttpAuthentication::Digest for example usage. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#197 + def authenticate_or_request_with_http_digest(realm = T.unsafe(nil), message = T.unsafe(nil), &password_procedure); end + + # Authenticate using an HTTP Digest. Returns true if authentication is + # successful, false otherwise. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#203 + def authenticate_with_http_digest(realm = T.unsafe(nil), &password_procedure); end + + # Render an HTTP header requesting the client to send a Digest for + # authentication. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#209 + def request_http_digest_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end +end + +# # HTTP Token authentication +# +# ### Simple Token example +# +# class PostsController < ApplicationController +# TOKEN = "secret" +# +# before_action :authenticate, except: [ :index ] +# +# def index +# render plain: "Everyone can see me!" +# end +# +# def edit +# render plain: "I'm only accessible if you know the password" +# end +# +# private +# def authenticate +# authenticate_or_request_with_http_token do |token, options| +# # Compare the tokens in a time-constant manner, to mitigate +# # timing attacks. +# ActiveSupport::SecurityUtils.secure_compare(token, TOKEN) +# end +# end +# end +# +# Here is a more advanced Token example where only Atom feeds and the XML API +# are protected by HTTP token authentication. The regular HTML interface is +# protected by a session approach: +# +# class ApplicationController < ActionController::Base +# before_action :set_account, :authenticate +# +# private +# def set_account +# @account = Account.find_by(url_name: request.subdomains.first) +# end +# +# def authenticate +# case request.format +# when Mime[:xml], Mime[:atom] +# if user = authenticate_with_http_token { |t, o| @account.users.authenticate(t, o) } +# @current_user = user +# else +# request_http_token_authentication +# end +# else +# if session_authenticated? +# @current_user = @account.users.find(session[:authenticated][:user_id]) +# else +# redirect_to(login_url) and return false +# end +# end +# end +# end +# +# In your integration tests, you can do something like this: +# +# def test_access_granted_from_xml +# authorization = ActionController::HttpAuthentication::Token.encode_credentials(users(:dhh).token) +# +# get "/notes/1.xml", headers: { 'HTTP_AUTHORIZATION' => authorization } +# +# assert_equal 200, status +# end +# +# On shared hosts, Apache sometimes doesn't pass authentication headers to FCGI +# instances. If your environment matches this description and you cannot +# authenticate, try this rule in your Apache setup: +# +# RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L] +# +# source://actionpack//lib/action_controller/metal/http_authentication.rb#425 +module ActionController::HttpAuthentication::Token + extend ::ActionController::HttpAuthentication::Token + + # If token Authorization header is present, call the login procedure with the + # present token and options. + # + # Returns the return value of `login_procedure` if a token is found. Returns + # `nil` if no token is found. + # + # #### Parameters + # + # * `controller` - ActionController::Base instance for the current request. + # * `login_procedure` - Proc to call if a token is present. The Proc should + # take two arguments: + # + # authenticate(controller) { |token, options| ... } + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#472 + def authenticate(controller, &login_procedure); end + + # Sets a WWW-Authenticate header to let the client know a token is desired. + # + # Returns nothing. + # + # #### Parameters + # + # * `controller` - ActionController::Base instance for the outgoing response. + # * `realm` - String realm to use in the header. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#555 + def authentication_request(controller, realm, message = T.unsafe(nil)); end + + # Encodes the given token and options into an Authorization header value. + # + # Returns String. + # + # #### Parameters + # + # * `token` - String token. + # * `options` - Optional Hash of the options. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#539 + def encode_credentials(token, options = T.unsafe(nil)); end + + # Takes `raw_params` and turns it into an array of parameters. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#507 + def params_array_from(raw_params); end + + # This method takes an authorization body and splits up the key-value pairs by + # the standardized `:`, `;`, or `\t` delimiters defined in + # `AUTHN_PAIR_DELIMITERS`. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#519 + def raw_params(auth); end + + # This removes the `"` characters wrapping the value. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#512 + def rewrite_param_values(array_params); end + + # Parses the token and options out of the token Authorization header. The value + # for the Authorization header is expected to have the prefix `"Token"` or + # `"Bearer"`. If the header looks like this: + # + # Authorization: Token token="abc", nonce="def" + # + # Then the returned token is `"abc"`, and the options are `{nonce: "def"}`. + # + # Returns an `Array` of `[String, Hash]` if a token is present. Returns `nil` if + # no token is found. + # + # #### Parameters + # + # * `request` - ActionDispatch::Request instance with the current headers. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#494 + def token_and_options(request); end + + # source://actionpack//lib/action_controller/metal/http_authentication.rb#502 + def token_params_from(auth); end +end + +# source://actionpack//lib/action_controller/metal/http_authentication.rb#428 +ActionController::HttpAuthentication::Token::AUTHN_PAIR_DELIMITERS = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_controller/metal/http_authentication.rb#431 +module ActionController::HttpAuthentication::Token::ControllerMethods + # Authenticate using an HTTP Bearer token, or otherwise render an HTTP header + # requesting the client to send a Bearer token. For the authentication to be + # considered successful, `login_procedure` must not return a false value. + # Typically, the authenticated user is returned. + # + # See ActionController::HttpAuthentication::Token for example usage. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#438 + def authenticate_or_request_with_http_token(realm = T.unsafe(nil), message = T.unsafe(nil), &login_procedure); end + + # Authenticate using an HTTP Bearer token. Returns the return value of + # `login_procedure` if a token is found. Returns `nil` if no token is found. + # + # See ActionController::HttpAuthentication::Token for example usage. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#446 + def authenticate_with_http_token(&login_procedure); end + + # Render an HTTP header requesting the client to send a Bearer token for + # authentication. + # + # source://actionpack//lib/action_controller/metal/http_authentication.rb#452 + def request_http_token_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_controller/metal/http_authentication.rb#426 +ActionController::HttpAuthentication::Token::TOKEN_KEY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_controller/metal/http_authentication.rb#427 +ActionController::HttpAuthentication::Token::TOKEN_REGEX = T.let(T.unsafe(nil), Regexp) + +# # Action Controller Implicit Render +# +# Handles implicit rendering for a controller action that does not explicitly +# respond with `render`, `respond_to`, `redirect`, or `head`. +# +# For API controllers, the implicit response is always `204 No Content`. +# +# For all other controllers, we use these heuristics to decide whether to render +# a template, raise an error for a missing template, or respond with `204 No +# Content`: +# +# First, if we DO find a template, it's rendered. Template lookup accounts for +# the action name, locales, format, variant, template handlers, and more (see +# `render` for details). +# +# Second, if we DON'T find a template but the controller action does have +# templates for other formats, variants, etc., then we trust that you meant to +# provide a template for this response, too, and we raise +# ActionController::UnknownFormat with an explanation. +# +# Third, if we DON'T find a template AND the request is a page load in a web +# browser (technically, a non-XHR GET request for an HTML response) where you +# reasonably expect to have rendered a template, then we raise +# ActionController::MissingExactTemplate with an explanation. +# +# Finally, if we DON'T find a template AND the request isn't a browser page +# load, then we implicitly respond with `204 No Content`. +# +# source://actionpack//lib/action_controller/metal/implicit_render.rb#33 +module ActionController::ImplicitRender + include ::ActionController::BasicImplicitRender + + # source://actionpack//lib/action_controller/metal/implicit_render.rb#37 + def default_render; end + + # source://actionpack//lib/action_controller/metal/implicit_render.rb#56 + def method_for_action(action_name); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/implicit_render.rb#63 + def interactive_browser_request?; end +end + +# # Action Controller Instrumentation +# +# Adds instrumentation to several ends in ActionController::Base. It also +# provides some hooks related with process_action. This allows an ORM like +# Active Record and/or DataMapper to plug in ActionController and show related +# information. +# +# Check ActiveRecord::Railties::ControllerRuntime for an example. +# +# source://actionpack//lib/action_controller/metal/instrumentation.rb#16 +module ActionController::Instrumentation + extend ::ActiveSupport::Concern + include ::ActiveSupport::Benchmarkable + include ::AbstractController::Logger + + mixes_in_class_methods ::ActionController::Instrumentation::ClassMethods + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#23 + def initialize(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#49 + def redirect_to(*_arg0); end + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#28 + def render(*_arg0); end + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#43 + def send_data(data, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#36 + def send_file(path, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#21 + def view_runtime; end + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#21 + def view_runtime=(_arg0); end + + private + + # Every time after an action is processed, this method is invoked with the + # payload, so you can add more information. + # + # source://actionpack//lib/action_controller/metal/instrumentation.rb#105 + def append_info_to_payload(payload); end + + # A hook which allows you to clean up any time, wrongly taken into account in + # views, like database querying time. + # + # def cleanup_view_runtime + # super - time_taken_in_something_expensive + # end + # + # source://actionpack//lib/action_controller/metal/instrumentation.rb#99 + def cleanup_view_runtime; end + + # A hook invoked every time a before callback is halted. + # + # source://actionpack//lib/action_controller/metal/instrumentation.rb#89 + def halted_callback_hook(filter, _); end + + # source://actionpack//lib/action_controller/metal/instrumentation.rb#59 + def process_action(*_arg0); end +end + +# source://actionpack//lib/action_controller/metal/instrumentation.rb#109 +module ActionController::Instrumentation::ClassMethods + # A hook which allows other frameworks to log what happened during controller + # process action. This method should return an array with the messages to be + # added. + # + # source://actionpack//lib/action_controller/metal/instrumentation.rb#113 + def log_process_action(payload); end +end + +# source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#10 +class ActionController::InvalidAuthenticityToken < ::ActionController::ActionControllerError; end + +# source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#13 +class ActionController::InvalidCrossOriginRequest < ::ActionController::ActionControllerError; end + +# Raised when initializing Parameters with keys that aren't strings or symbols. +# +# ActionController::Parameters.new(123 => 456) +# # => ActionController::InvalidParameterKey: all keys must be Strings or Symbols, got: Integer +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#84 +class ActionController::InvalidParameterKey < ::ArgumentError; end + +# # Action Controller Live +# +# Mix this module into your controller, and all actions in that controller will +# be able to stream data to the client as it's written. +# +# class MyController < ActionController::Base +# include ActionController::Live +# +# def stream +# response.headers['Content-Type'] = 'text/event-stream' +# 100.times { +# response.stream.write "hello world\n" +# sleep 1 +# } +# ensure +# response.stream.close +# end +# end +# +# There are a few caveats with this module. You **cannot** write headers after +# the response has been committed (Response#committed? will return truthy). +# Calling `write` or `close` on the response stream will cause the response +# object to be committed. Make sure all headers are set before calling write or +# close on your stream. +# +# You **must** call close on your stream when you're finished, otherwise the +# socket may be left open forever. +# +# The final caveat is that your actions are executed in a separate thread than +# the main thread. Make sure your actions are thread safe, and this shouldn't be +# a problem (don't share state across threads, etc). +# +# Note that Rails includes `Rack::ETag` by default, which will buffer your +# response. As a result, streaming responses may not work properly with Rack +# 2.2.x, and you may need to implement workarounds in your application. You can +# either set the `ETag` or `Last-Modified` response headers or remove +# `Rack::ETag` from the middleware stack to address this issue. +# +# Here's an example of how you can set the `Last-Modified` header if your Rack +# version is 2.2.x: +# +# def stream +# response.headers["Content-Type"] = "text/event-stream" +# response.headers["Last-Modified"] = Time.now.httpdate # Add this line if your Rack version is 2.2.x +# ... +# end +# +# ## Streaming and Execution State +# +# When streaming, the action is executed in a separate thread. By default, this thread +# shares execution state from the parent thread. +# +# You can configure which execution state keys should be excluded from being shared +# using the `config.action_controller.live_streaming_excluded_keys` configuration: +# +# # config/application.rb +# config.action_controller.live_streaming_excluded_keys = [:active_record_connected_to_stack] +# +# This is useful when using ActionController::Live inside a `connected_to` block. For example, +# if the parent request is reading from a replica using `connected_to(role: :reading)`, you may +# want the streaming thread to use its own connection context instead of inheriting the read-only +# context: +# +# # Without configuration, streaming thread inherits read-only connection +# ActiveRecord::Base.connected_to(role: :reading) do +# @posts = Post.all +# render stream: true # Streaming thread cannot write to database +# end +# +# # With configuration, streaming thread gets fresh connection context +# # config.action_controller.live_streaming_excluded_keys = [:active_record_connected_to_stack] +# ActiveRecord::Base.connected_to(role: :reading) do +# @posts = Post.all +# render stream: true # Streaming thread can write to database if needed +# end +# +# Common keys you might want to exclude: +# - `:active_record_connected_to_stack` - Database connection routing and roles +# - `:active_record_prohibit_shard_swapping` - Shard swapping restrictions +# +# By default, no keys are excluded to maintain backward compatibility. +# +# source://actionpack//lib/action_controller/metal/live.rb#91 +module ActionController::Live + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::Live::ClassMethods + + # source://actionpack//lib/action_controller/metal/live.rb#413 + def clean_up_thread_locals(*args); end + + # source://actionpack//lib/action_controller/metal/live.rb#94 + def live_streaming_excluded_keys; end + + # source://actionpack//lib/action_controller/metal/live.rb#94 + def live_streaming_excluded_keys=(val); end + + # source://actionpack//lib/action_controller/metal/live.rb#404 + def new_controller_thread; end + + # source://actionpack//lib/action_controller/metal/live.rb#307 + def process(name); end + + # source://actionpack//lib/action_controller/metal/live.rb#352 + def response_body=(body); end + + # Sends a stream to the browser, which is helpful when you're generating exports + # or other running data where you don't want the entire file buffered in memory + # first. Similar to send_data, but where the data is generated live. + # + # #### Options: + # + # * `:filename` - suggests a filename for the browser to use. + # * `:type` - specifies an HTTP content type. You can specify either a string + # or a symbol for a registered type with `Mime::Type.register`, for example + # :json. If omitted, type will be inferred from the file extension specified + # in `:filename`. If no content type is registered for the extension, the + # default type 'application/octet-stream' will be used. + # * `:disposition` - specifies whether the file will be shown inline or + # downloaded. Valid values are 'inline' and 'attachment' (default). + # + # + # Example of generating a csv export: + # + # send_stream(filename: "subscribers.csv") do |stream| + # stream.write "email_address,updated_at\n" + # + # @subscribers.find_each do |subscriber| + # stream.write "#{subscriber.email_address},#{subscriber.updated_at}\n" + # end + # end + # + # source://actionpack//lib/action_controller/metal/live.rb#382 + def send_stream(filename:, disposition: T.unsafe(nil), type: T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_controller/metal/live.rb#421 + def log_error(exception); end + + # Ensure we clean up any thread locals we copied so that the thread can reused. + # Because of the above, we need to prevent the clearing of thread locals, since + # no new thread is actually spawned in the test environment. + # + # source://actionpack//lib/action_controller/test_case.rb#34 + def original_clean_up_thread_locals(locals, thread); end + + # Spawn a new thread to serve up the controller in. This is to get around the + # fact that Rack isn't based around IOs and we need to use a thread to stream + # data from the response bodies. Nobody should call this method except in Rails + # internals. Seriously! + # Disable controller / rendering threads in tests. User tests can access the + # database on the main thread, so they could open a txn, then the controller + # thread will open a new connection and try to access data that's only visible + # to the main thread's txn. This is the problem in #23483. + # + # source://actionpack//lib/action_controller/test_case.rb#25 + def original_new_controller_thread; end + + class << self + # source://actionpack//lib/action_controller/metal/live.rb#94 + def live_streaming_excluded_keys; end + + # source://actionpack//lib/action_controller/metal/live.rb#94 + def live_streaming_excluded_keys=(val); end + + # source://actionpack//lib/action_controller/metal/live.rb#417 + def live_thread_pool_executor; end + end + + module GeneratedClassMethods + def live_streaming_excluded_keys; end + def live_streaming_excluded_keys=(value); end + def live_streaming_excluded_keys?; end + end + + module GeneratedInstanceMethods; end +end + +# source://actionpack//lib/action_controller/metal/live.rb#193 +class ActionController::Live::Buffer < ::ActionDispatch::Response::Buffer + include ::MonitorMixin + + # @return [Buffer] a new instance of Buffer + # + # source://actionpack//lib/action_controller/metal/live.rb#208 + def initialize(response); end + + # Inform the producer/writing thread that the client has disconnected; the + # reading thread is no longer interested in anything that's being written. + # + # See also #close. + # + # source://actionpack//lib/action_controller/metal/live.rb#256 + def abort; end + + # source://actionpack//lib/action_controller/metal/live.rb#275 + def call_on_error; end + + # Write a 'close' event to the buffer; the producer/writing thread uses this to + # notify us that it's finished supplying content. + # + # See also #abort. + # + # source://actionpack//lib/action_controller/metal/live.rb#244 + def close; end + + # Is the client still connected and waiting for content? + # + # The result of calling `write` when this is `false` is determined by + # `ignore_disconnect`. + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/live.rb#267 + def connected?; end + + # Ignore that the client has disconnected. + # + # If this value is `true`, calling `write` after the client disconnects will + # result in the written content being silently discarded. If this value is + # `false` (the default), a ClientDisconnected exception will be raised. + # + # source://actionpack//lib/action_controller/metal/live.rb#206 + def ignore_disconnect; end + + # Ignore that the client has disconnected. + # + # If this value is `true`, calling `write` after the client disconnects will + # result in the written content being silently discarded. If this value is + # `false` (the default), a ClientDisconnected exception will be raised. + # + # source://actionpack//lib/action_controller/metal/live.rb#206 + def ignore_disconnect=(_arg0); end + + # source://actionpack//lib/action_controller/metal/live.rb#271 + def on_error(&block); end + + # source://actionpack//lib/action_controller/metal/live.rb#216 + def write(string); end + + # Same as `write` but automatically include a newline at the end of the string. + # + # source://actionpack//lib/action_controller/metal/live.rb#236 + def writeln(string); end + + private + + # source://actionpack//lib/action_controller/metal/live.rb#286 + def build_queue(queue_size); end + + # source://actionpack//lib/action_controller/metal/live.rb#280 + def each_chunk(&block); end + + class << self + # Returns the value of attribute queue_size. + # + # source://actionpack//lib/action_controller/metal/live.rb#197 + def queue_size; end + + # Sets the attribute queue_size + # + # @param value the value to set the attribute queue_size to. + # + # source://actionpack//lib/action_controller/metal/live.rb#197 + def queue_size=(_arg0); end + end +end + +# source://actionpack//lib/action_controller/metal/live.rb#100 +module ActionController::Live::ClassMethods + # source://actionpack//lib/action_controller/metal/live.rb#101 + def make_response!(request); end +end + +# source://actionpack//lib/action_controller/metal/live.rb#190 +class ActionController::Live::ClientDisconnected < ::RuntimeError; end + +# source://actionpack//lib/action_controller/metal/live.rb#291 +class ActionController::Live::Response < ::ActionDispatch::Response + private + + # source://actionpack//lib/action_controller/metal/live.rb#293 + def before_committed; end + + # source://actionpack//lib/action_controller/metal/live.rb#300 + def build_buffer(response, body); end +end + +# # Action Controller Live Server Sent Events +# +# This class provides the ability to write an SSE (Server Sent Event) to an IO +# stream. The class is initialized with a stream and can be used to either write +# a JSON string or an object which can be converted to JSON. +# +# Writing an object will convert it into standard SSE format with whatever +# options you have configured. You may choose to set the following options: +# +# `:event` +# +# `:retry` +# +# `:id` +# server will receive a `Last-Event-ID` header with value equal to `id`. +# +# After setting an option in the constructor of the SSE object, all future SSEs +# sent across the stream will use those options unless overridden. +# +# Example Usage: +# +# class MyController < ActionController::Base +# include ActionController::Live +# +# def index +# response.headers['Content-Type'] = 'text/event-stream' +# sse = SSE.new(response.stream, retry: 300, event: "event-name") +# sse.write({ name: 'John'}) +# sse.write({ name: 'John'}, id: 10) +# sse.write({ name: 'John'}, id: 10, event: "other-event") +# sse.write({ name: 'John'}, id: 10, event: "other-event", retry: 500) +# ensure +# sse.close +# end +# end +# +# Note: SSEs are not currently supported by IE. However, they are supported by +# Chrome, Firefox, Opera, and Safari. +# +# source://actionpack//lib/action_controller/metal/live.rb#153 +class ActionController::Live::SSE + # @return [SSE] a new instance of SSE + # + # source://actionpack//lib/action_controller/metal/live.rb#156 + def initialize(stream, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/live.rb#161 + def close; end + + # source://actionpack//lib/action_controller/metal/live.rb#165 + def write(object, options = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_controller/metal/live.rb#175 + def perform_write(json, options); end +end + +# source://actionpack//lib/action_controller/metal/live.rb#154 +ActionController::Live::SSE::PERMITTED_OPTIONS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_controller/test_case.rb#184 +class ActionController::LiveTestResponse < ::ActionController::Live::Response + # Was there a server-side error? + # + # source://actionpack//lib/action_controller/test_case.rb#192 + def error?; end + + # Was the URL not found? + # + # source://actionpack//lib/action_controller/test_case.rb#189 + def missing?; end + + # Was the response successful? + # + # source://actionpack//lib/action_controller/test_case.rb#186 + def success?; end +end + +# source://actionpack//lib/action_controller/log_subscriber.rb#4 +class ActionController::LogSubscriber < ::ActiveSupport::LogSubscriber + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def backtrace_cleaner; end + + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def backtrace_cleaner=(_arg0); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def backtrace_cleaner?; end + + # source://actionpack//lib/action_controller/log_subscriber.rb#93 + def exist_fragment?(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#93 + def expire_fragment(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#47 + def halted_callback(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#105 + def logger; end + + # source://actionpack//lib/action_controller/log_subscriber.rb#26 + def process_action(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#93 + def read_fragment(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#109 + def redirect_source_location; end + + # source://actionpack//lib/action_controller/log_subscriber.rb#68 + def redirect_to(event); end + + # Manually subscribed below + # + # source://actionpack//lib/action_controller/log_subscriber.rb#53 + def rescue_from_callback(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#77 + def send_data(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#63 + def send_file(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#9 + def start_processing(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#82 + def unpermitted_parameters(event); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#93 + def write_fragment(event); end + + class << self + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def backtrace_cleaner; end + + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def backtrace_cleaner=(value); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def backtrace_cleaner?; end + + private + + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def __class_attr_backtrace_cleaner; end + + # source://actionpack//lib/action_controller/log_subscriber.rb#7 + def __class_attr_backtrace_cleaner=(new_value); end + + # source://actionpack//lib/action_controller/log_subscriber.rb#24 + def __class_attr_log_levels; end + + # source://actionpack//lib/action_controller/log_subscriber.rb#24 + def __class_attr_log_levels=(new_value); end + end +end + +# source://actionpack//lib/action_controller/log_subscriber.rb#5 +ActionController::LogSubscriber::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_controller/metal/logging.rb#6 +module ActionController::Logging + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::Logging::ClassMethods +end + +# source://actionpack//lib/action_controller/metal/logging.rb#9 +module ActionController::Logging::ClassMethods + # Set a different log level per request. + # + # # Use the debug log level if a particular cookie is set. + # class ApplicationController < ActionController::Base + # log_at :debug, if: -> { cookies[:debug] } + # end + # + # source://actionpack//lib/action_controller/metal/logging.rb#17 + def log_at(level, **options); end +end + +# # Action Controller Metal +# +# `ActionController::Metal` is the simplest possible controller, providing a +# valid Rack interface without the additional niceties provided by +# ActionController::Base. +# +# A sample metal controller might look like this: +# +# class HelloController < ActionController::Metal +# def index +# self.response_body = "Hello World!" +# end +# end +# +# And then to route requests to your metal controller, you would add something +# like this to `config/routes.rb`: +# +# get 'hello', to: HelloController.action(:index) +# +# The ::action method returns a valid Rack application for the Rails router to +# dispatch to. +# +# ## Rendering Helpers +# +# By default, `ActionController::Metal` provides no utilities for rendering +# views, partials, or other responses aside from some low-level setters such +# as #response_body=, #content_type=, and #status=. To add the render helpers +# you're used to having in a normal controller, you can do the following: +# +# class HelloController < ActionController::Metal +# include AbstractController::Rendering +# include ActionView::Layouts +# append_view_path "#{Rails.root}/app/views" +# +# def index +# render "hello/index" +# end +# end +# +# ## Redirection Helpers +# +# To add redirection helpers to your metal controller, do the following: +# +# class HelloController < ActionController::Metal +# include ActionController::Redirecting +# include Rails.application.routes.url_helpers +# +# def index +# redirect_to root_url +# end +# end +# +# ## Other Helpers +# +# You can refer to the modules included in ActionController::Base to see other +# features you can bring into your metal controller. +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://actionpack//lib/action_controller/metal.rb#121 +class ActionController::Metal < ::AbstractController::Base + include ::ActionController::Testing::Functional + + # @return [Metal] a new instance of Metal + # + # source://actionpack//lib/action_controller/metal.rb#210 + def initialize; end + + # Delegates to ActionDispatch::Response#content_type + # + # source://actionpack//lib/action_controller/metal.rb#204 + def content_type(*_arg0, **_arg1, &_arg2); end + + # Delegates to ActionDispatch::Response#content_type= + # + # source://actionpack//lib/action_controller/metal.rb#192 + def content_type=(arg); end + + # Delegates to the class's ::controller_name. + # + # source://actionpack//lib/action_controller/metal.rb#156 + def controller_name; end + + # source://actionpack//lib/action_controller/metal.rb#249 + def dispatch(name, request, response); end + + # Delegates to ActionDispatch::Response#headers. + # + # source://actionpack//lib/action_controller/metal.rb#180 + def headers(*_arg0, **_arg1, &_arg2); end + + # Delegates to ActionDispatch::Response#location + # + # source://actionpack//lib/action_controller/metal.rb#200 + def location(*_arg0, **_arg1, &_arg2); end + + # Delegates to ActionDispatch::Response#location= + # + # source://actionpack//lib/action_controller/metal.rb#188 + def location=(arg); end + + # Delegates to ActionDispatch::Response#media_type + # + # source://actionpack//lib/action_controller/metal.rb#208 + def media_type(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/metal.rb#288 + def middleware_stack; end + + # source://actionpack//lib/action_controller/metal.rb#288 + def middleware_stack=(_arg0); end + + # source://actionpack//lib/action_controller/metal.rb#288 + def middleware_stack?; end + + # source://actionpack//lib/action_controller/metal.rb#219 + def params; end + + # source://actionpack//lib/action_controller/metal.rb#223 + def params=(val); end + + # Tests if render or redirect has already happened. + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal.rb#245 + def performed?; end + + # :attr_reader: request + # + # The ActionDispatch::Request instance for the current request. + # + # source://actionpack//lib/action_controller/metal.rb#164 + def request; end + + # source://actionpack//lib/action_controller/metal.rb#164 + def request=(_arg0); end + + # source://actionpack//lib/action_controller/metal.rb#284 + def reset_session; end + + # :attr_reader: response + # + # The ActionDispatch::Response instance for the current response. + # + # source://actionpack//lib/action_controller/metal.rb#170 + def response; end + + # Assign the response and mark it as committed. No further processing will + # occur. + # + # source://actionpack//lib/action_controller/metal.rb#268 + def response=(response); end + + # source://actionpack//lib/action_controller/metal.rb#234 + def response_body=(body); end + + # Delegates to ActionDispatch::Response#status + # + # source://actionpack//lib/action_controller/metal.rb#227 + def response_code(*_arg0, **_arg1, &_arg2); end + + # The ActionDispatch::Request::Session instance for the current request. + # See further details in the + # [Active Controller Session guide](https://guides.rubyonrails.org/action_controller_overview.html#session). + # + # source://actionpack//lib/action_controller/metal.rb#176 + def session(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/metal.rb#275 + def set_request!(request); end + + # source://actionpack//lib/action_controller/metal.rb#257 + def set_response!(response); end + + # Delegates to ActionDispatch::Response#status + # + # source://actionpack//lib/action_controller/metal.rb#196 + def status(*_arg0, **_arg1, &_arg2); end + + # Delegates to ActionDispatch::Response#status= + # + # source://actionpack//lib/action_controller/metal.rb#184 + def status=(arg); end + + # source://actionpack//lib/action_controller/metal.rb#280 + def to_a; end + + # Basic `url_for` that can be overridden for more robust functionality. + # + # source://actionpack//lib/action_controller/metal.rb#230 + def url_for(string); end + + class << self + # Returns a Rack endpoint for the given action name. + # + # source://actionpack//lib/action_controller/metal.rb#315 + def action(name); end + + # source://actionpack//lib/action_controller/metal.rb#140 + def action_encoding_template(action); end + + # Returns the last part of the controller's name, underscored, without the + # ending `Controller`. For instance, `PostsController` returns `posts`. + # Namespaces are left out, so `Admin::PostsController` returns `posts` as well. + # + # #### Returns + # * `string` + # + # source://actionpack//lib/action_controller/metal.rb#130 + def controller_name; end + + # Direct dispatch to the controller. Instantiates the controller, then executes + # the action named `name`. + # + # source://actionpack//lib/action_controller/metal.rb#331 + def dispatch(name, req, res); end + + # source://actionpack//lib/action_controller/metal.rb#134 + def make_response!(request); end + + # The middleware stack used by this controller. + # + # By default uses a variation of ActionDispatch::MiddlewareStack which allows + # for the following syntax: + # + # class PostsController < ApplicationController + # use AuthenticationMiddleware, except: [:index, :show] + # end + # + # Read more about [Rails middleware stack] + # (https://guides.rubyonrails.org/rails_on_rack.html#action-dispatcher-middleware-stack) + # in the guides. + # + # source://actionpack//lib/action_controller/metal.rb#310 + def middleware; end + + # source://actionpack//lib/action_controller/metal.rb#288 + def middleware_stack; end + + # source://actionpack//lib/action_controller/metal.rb#288 + def middleware_stack=(value); end + + # source://actionpack//lib/action_controller/metal.rb#288 + def middleware_stack?; end + + # Pushes the given Rack middleware and its arguments to the bottom of the + # middleware stack. + # + # source://actionpack//lib/action_controller/metal.rb#293 + def use(*_arg0, **_arg1, &_arg2); end + + private + + # source://actionpack//lib/action_controller/metal.rb#121 + def __class_attr_config; end + + # source://actionpack//lib/action_controller/metal.rb#121 + def __class_attr_config=(new_value); end + + # source://actionpack//lib/action_controller/metal.rb#288 + def __class_attr_middleware_stack; end + + # source://actionpack//lib/action_controller/metal.rb#288 + def __class_attr_middleware_stack=(new_value); end + + # @private + # + # source://actionpack//lib/action_controller/metal.rb#146 + def inherited(subclass); end + end +end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#52 +class ActionController::MethodNotAllowed < ::ActionController::ActionControllerError + # @return [MethodNotAllowed] a new instance of MethodNotAllowed + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#53 + def initialize(*allowed_methods); end +end + +# # Action Controller MiddlewareStack +# +# Extend ActionDispatch middleware stack to make it aware of options allowing +# the following syntax in controllers: +# +# class PostsController < ApplicationController +# use AuthenticationMiddleware, except: [:index, :show] +# end +# +# source://actionpack//lib/action_controller/metal.rb#18 +class ActionController::MiddlewareStack < ::ActionDispatch::MiddlewareStack + # source://actionpack//lib/action_controller/metal.rb#31 + def build(action, app = T.unsafe(nil), &block); end + + private + + # source://actionpack//lib/action_controller/metal.rb#44 + def build_middleware(klass, args, block); end +end + +# source://actionpack//lib/action_controller/metal.rb#41 +ActionController::MiddlewareStack::EXCLUDE = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_controller/metal.rb#40 +ActionController::MiddlewareStack::INCLUDE = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_controller/metal.rb#19 +class ActionController::MiddlewareStack::Middleware < ::ActionDispatch::MiddlewareStack::Middleware + # @return [Middleware] a new instance of Middleware + # + # source://actionpack//lib/action_controller/metal.rb#20 + def initialize(klass, args, actions, strategy, block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal.rb#26 + def valid?(action); end +end + +# source://actionpack//lib/action_controller/metal.rb#42 +ActionController::MiddlewareStack::NULL = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_controller/metal/mime_responds.rb#8 +module ActionController::MimeResponds + # Without web-service support, an action which collects the data for displaying + # a list of people might look something like this: + # + # def index + # @people = Person.all + # end + # + # That action implicitly responds to all formats, but formats can also be + # explicitly enumerated: + # + # def index + # @people = Person.all + # respond_to :html, :js + # end + # + # Here's the same action, with web-service support baked in: + # + # def index + # @people = Person.all + # + # respond_to do |format| + # format.html + # format.js + # format.xml { render xml: @people } + # end + # end + # + # What that says is, "if the client wants HTML or JS in response to this action, + # just respond as we would have before, but if the client wants XML, return them + # the list of people in XML format." (Rails determines the desired response + # format from the HTTP Accept header submitted by the client.) + # + # Supposing you have an action that adds a new person, optionally creating their + # company (by name) if it does not already exist, without web-services, it might + # look like this: + # + # def create + # @company = Company.find_or_create_by(name: params[:company][:name]) + # @person = @company.people.create(params[:person]) + # + # redirect_to(person_list_url) + # end + # + # Here's the same action, with web-service support baked in: + # + # def create + # company = params[:person].delete(:company) + # @company = Company.find_or_create_by(name: company[:name]) + # @person = @company.people.create(params[:person]) + # + # respond_to do |format| + # format.html { redirect_to(person_list_url) } + # format.js + # format.xml { render xml: @person.to_xml(include: @company) } + # end + # end + # + # If the client wants HTML, we just redirect them back to the person list. If + # they want JavaScript, then it is an Ajax request and we render the JavaScript + # template associated with this action. Lastly, if the client wants XML, we + # render the created person as XML, but with a twist: we also include the + # person's company in the rendered XML, so you get something like this: + # + # + # ... + # ... + # + # ... + # ... + # ... + # + # + # + # Note, however, the extra bit at the top of that action: + # + # company = params[:person].delete(:company) + # @company = Company.find_or_create_by(name: company[:name]) + # + # This is because the incoming XML document (if a web-service request is in + # process) can only contain a single root-node. So, we have to rearrange things + # so that the request looks like this (url-encoded): + # + # person[name]=...&person[company][name]=...&... + # + # And, like this (xml-encoded): + # + # + # ... + # + # ... + # + # + # + # In other words, we make the request so that it operates on a single entity's + # person. Then, in the action, we extract the company data from the request, + # find or create the company, and then create the new person with the remaining + # data. + # + # Note that you can define your own XML parameter parser which would allow you + # to describe multiple entities in a single request (i.e., by wrapping them all + # in a single root node), but if you just go with the flow and accept Rails' + # defaults, life will be much easier. + # + # If you need to use a MIME type which isn't supported by default, you can + # register your own handlers in `config/initializers/mime_types.rb` as follows. + # + # Mime::Type.register "image/jpeg", :jpg + # + # `respond_to` also allows you to specify a common block for different formats + # by using `any`: + # + # def index + # @people = Person.all + # + # respond_to do |format| + # format.html + # format.any(:xml, :json) { render request.format.to_sym => @people } + # end + # end + # + # In the example above, if the format is xml, it will render: + # + # render xml: @people + # + # Or if the format is json: + # + # render json: @people + # + # `any` can also be used with no arguments, in which case it will be used for + # any format requested by the user: + # + # respond_to do |format| + # format.html + # format.any { redirect_to support_path } + # end + # + # Formats can have different variants. + # + # The request variant is a specialization of the request format, like `:tablet`, + # `:phone`, or `:desktop`. + # + # We often want to render different html/json/xml templates for phones, tablets, + # and desktop browsers. Variants make it easy. + # + # You can set the variant in a `before_action`: + # + # request.variant = :tablet if /iPad/.match?(request.user_agent) + # + # Respond to variants in the action just like you respond to formats: + # + # respond_to do |format| + # format.html do |variant| + # variant.tablet # renders app/views/projects/show.html+tablet.erb + # variant.phone { extra_setup; render ... } + # variant.none { special_setup } # executed only if there is no variant set + # end + # end + # + # Provide separate templates for each format and variant: + # + # app/views/projects/show.html.erb + # app/views/projects/show.html+tablet.erb + # app/views/projects/show.html+phone.erb + # + # When you're not sharing any code within the format, you can simplify defining + # variants using the inline syntax: + # + # respond_to do |format| + # format.js { render "trash" } + # format.html.phone { redirect_to progress_path } + # format.html.none { render "trash" } + # end + # + # Variants also support common `any`/`all` block that formats have. + # + # It works for both inline: + # + # respond_to do |format| + # format.html.any { render html: "any" } + # format.html.phone { render html: "phone" } + # end + # + # and block syntax: + # + # respond_to do |format| + # format.html do |variant| + # variant.any(:tablet, :phablet){ render html: "any" } + # variant.phone { render html: "phone" } + # end + # end + # + # You can also set an array of variants: + # + # request.variant = [:tablet, :phone] + # + # This will work similarly to formats and MIME types negotiation. If there is no + # `:tablet` variant declared, the `:phone` variant will be used: + # + # respond_to do |format| + # format.html.none + # format.html.phone # this gets rendered + # end + # + # @raise [ArgumentError] + # @yield [collector] + # + # source://actionpack//lib/action_controller/metal/mime_responds.rb#211 + def respond_to(*mimes); end +end + +# A container for responses available from the current controller for requests +# for different mime-types sent to a particular action. +# +# The public controller methods `respond_to` may be called with a block that is +# used to define responses to different mime-types, e.g. for `respond_to` : +# +# respond_to do |format| +# format.html +# format.xml { render xml: @people } +# end +# +# In this usage, the argument passed to the block (`format` above) is an +# instance of the ActionController::MimeResponds::Collector class. This object +# serves as a container in which available responses can be stored by calling +# any of the dynamically generated, mime-type-specific methods such as `html`, +# `xml` etc on the Collector. Each response is represented by a corresponding +# block if present. +# +# A subsequent call to #negotiate_format(request) will enable the Collector to +# determine which specific mime-type it should respond with for the current +# request, with this response then being accessible by calling #response. +# +# source://actionpack//lib/action_controller/metal/mime_responds.rb#251 +class ActionController::MimeResponds::Collector + include ::AbstractController::Collector + + # @return [Collector] a new instance of Collector + # + # source://actionpack//lib/action_controller/metal/mime_responds.rb#255 + def initialize(mimes, variant = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#269 + def all(*args, &block); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#262 + def any(*args, &block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/mime_responds.rb#280 + def any_response?; end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#271 + def custom(mime_type, &block); end + + # Returns the value of attribute format. + # + # source://actionpack//lib/action_controller/metal/mime_responds.rb#253 + def format; end + + # Sets the attribute format + # + # @param value the value to set the attribute format to. + # + # source://actionpack//lib/action_controller/metal/mime_responds.rb#253 + def format=(_arg0); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#297 + def negotiate_format(request); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#284 + def response; end +end + +# source://actionpack//lib/action_controller/metal/mime_responds.rb#301 +class ActionController::MimeResponds::Collector::VariantCollector + # @return [VariantCollector] a new instance of VariantCollector + # + # source://actionpack//lib/action_controller/metal/mime_responds.rb#302 + def initialize(variant = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#316 + def all(*args, &block); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#307 + def any(*args, &block); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#318 + def method_missing(name, *_arg1, &block); end + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#322 + def variant; end + + private + + # source://actionpack//lib/action_controller/metal/mime_responds.rb#331 + def variant_key; end +end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#96 +class ActionController::MissingExactTemplate < ::ActionController::UnknownFormat + # @return [MissingExactTemplate] a new instance of MissingExactTemplate + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#99 + def initialize(message, controller, action_name); end + + # Returns the value of attribute action_name. + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#97 + def action_name; end + + # Returns the value of attribute controller. + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#97 + def controller; end +end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#61 +class ActionController::MissingFile < ::ActionController::ActionControllerError; end + +# See `Responder#api_behavior` +# +# source://actionpack//lib/action_controller/metal/renderers.rb#17 +class ActionController::MissingRenderer < ::LoadError + # @return [MissingRenderer] a new instance of MissingRenderer + # + # source://actionpack//lib/action_controller/metal/renderers.rb#18 + def initialize(format); end +end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#58 +class ActionController::NotImplemented < ::ActionController::MethodNotAllowed; end + +# Specify binary encoding for parameters for a given action. +# +# source://actionpack//lib/action_controller/metal/parameter_encoding.rb#7 +module ActionController::ParameterEncoding + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::ParameterEncoding::ClassMethods +end + +# source://actionpack//lib/action_controller/metal/parameter_encoding.rb#10 +module ActionController::ParameterEncoding::ClassMethods + # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#20 + def action_encoding_template(action); end + + # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#11 + def inherited(klass); end + + # Specify the encoding for a parameter on an action. If not specified the + # default is UTF-8. + # + # You can specify a binary (ASCII_8BIT) parameter with: + # + # class RepositoryController < ActionController::Base + # # This specifies that file_path is not UTF-8 and is instead ASCII_8BIT + # param_encoding :show, :file_path, Encoding::ASCII_8BIT + # + # def show + # @repo = Repository.find_by_filesystem_path params[:file_path] + # + # # params[:repo_name] remains UTF-8 encoded + # @repo_name = params[:repo_name] + # end + # + # def index + # @repositories = Repository.all + # end + # end + # + # The file_path parameter on the show action would be encoded as ASCII-8BIT, but + # all other arguments will remain UTF-8 encoded. This is useful in the case + # where an application must handle data but encoding of the data is unknown, + # like file system data. + # + # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#79 + def param_encoding(action, param, encoding); end + + # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#16 + def setup_param_encode; end + + # Specify that a given action's parameters should all be encoded as ASCII-8BIT + # (it "skips" the encoding default of UTF-8). + # + # For example, a controller would use it like this: + # + # class RepositoryController < ActionController::Base + # skip_parameter_encoding :show + # + # def show + # @repo = Repository.find_by_filesystem_path params[:file_path] + # + # # `repo_name` is guaranteed to be UTF-8, but was ASCII-8BIT, so + # # tag it as such + # @repo_name = params[:repo_name].force_encoding 'UTF-8' + # end + # + # def index + # @repositories = Repository.all + # end + # end + # + # The show action in the above controller would have all parameter values + # encoded as ASCII-8BIT. This is useful in the case where an application must + # handle data but encoding of the data is unknown, like file system data. + # + # source://actionpack//lib/action_controller/metal/parameter_encoding.rb#50 + def skip_parameter_encoding(action); end +end + +# Raised when a required parameter is missing. +# +# params = ActionController::Parameters.new(a: {}) +# params.fetch(:b) +# # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: b +# params.require(:a) +# # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: a +# params.expect(a: []) +# # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: a +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#25 +class ActionController::ParameterMissing < ::KeyError + # @return [ParameterMissing] a new instance of ParameterMissing + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#28 + def initialize(param, keys = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#37 + def corrections; end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#26 + def keys; end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#26 + def param; end +end + +# # Action Controller Parameters +# +# Allows you to choose which attributes should be permitted for mass updating +# and thus prevent accidentally exposing that which shouldn't be exposed. +# +# Provides methods for filtering and requiring params: +# +# * `expect` to safely permit and require parameters in one step. +# * `permit` to filter params for mass assignment. +# * `require` to require a parameter or raise an error. +# +# Examples: +# +# params = ActionController::Parameters.new({ +# person: { +# name: "Francesco", +# age: 22, +# role: "admin" +# } +# }) +# +# permitted = params.expect(person: [:name, :age]) +# permitted # => #"Francesco", "age"=>22} permitted: true> +# +# Person.first.update!(permitted) +# # => # +# +# Parameters provides two options that control the top-level behavior of new +# instances: +# +# * `permit_all_parameters` - If it's `true`, all the parameters will be +# permitted by default. The default is `false`. +# * `action_on_unpermitted_parameters` - Controls behavior when parameters +# that are not explicitly permitted are found. The default value is `:log` +# in test and development environments, `false` otherwise. The values can +# be: +# * `false` to take no action. +# * `:log` to emit an `ActiveSupport::Notifications.instrument` event on +# the `unpermitted_parameters.action_controller` topic and log at the +# DEBUG level. +# * `:raise` to raise an ActionController::UnpermittedParameters +# exception. +# +# Examples: +# +# params = ActionController::Parameters.new +# params.permitted? # => false +# +# ActionController::Parameters.permit_all_parameters = true +# +# params = ActionController::Parameters.new +# params.permitted? # => true +# +# params = ActionController::Parameters.new(a: "123", b: "456") +# params.permit(:c) +# # => # +# +# ActionController::Parameters.action_on_unpermitted_parameters = :raise +# +# params = ActionController::Parameters.new(a: "123", b: "456") +# params.permit(:c) +# # => ActionController::UnpermittedParameters: found unpermitted keys: a, b +# +# Please note that these options *are not thread-safe*. In a multi-threaded +# environment they should only be set once at boot-time and never mutated at +# runtime. +# +# You can fetch values of `ActionController::Parameters` using either `:key` or +# `"key"`. +# +# params = ActionController::Parameters.new(key: "value") +# params[:key] # => "value" +# params["key"] # => "value" +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#160 +class ActionController::Parameters + include ::ActiveSupport::DeepMergeable + + # Returns a new `ActionController::Parameters` instance. Also, sets the + # `permitted` attribute to the default value of + # `ActionController::Parameters.permit_all_parameters`. + # + # class Person < ActiveRecord::Base + # end + # + # params = ActionController::Parameters.new(name: "Francesco") + # params.permitted? # => false + # Person.new(params) # => ActiveModel::ForbiddenAttributesError + # + # ActionController::Parameters.permit_all_parameters = true + # + # params = ActionController::Parameters.new(name: "Francesco") + # params.permitted? # => true + # Person.new(params) # => # + # + # @return [Parameters] a new instance of Parameters + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#287 + def initialize(parameters = T.unsafe(nil), logging_context = T.unsafe(nil)); end + + # Returns true if another `Parameters` object contains the same content and + # permitted flag. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#301 + def ==(other); end + + # Returns a parameter for the given `key`. If not found, returns `nil`. + # + # params = ActionController::Parameters.new(person: { name: "Francesco" }) + # params[:person] # => #"Francesco"} permitted: false> + # params[:none] # => nil + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#797 + def [](key); end + + # Assigns a value to a given `key`. The given key may still get filtered out + # when #permit is called. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#803 + def []=(key, value); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#263 + def always_permitted_parameters; end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#263 + def always_permitted_parameters=(val); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#250 + def as_json(*_arg0, **_arg1, &_arg2); end + + # Returns a new `ActionController::Parameters` instance with `nil` values + # removed. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#974 + def compact; end + + # Removes all `nil` values in place and returns `self`, or `nil` if no changes + # were made. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#980 + def compact!; end + + # Returns a new `ActionController::Parameters` instance without the blank + # values. Uses Object#blank? for determining if a value is blank. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#986 + def compact_blank; end + + # Removes all blank values in place and returns self. Uses Object#blank? for + # determining if a value is blank. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#992 + def compact_blank!; end + + # Attribute that keeps track of converted arrays, if any, to avoid double + # looping in the common use case permit + mass-assignment. Defined in a method + # to instantiate it only if needed. + # + # Testing membership still loops, but it's going to be faster than our own loop + # that converts values. Also, we are not going to build a new array object per + # fetch. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#435 + def converted_arrays; end + + # Returns a duplicate `ActionController::Parameters` instance with the same + # permitted parameters. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1092 + def deep_dup; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1027 + def deep_merge?(other_hash); end + + # Returns a new `ActionController::Parameters` instance with the results of + # running `block` once for every key. This includes the keys from the root hash + # and from all nested hashes and arrays. The values are unchanged. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#924 + def deep_transform_keys(&block); end + + # Returns the same `ActionController::Parameters` instance with changed keys. + # This includes the keys from the root hash and from all nested hashes and + # arrays. The values are unchanged. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#933 + def deep_transform_keys!(&block); end + + # Deletes a key-value pair from `Parameters` and returns the value. If `key` is + # not found, returns `nil` (or, with optional code block, yields `key` and + # returns the result). This method is similar to #extract!, which returns the + # corresponding `ActionController::Parameters` object. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#942 + def delete(key, &block); end + + # Removes items that the block evaluates to true and returns self. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#970 + def delete_if(&block); end + + # Extracts the nested parameter from the given `keys` by calling `dig` at each + # step. Returns `nil` if any intermediate step is `nil`. + # + # params = ActionController::Parameters.new(foo: { bar: { baz: 1 } }) + # params.dig(:foo, :bar, :baz) # => 1 + # params.dig(:foo, :zot, :xyz) # => nil + # + # params2 = ActionController::Parameters.new(foo: [10, 11, 12]) + # params2.dig(:foo, 1) # => 11 + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#841 + def dig(*keys); end + + # Convert all hashes in values into parameters, then yield each pair in the same + # way as `Hash#each_pair`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#410 + def each(&block); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#250 + def each_key(*_arg0, **_arg1, &_arg2); end + + # Convert all hashes in values into parameters, then yield each pair in the same + # way as `Hash#each_pair`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#402 + def each_pair(&block); end + + # Convert all hashes in values into parameters, then yield each value in the + # same way as `Hash#each_value`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#414 + def each_value(&block); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#250 + def empty?(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1086 + def encode_with(coder); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#309 + def eql?(other); end + + # Returns a new `ActionController::Parameters` instance that filters out the + # given `keys`. + # + # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) + # params.except(:a, :b) # => #3} permitted: false> + # params.except(:d) # => #1, "b"=>2, "c"=>3} permitted: false> + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#869 + def except(*keys); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#250 + def exclude?(*_arg0, **_arg1, &_arg2); end + + # `expect` is the preferred way to require and permit parameters. + # It is safer than the previous recommendation to call `permit` and `require` + # in sequence, which could allow user triggered 500 errors. + # + # `expect` is more strict with types to avoid a number of potential pitfalls + # that may be encountered with the `.require.permit` pattern. + # + # For example: + # + # params = ActionController::Parameters.new(comment: { text: "hello" }) + # params.expect(comment: [:text]) + # # => # + # + # params = ActionController::Parameters.new(comment: [{ text: "hello" }, { text: "world" }]) + # params.expect(comment: [:text]) + # # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: comment + # + # In order to permit an array of parameters, the array must be defined + # explicitly. Use double array brackets, an array inside an array, to + # declare that an array of parameters is expected. + # + # params = ActionController::Parameters.new(comments: [{ text: "hello" }, { text: "world" }]) + # params.expect(comments: [[:text]]) + # # => [# "hello" } permitted: true>, + # # # "world" } permitted: true>] + # + # params = ActionController::Parameters.new(comments: { text: "hello" }) + # params.expect(comments: [[:text]]) + # # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: comments + # + # `expect` is intended to protect against array tampering. + # + # params = ActionController::Parameters.new(user: "hack") + # # The previous way of requiring and permitting parameters will error + # params.require(:user).permit(:name, pets: [:name]) # wrong + # # => NoMethodError: undefined method `permit' for an instance of String + # + # # similarly with nested parameters + # params = ActionController::Parameters.new(user: { name: "Martin", pets: { name: "hack" } }) + # user_params = params.require(:user).permit(:name, pets: [:name]) # wrong + # # user_params[:pets] is expected to be an array but is a hash + # + # `expect` solves this by being more strict with types. + # + # params = ActionController::Parameters.new(user: "hack") + # params.expect(user: [ :name, pets: [[:name]] ]) + # # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: user + # + # # with nested parameters + # params = ActionController::Parameters.new(user: { name: "Martin", pets: { name: "hack" } }) + # user_params = params.expect(user: [:name, pets: [[:name]] ]) + # user_params[:pets] # => nil + # + # As the examples show, `expect` requires the `:user` key, and any root keys + # similar to the `.require.permit` pattern. If multiple root keys are + # expected, they will all be required. + # + # params = ActionController::Parameters.new(name: "Martin", pies: [{ type: "dessert", flavor: "pumpkin"}]) + # name, pies = params.expect(:name, pies: [[:type, :flavor]]) + # name # => "Martin" + # pies # => [#"dessert", "flavor"=>"pumpkin"} permitted: true>] + # + # When called with a hash with multiple keys, `expect` will permit the + # parameters and require the keys in the order they are given in the hash, + # returning an array of the permitted parameters. + # + # params = ActionController::Parameters.new(subject: { name: "Martin" }, object: { pie: "pumpkin" }) + # subject, object = params.expect(subject: [:name], object: [:pie]) + # subject # => #"Martin"} permitted: true> + # object # => #"pumpkin"} permitted: true> + # + # Besides being more strict about array vs hash params, `expect` uses permit + # internally, so it will behave similarly. + # + # params = ActionController::Parameters.new({ + # person: { + # name: "Francesco", + # age: 22, + # pets: [{ + # name: "Purplish", + # category: "dogs" + # }] + # } + # }) + # + # permitted = params.expect(person: [ :name, { pets: [[:name]] } ]) + # permitted.permitted? # => true + # permitted[:name] # => "Francesco" + # permitted[:age] # => nil + # permitted[:pets][0][:name] # => "Purplish" + # permitted[:pets][0][:category] # => nil + # + # An array of permitted scalars may be expected with the following: + # + # params = ActionController::Parameters.new(tags: ["rails", "parameters"]) + # permitted = params.expect(tags: []) + # permitted # => ["rails", "parameters"] + # permitted.is_a?(Array) # => true + # permitted.size # => 2 + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#772 + def expect(*filters); end + + # Same as `expect`, but raises an `ActionController::ExpectedParameterMissing` + # instead of `ActionController::ParameterMissing`. Unlike `expect` which + # will render a 400 response, `expect!` will raise an exception that is + # not handled. This is intended for debugging invalid params for an + # internal API where incorrectly formatted params would indicate a bug + # in a client library that should be fixed. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#786 + def expect!(*filters); end + + # Removes and returns the key/value pairs matching the given keys. + # + # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) + # params.extract!(:a, :b) # => #1, "b"=>2} permitted: false> + # params # => #3} permitted: false> + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#879 + def extract!(*keys); end + + # Returns parameter value for the given `key` separated by `delimiter`. + # + # params = ActionController::Parameters.new(id: "1_123", tags: "ruby,rails") + # params.extract_value(:id) # => ["1", "123"] + # params.extract_value(:tags, delimiter: ",") # => ["ruby", "rails"] + # params.extract_value(:non_existent_key) # => nil + # + # Note that if the given `key`'s value contains blank elements, then the + # returned array will include empty strings. + # + # params = ActionController::Parameters.new(tags: "ruby,rails,,web") + # params.extract_value(:tags, delimiter: ",") # => ["ruby", "rails", "", "web"] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1110 + def extract_value(key, delimiter: T.unsafe(nil)); end + + # Returns a parameter for the given `key`. If the `key` can't be found, there + # are several options: With no other arguments, it will raise an + # ActionController::ParameterMissing error; if a second argument is given, then + # that is returned (converted to an instance of `ActionController::Parameters` + # if possible); if a block is given, then that will be run and its result + # returned. + # + # params = ActionController::Parameters.new(person: { name: "Francesco" }) + # params.fetch(:person) # => #"Francesco"} permitted: false> + # params.fetch(:none) # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: none + # params.fetch(:none, {}) # => # + # params.fetch(:none, "Francesco") # => "Francesco" + # params.fetch(:none) { "Francesco" } # => "Francesco" + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#820 + def fetch(key, *args); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#253 + def has_key?(*_arg0, **_arg1, &_arg2); end + + # Returns true if the given value is present for some key in the parameters. + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#997 + def has_value?(value); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#315 + def hash; end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#250 + def include?(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1068 + def init_with(coder); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1055 + def inspect; end + + # Equivalent to Hash#keep_if, but returns `nil` if no changes were made. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#957 + def keep_if(&block); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#254 + def key?(*_arg0, **_arg1, &_arg2); end + + # :method: to_s + # + # :call-seq: + # to_s() + # + # Returns the content of the parameters as a string. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#250 + def keys(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#255 + def member?(*_arg0, **_arg1, &_arg2); end + + # Returns a new `ActionController::Parameters` instance with all keys from + # `other_hash` merged into current hash. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1011 + def merge(other_hash); end + + # :call-seq: merge!(other_hash) + # + # Returns the current `ActionController::Parameters` instance with `other_hash` + # merged into current hash. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1022 + def merge!(other_hash, &block); end + + # Returns a new `ActionController::Parameters` instance that includes only the + # given `filters` and sets the `permitted` attribute for the object to `true`. + # This is useful for limiting which attributes should be allowed for mass + # updating. + # + # params = ActionController::Parameters.new(name: "Francesco", age: 22, role: "admin") + # permitted = params.permit(:name, :age) + # permitted.permitted? # => true + # permitted.has_key?(:name) # => true + # permitted.has_key?(:age) # => true + # permitted.has_key?(:role) # => false + # + # Only permitted scalars pass the filter. For example, given + # + # params.permit(:name) + # + # `:name` passes if it is a key of `params` whose associated value is of type + # `String`, `Symbol`, `NilClass`, `Numeric`, `TrueClass`, `FalseClass`, `Date`, + # `Time`, `DateTime`, `StringIO`, `IO`, ActionDispatch::Http::UploadedFile or + # `Rack::Test::UploadedFile`. Otherwise, the key `:name` is filtered out. + # + # You may declare that the parameter should be an array of permitted scalars by + # mapping it to an empty array: + # + # params = ActionController::Parameters.new(tags: ["rails", "parameters"]) + # params.permit(tags: []) + # + # Sometimes it is not possible or convenient to declare the valid keys of a hash + # parameter or its internal structure. Just map to an empty hash: + # + # params.permit(preferences: {}) + # + # Be careful because this opens the door to arbitrary input. In this case, + # `permit` ensures values in the returned structure are permitted scalars and + # filters out anything else. + # + # You can also use `permit` on nested parameters: + # + # params = ActionController::Parameters.new({ + # person: { + # name: "Francesco", + # age: 22, + # pets: [{ + # name: "Purplish", + # category: "dogs" + # }] + # } + # }) + # + # permitted = params.permit(person: [ :name, { pets: :name } ]) + # permitted.permitted? # => true + # permitted[:person][:name] # => "Francesco" + # permitted[:person][:age] # => nil + # permitted[:person][:pets][0][:name] # => "Purplish" + # permitted[:person][:pets][0][:category] # => nil + # + # This has the added benefit of rejecting user-modified inputs that send a + # string when a hash is expected. + # + # When followed by `require`, you can both filter and require parameters + # following the typical pattern of a Rails form. The `expect` method was + # made specifically for this use case and is the recommended way to require + # and permit parameters. + # + # permitted = params.expect(person: [:name, :age]) + # + # When using `permit` and `require` separately, pay careful attention to the + # order of the method calls. + # + # params = ActionController::Parameters.new(person: { name: "Martin", age: 40, role: "admin" }) + # permitted = params.permit(person: [:name, :age]).require(:person) # correct + # + # When require is used first, it is possible for users of your application to + # trigger a NoMethodError when the user, for example, sends a string for :person. + # + # params = ActionController::Parameters.new(person: "tampered") + # permitted = params.require(:person).permit(:name, :age) # not recommended + # # => NoMethodError: undefined method `permit' for an instance of String + # + # Note that if you use `permit` in a key that points to a hash, it won't allow + # all the hash. You also need to specify which attributes inside the hash should + # be permitted. + # + # params = ActionController::Parameters.new({ + # person: { + # contact: { + # email: "none@test.com", + # phone: "555-1234" + # } + # } + # }) + # + # params.permit(person: :contact).require(:person) + # # => ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # params.permit(person: { contact: :phone }).require(:person) + # # => ##"555-1234"} permitted: true>} permitted: true> + # + # params.permit(person: { contact: [ :email, :phone ] }).require(:person) + # # => ##"none@test.com", "phone"=>"555-1234"} permitted: true>} permitted: true> + # + # If your parameters specify multiple parameters indexed by a number, you can + # permit each set of parameters under the numeric key to be the same using the + # same syntax as permitting a single item. + # + # params = ActionController::Parameters.new({ + # person: { + # '0': { + # email: "none@test.com", + # phone: "555-1234" + # }, + # '1': { + # email: "nothing@test.com", + # phone: "555-6789" + # }, + # } + # }) + # params.permit(person: [:email]).to_h + # # => {"person"=>{"0"=>{"email"=>"none@test.com"}, "1"=>{"email"=>"nothing@test.com"}}} + # + # If you want to specify what keys you want from each numeric key, you can + # instead specify each one individually + # + # params = ActionController::Parameters.new({ + # person: { + # '0': { + # email: "none@test.com", + # phone: "555-1234" + # }, + # '1': { + # email: "nothing@test.com", + # phone: "555-6789" + # }, + # } + # }) + # params.permit(person: { '0': [:email], '1': [:phone]}).to_h + # # => {"person"=>{"0"=>{"email"=>"none@test.com"}, "1"=>{"phone"=>"555-6789"}}} + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#668 + def permit(*filters); end + + # Sets the `permitted` attribute to `true`. This can be used to pass mass + # assignment. Returns `self`. + # + # class Person < ActiveRecord::Base + # end + # + # params = ActionController::Parameters.new(name: "Francesco") + # params.permitted? # => false + # Person.new(params) # => ActiveModel::ForbiddenAttributesError + # params.permit! + # params.permitted? # => true + # Person.new(params) # => # + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#461 + def permit!; end + + # Returns `true` if the parameter is permitted, `false` otherwise. + # + # params = ActionController::Parameters.new + # params.permitted? # => false + # params.permit! + # params.permitted? # => true + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#445 + def permitted?; end + + # Returns a new `ActionController::Parameters` instance with items that the + # block evaluates to true removed. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#961 + def reject(&block); end + + # Removes items that the block evaluates to true and returns self. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#966 + def reject!(&block); end + + # This method accepts both a single key and an array of keys. + # + # When passed a single key, if it exists and its associated value is either + # present or the singleton `false`, returns said value: + # + # ActionController::Parameters.new(person: { name: "Francesco" }).require(:person) + # # => #"Francesco"} permitted: false> + # + # Otherwise raises ActionController::ParameterMissing: + # + # ActionController::Parameters.new.require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # ActionController::Parameters.new(person: nil).require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # ActionController::Parameters.new(person: "\t").require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # ActionController::Parameters.new(person: {}).require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # When given an array of keys, the method tries to require each one of them in + # order. If it succeeds, an array with the respective return values is returned: + # + # params = ActionController::Parameters.new(user: { ... }, profile: { ... }) + # user_params, profile_params = params.require([:user, :profile]) + # + # Otherwise, the method re-raises the first exception found: + # + # params = ActionController::Parameters.new(user: {}, profile: {}) + # user_params, profile_params = params.require([:user, :profile]) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: user + # + # This method is not recommended for fetching terminal values because it does + # not permit the values. For example, this can cause problems: + # + # # CAREFUL + # params = ActionController::Parameters.new(person: { name: "Finn" }) + # name = params.require(:person).require(:name) # CAREFUL + # + # It is recommended to use `expect` instead: + # + # def person_params + # params.expect(person: :name).require(:name) + # end + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#519 + def require(key); end + + # This method accepts both a single key and an array of keys. + # + # When passed a single key, if it exists and its associated value is either + # present or the singleton `false`, returns said value: + # + # ActionController::Parameters.new(person: { name: "Francesco" }).require(:person) + # # => #"Francesco"} permitted: false> + # + # Otherwise raises ActionController::ParameterMissing: + # + # ActionController::Parameters.new.require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # ActionController::Parameters.new(person: nil).require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # ActionController::Parameters.new(person: "\t").require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # ActionController::Parameters.new(person: {}).require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: person + # + # When given an array of keys, the method tries to require each one of them in + # order. If it succeeds, an array with the respective return values is returned: + # + # params = ActionController::Parameters.new(user: { ... }, profile: { ... }) + # user_params, profile_params = params.require([:user, :profile]) + # + # Otherwise, the method re-raises the first exception found: + # + # params = ActionController::Parameters.new(user: {}, profile: {}) + # user_params, profile_params = params.require([:user, :profile]) + # # ActionController::ParameterMissing: param is missing or the value is empty or invalid: user + # + # This method is not recommended for fetching terminal values because it does + # not permit the values. For example, this can cause problems: + # + # # CAREFUL + # params = ActionController::Parameters.new(person: { name: "Finn" }) + # name = params.require(:person).require(:name) # CAREFUL + # + # It is recommended to use `expect` instead: + # + # def person_params + # params.expect(person: :name).require(:name) + # end + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#529 + def required(key); end + + # Returns a new `ActionController::Parameters` instance with all keys from + # current hash merged into `other_hash`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1033 + def reverse_merge(other_hash); end + + # Returns the current `ActionController::Parameters` instance with current hash + # merged into `other_hash`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1042 + def reverse_merge!(other_hash); end + + # Returns a new `ActionController::Parameters` instance with only items that the + # block evaluates to true. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#948 + def select(&block); end + + # Equivalent to Hash#keep_if, but returns `nil` if no changes were made. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#953 + def select!(&block); end + + # Returns a new `ActionController::Parameters` instance that includes only the + # given `keys`. If the given `keys` don't exist, returns an empty hash. + # + # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) + # params.slice(:a, :b) # => #1, "b"=>2} permitted: false> + # params.slice(:d) # => # + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#852 + def slice(*keys); end + + # Returns the current `ActionController::Parameters` instance which contains + # only the given `keys`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#858 + def slice!(*keys); end + + # This is required by ActiveModel attribute assignment, so that user can pass + # `Parameters` to a mass assignment methods in a model. It should not matter as + # we are using `HashWithIndifferentAccess` internally. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1051 + def stringify_keys; end + + # Returns a safe ActiveSupport::HashWithIndifferentAccess representation of the + # parameters with all unpermitted keys removed. + # + # params = ActionController::Parameters.new({ + # name: "Senjougahara Hitagi", + # oddity: "Heavy stone crab" + # }) + # params.to_h + # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash + # + # safe_params = params.permit(:name) + # safe_params.to_h # => {"name"=>"Senjougahara Hitagi"} + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#331 + def to_h(&block); end + + # Returns a safe `Hash` representation of the parameters with all unpermitted + # keys removed. + # + # params = ActionController::Parameters.new({ + # name: "Senjougahara Hitagi", + # oddity: "Heavy stone crab" + # }) + # params.to_hash + # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash + # + # safe_params = params.permit(:name) + # safe_params.to_hash # => {"name"=>"Senjougahara Hitagi"} + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#351 + def to_hash; end + + # Returns a string representation of the receiver suitable for use as a URL + # query string: + # + # params = ActionController::Parameters.new({ + # name: "David", + # nationality: "Danish" + # }) + # params.to_query + # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash + # + # safe_params = params.permit(:name, :nationality) + # safe_params.to_query + # # => "name=David&nationality=Danish" + # + # An optional namespace can be passed to enclose key names: + # + # params = ActionController::Parameters.new({ + # name: "David", + # nationality: "Danish" + # }) + # safe_params = params.permit(:name, :nationality) + # safe_params.to_query("user") + # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" + # + # The string pairs `"key=value"` that conform the query string are sorted + # lexicographically in ascending order. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#384 + def to_param(*args); end + + # Returns a string representation of the receiver suitable for use as a URL + # query string: + # + # params = ActionController::Parameters.new({ + # name: "David", + # nationality: "Danish" + # }) + # params.to_query + # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash + # + # safe_params = params.permit(:name, :nationality) + # safe_params.to_query + # # => "name=David&nationality=Danish" + # + # An optional namespace can be passed to enclose key names: + # + # params = ActionController::Parameters.new({ + # name: "David", + # nationality: "Danish" + # }) + # safe_params = params.permit(:name, :nationality) + # safe_params.to_query("user") + # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" + # + # The string pairs `"key=value"` that conform the query string are sorted + # lexicographically in ascending order. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#381 + def to_query(*args); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#250 + def to_s(*_arg0, **_arg1, &_arg2); end + + # Returns an unsafe, unfiltered ActiveSupport::HashWithIndifferentAccess + # representation of the parameters. + # + # params = ActionController::Parameters.new({ + # name: "Senjougahara Hitagi", + # oddity: "Heavy stone crab" + # }) + # params.to_unsafe_h + # # => {"name"=>"Senjougahara Hitagi", "oddity" => "Heavy stone crab"} + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#395 + def to_unsafe_h; end + + # Returns an unsafe, unfiltered ActiveSupport::HashWithIndifferentAccess + # representation of the parameters. + # + # params = ActionController::Parameters.new({ + # name: "Senjougahara Hitagi", + # oddity: "Heavy stone crab" + # }) + # params.to_unsafe_h + # # => {"name"=>"Senjougahara Hitagi", "oddity" => "Heavy stone crab"} + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#398 + def to_unsafe_hash; end + + # Returns a new `ActionController::Parameters` instance with the results of + # running `block` once for every key. The values are unchanged. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#906 + def transform_keys(&block); end + + # Performs keys transformation and returns the altered + # `ActionController::Parameters` instance. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#915 + def transform_keys!(&block); end + + # Returns a new `ActionController::Parameters` instance with the results of + # running `block` once for every value. The keys are unchanged. + # + # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) + # params.transform_values { |x| x * 2 } + # # => #2, "b"=>4, "c"=>6} permitted: false> + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#889 + def transform_values; end + + # Performs values transformation and returns the altered + # `ActionController::Parameters` instance. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#898 + def transform_values!; end + + # Returns true if the given value is present for some key in the parameters. + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1001 + def value?(value); end + + # Returns a new array of the values of the parameters. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#424 + def values; end + + # Returns values that were assigned to the given `keys`. Note that all the + # `Hash` objects will be converted to `ActionController::Parameters`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1005 + def values_at(*keys); end + + # Returns a new `ActionController::Parameters` instance with all keys from + # current hash merged into `other_hash`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1038 + def with_defaults(other_hash); end + + # Returns the current `ActionController::Parameters` instance with current hash + # merged into `other_hash`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1046 + def with_defaults!(other_hash); end + + # Returns a new `ActionController::Parameters` instance that filters out the + # given `keys`. + # + # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) + # params.except(:a, :b) # => #3} permitted: false> + # params.except(:d) # => #1, "b"=>2, "c"=>3} permitted: false> + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#872 + def without(*keys); end + + protected + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1123 + def each_nested_attribute; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1119 + def nested_attributes?; end + + # Returns the value of attribute parameters. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1115 + def parameters; end + + # Filters self and optionally checks for unpermitted keys + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1130 + def permit_filters(filters, on_unpermitted: T.unsafe(nil), explicit_arrays: T.unsafe(nil)); end + + # Sets the attribute permitted + # + # @param value the value to set the attribute permitted to. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1117 + def permitted=(_arg0); end + + private + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1192 + def _deep_transform_keys_in_object(object, &block); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1211 + def _deep_transform_keys_in_object!(object, &block); end + + # When an array is expected, you must specify an array explicitly + # using the following format: + # + # params.expect(comments: [[:flavor]]) + # + # Which will match only the following array formats: + # + # { pies: [{ flavor: "rhubarb" }, { flavor: "apple" }] } + # { pies: { "0" => { flavor: "key lime" }, "1" => { flavor: "mince" } } } + # + # When using `permit`, arrays are specified the same way as hashes: + # + # params.expect(pies: [:flavor]) + # + # In this case, `permit` would also allow matching with a hash (or vice versa): + # + # { pies: { flavor: "cherry" } } + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1256 + def array_filter?(filter); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1172 + def convert_hashes_to_parameters(key, value); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1156 + def convert_parameters_to_hashes(value, using, &block); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1178 + def convert_value_to_parameters(value); end + + # Called when an explicit array filter is encountered. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1261 + def each_array_element(object, filter, &block); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1349 + def hash_filter(params, filter, on_unpermitted: T.unsafe(nil), explicit_arrays: T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1434 + def initialize_copy(source); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1150 + def new_instance_with_inherited_permitted_status(hash); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1343 + def non_scalar?(value); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1417 + def permit_any_in_array(array); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1400 + def permit_any_in_parameters(params); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1379 + def permit_array_of_hashes(value, filter, on_unpermitted:, explicit_arrays:); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1375 + def permit_array_of_scalars(value); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1385 + def permit_hash(value, filter, on_unpermitted:, explicit_arrays:); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1395 + def permit_hash_or_array(value, filter, on_unpermitted:, explicit_arrays:); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1361 + def permit_value(value, filter, on_unpermitted:, explicit_arrays:); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1314 + def permitted_scalar?(value); end + + # Adds existing keys to the params if their values are scalar. + # + # For example: + # + # puts self.keys #=> ["zipcode(90210i)"] + # params = {} + # + # permitted_scalar_filter(params, "zipcode") + # + # puts params.keys # => ["zipcode"] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1328 + def permitted_scalar_filter(params, permitted_key); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1232 + def specify_numeric_keys?(filter); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1286 + def unpermitted_keys(params); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1272 + def unpermitted_parameters!(params, on_unpermitted: T.unsafe(nil)); end + + class << self + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#165 + def action_on_unpermitted_parameters; end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#165 + def action_on_unpermitted_parameters=(val); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#263 + def always_permitted_parameters; end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#263 + def always_permitted_parameters=(val); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1059 + def hook_into_yaml_loading; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#266 + def nested_attribute?(key, value); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#163 + def permit_all_parameters; end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#163 + def permit_all_parameters=(val); end + end +end + +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#1347 +ActionController::Parameters::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#1348 +ActionController::Parameters::EMPTY_HASH = T.let(T.unsafe(nil), Hash) + +# This is a list of permitted scalar types that includes the ones supported in +# XML and JSON requests. +# +# This list is in particular used to filter ordinary requests, String goes as +# first element to quickly short-circuit the common case. +# +# If you modify this collection please update the one in the #permit doc as +# well. +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#1298 +ActionController::Parameters::PERMITTED_SCALAR_TYPES = T.let(T.unsafe(nil), Array) + +# # Action Controller Params Wrapper +# +# Wraps the parameters hash into a nested hash. This will allow clients to +# submit requests without having to specify any root elements. +# +# This functionality is enabled by default for JSON, and can be customized by +# setting the format array: +# +# class ApplicationController < ActionController::Base +# wrap_parameters format: [:json, :xml] +# end +# +# You could also turn it on per controller: +# +# class UsersController < ApplicationController +# wrap_parameters format: [:json, :xml, :url_encoded_form, :multipart_form] +# end +# +# If you enable `ParamsWrapper` for `:json` format, instead of having to send +# JSON parameters like this: +# +# {"user": {"name": "Konata"}} +# +# You can send parameters like this: +# +# {"name": "Konata"} +# +# And it will be wrapped into a nested hash with the key name matching the +# controller's name. For example, if you're posting to `UsersController`, your +# new `params` hash will look like this: +# +# {"name" => "Konata", "user" => {"name" => "Konata"}} +# +# You can also specify the key in which the parameters should be wrapped to, and +# also the list of attributes it should wrap by using either `:include` or +# `:exclude` options like this: +# +# class UsersController < ApplicationController +# wrap_parameters :person, include: [:username, :password] +# end +# +# On Active Record models with no `:include` or `:exclude` option set, it will +# only wrap the parameters returned by the class method `attribute_names`. +# +# If you're going to pass the parameters to an `ActiveModel` object (such as +# `User.new(params[:user])`), you might consider passing the model class to the +# method instead. The `ParamsWrapper` will actually try to determine the list of +# attribute names from the model and only wrap those attributes: +# +# class UsersController < ApplicationController +# wrap_parameters Person +# end +# +# You still could pass `:include` and `:exclude` to set the list of attributes +# you want to wrap. +# +# By default, if you don't specify the key in which the parameters would be +# wrapped to, `ParamsWrapper` will actually try to determine if there's a model +# related to it or not. This controller, for example: +# +# class Admin::UsersController < ApplicationController +# end +# +# will try to check if `Admin::User` or `User` model exists, and use it to +# determine the wrapper key respectively. If both models don't exist, it will +# then fall back to use `user` as the key. +# +# To disable this functionality for a controller: +# +# class UsersController < ApplicationController +# wrap_parameters false +# end +# +# source://actionpack//lib/action_controller/metal/params_wrapper.rb#83 +module ActionController::ParamsWrapper + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::ParamsWrapper::ClassMethods + + private + + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#277 + def _extract_parameters(parameters); end + + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#299 + def _perform_parameter_wrapping; end + + # Returns the list of parameters which will be selected for wrapped. + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#273 + def _wrap_parameters(parameters); end + + # Checks if we should perform parameters wrapping. + # + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#289 + def _wrapper_enabled?; end + + # Returns the list of enabled formats. + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#268 + def _wrapper_formats; end + + # Returns the wrapper key which will be used to store wrapped parameters. + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#263 + def _wrapper_key; end + + # Performs parameters wrapping upon the request. Called automatically by the + # metal call stack. + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#257 + def process_action(*_arg0); end + + module GeneratedClassMethods + def _wrapper_options; end + def _wrapper_options=(value); end + def _wrapper_options?; end + end + + module GeneratedInstanceMethods + def _wrapper_options; end + def _wrapper_options=(value); end + def _wrapper_options?; end + end +end + +# source://actionpack//lib/action_controller/metal/params_wrapper.rb#188 +module ActionController::ParamsWrapper::ClassMethods + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#189 + def _set_wrapper_options(options); end + + # Sets the default wrapper key or model which will be used to determine wrapper + # key and attribute names. Called automatically when the module is inherited. + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#244 + def inherited(klass); end + + # Sets the name of the wrapper key, or the model which `ParamsWrapper` would use + # to determine the attribute names from. + # + # #### Examples + # wrap_parameters format: :xml + # # enables the parameter wrapper for XML format + # + # wrap_parameters :person + # # wraps parameters into params[:person] hash + # + # wrap_parameters Person + # # wraps parameters by determining the wrapper key from Person class + # # (:person, in this case) and the list of attribute names + # + # wrap_parameters include: [:username, :title] + # # wraps only :username and :title attributes from parameters. + # + # wrap_parameters false + # # disables parameters wrapping for this controller altogether. + # + # #### Options + # * `:format` - The list of formats in which the parameters wrapper will be + # enabled. + # * `:include` - The list of attribute names which parameters wrapper will + # wrap into a nested hash. + # * `:exclude` - The list of attribute names which parameters wrapper will + # exclude from a nested hash. + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#221 + def wrap_parameters(name_or_model_or_options, options = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_controller/metal/params_wrapper.rb#86 +ActionController::ParamsWrapper::EXCLUDE_PARAMETERS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_controller/metal/params_wrapper.rb#88 +class ActionController::ParamsWrapper::Options < ::Struct + # @return [Options] a new instance of Options + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#97 + def initialize(name, format, include, exclude, klass, model); end + + # Returns the value of attribute include + # + # @return [Object] the current value of include + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#108 + def include; end + + # Returns the value of attribute model + # + # @return [Object] the current value of model + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#104 + def model; end + + # Returns the value of attribute name + # + # @return [Object] the current value of name + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#141 + def name; end + + private + + # Determine the wrapper model from the controller's name. By convention, this + # could be done by trying to find the defined model that has the same singular + # name as the controller. For example, `UsersController` will try to find if the + # `User` model exists. + # + # This method also does namespace lookup. Foo::Bar::UsersController will try to + # find Foo::Bar::User, Foo::User and finally User. + # + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#165 + def _default_wrap_model; end + + class << self + # source://actionpack//lib/action_controller/metal/params_wrapper.rb#89 + def from_hash(hash); end + end +end + +# source://actionpack//lib/action_controller/metal/permissions_policy.rb#6 +module ActionController::PermissionsPolicy + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::PermissionsPolicy::ClassMethods +end + +# source://actionpack//lib/action_controller/metal/permissions_policy.rb#9 +module ActionController::PermissionsPolicy::ClassMethods + # Overrides parts of the globally configured `Feature-Policy` header: + # + # class PagesController < ApplicationController + # permissions_policy do |policy| + # policy.geolocation "https://example.com" + # end + # end + # + # Options can be passed similar to `before_action`. For example, pass `only: + # :index` to override the header on the index action only: + # + # class PagesController < ApplicationController + # permissions_policy(only: :index) do |policy| + # policy.camera :self + # end + # end + # + # Requires a global policy defined in an initializer, which can be + # empty: + # + # Rails.application.config.permissions_policy do |policy| + # # policy.gyroscope :none + # end + # + # source://actionpack//lib/action_controller/metal/permissions_policy.rb#33 + def permissions_policy(**options, &block); end +end + +# source://actionpack//lib/action_controller/railtie.rb#13 +class ActionController::Railtie < ::Rails::Railtie; end + +# source://actionpack//lib/action_controller/railties/helpers.rb#6 +module ActionController::Railties; end + +# source://actionpack//lib/action_controller/railties/helpers.rb#7 +module ActionController::Railties::Helpers + # source://actionpack//lib/action_controller/railties/helpers.rb#8 + def inherited(klass); end +end + +# source://actionpack//lib/action_controller/metal/rate_limiting.rb#6 +module ActionController::RateLimiting + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::RateLimiting::ClassMethods + + private + + # source://actionpack//lib/action_controller/metal/rate_limiting.rb#72 + def rate_limiting(to:, within:, by:, with:, store:, name:, scope:); end +end + +# source://actionpack//lib/action_controller/metal/rate_limiting.rb#9 +module ActionController::RateLimiting::ClassMethods + # Applies a rate limit to all actions or those specified by the normal + # `before_action` filters with `only:` and `except:`. + # + # The maximum number of requests allowed is specified `to:` and constrained to + # the window of time given by `within:`. + # + # Rate limits are by default unique to the ip address making the request, but + # you can provide your own identity function by passing a callable in the `by:` + # parameter. It's evaluated within the context of the controller processing the + # request. + # + # By default, rate limits are scoped to the controller's path. If you want to + # share rate limits across multiple controllers, you can provide your own scope, + # by passing value in the `scope:` parameter. + # + # Requests that exceed the rate limit will raise an `ActionController::TooManyRequests` + # error. By default, Action Dispatch will rescue from the error and refuse the request + # with a `429 Too Many Requests` response. You can specialize this by passing a callable in the `with:` + # parameter. It's evaluated within the context of the controller processing the + # request. + # + # Rate limiting relies on a backing `ActiveSupport::Cache` store and defaults to + # `config.action_controller.cache_store`, which itself defaults to the global + # `config.cache_store`. If you don't want to store rate limits in the same + # datastore as your general caches, you can pass a custom store in the `store` + # parameter. + # + # If you want to use multiple rate limits per controller, you need to give each of + # them an explicit name via the `name:` option. + # + # Examples: + # + # class SessionsController < ApplicationController + # rate_limit to: 10, within: 3.minutes, only: :create + # end + # + # class SignupsController < ApplicationController + # rate_limit to: 1000, within: 10.seconds, + # by: -> { request.domain }, with: :redirect_to_busy, only: :new + # + # private + # def redirect_to_busy + # redirect_to busy_controller_url, alert: "Too many signups on domain!" + # end + # end + # + # class APIController < ApplicationController + # RATE_LIMIT_STORE = ActiveSupport::Cache::RedisCacheStore.new(url: ENV["REDIS_URL"]) + # rate_limit to: 10, within: 3.minutes, store: RATE_LIMIT_STORE + # rate_limit to: 100, within: 5.minutes, scope: :api_global + # end + # + # class SessionsController < ApplicationController + # rate_limit to: 3, within: 2.seconds, name: "short-term" + # rate_limit to: 10, within: 5.minutes, name: "long-term" + # end + # + # source://actionpack//lib/action_controller/metal/rate_limiting.rb#66 + def rate_limit(to:, within:, by: T.unsafe(nil), with: T.unsafe(nil), store: T.unsafe(nil), name: T.unsafe(nil), scope: T.unsafe(nil), **options); end +end + +# source://actionpack//lib/action_controller/metal/redirecting.rb#6 +module ActionController::Redirecting + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Benchmarkable + include ::AbstractController::Logger + include ::ActionDispatch::Routing::UrlFor + include ::AbstractController::UrlFor + include ::ActionController::UrlFor + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods + mixes_in_class_methods ::ActionController::Redirecting::ClassMethods + + # source://actionpack//lib/action_controller/metal/redirecting.rb#206 + def _compute_redirect_to_location(request, options); end + + # Soft deprecated alias for #redirect_back_or_to where the `fallback_location` + # location is supplied as a keyword argument instead of the first positional + # argument. + # + # source://actionpack//lib/action_controller/metal/redirecting.rb#169 + def redirect_back(fallback_location:, allow_other_host: T.unsafe(nil), **args); end + + # Redirects the browser to the page that issued the request (the referrer) if + # possible, otherwise redirects to the provided default fallback location. + # + # The referrer information is pulled from the HTTP `Referer` (sic) header on the + # request. This is an optional header and its presence on the request is subject + # to browser security settings and user preferences. If the request is missing + # this header, the `fallback_location` will be used. + # + # redirect_back_or_to({ action: "show", id: 5 }) + # redirect_back_or_to @post + # redirect_back_or_to "http://www.rubyonrails.org" + # redirect_back_or_to "/images/screenshot.jpg" + # redirect_back_or_to posts_url + # redirect_back_or_to proc { edit_post_url(@post) } + # redirect_back_or_to '/', allow_other_host: false + # + # #### Options + # * `:allow_other_host` - Allow or disallow redirection to the host that is + # different to the current host, defaults to true. + # + # + # All other options that can be passed to #redirect_to are accepted as options, + # and the behavior is identical. + # + # source://actionpack//lib/action_controller/metal/redirecting.rb#196 + def redirect_back_or_to(fallback_location, allow_other_host: T.unsafe(nil), **options); end + + # Redirects the browser to the target specified in `options`. This parameter can + # be any one of: + # + # * `Hash` - The URL will be generated by calling url_for with the `options`. + # * `Record` - The URL will be generated by calling url_for with the + # `options`, which will reference a named URL for that record. + # * `String` starting with `protocol://` (like `http://`) or a protocol + # relative reference (like `//`) - Is passed straight through as the target + # for redirection. + # * `String` not containing a protocol - The current protocol and host is + # prepended to the string. + # * `Proc` - A block that will be executed in the controller's context. Should + # return any option accepted by `redirect_to`. + # + # + # ### Examples + # + # redirect_to action: "show", id: 5 + # redirect_to @post + # redirect_to "http://www.rubyonrails.org" + # redirect_to "/images/screenshot.jpg" + # redirect_to posts_url + # redirect_to proc { edit_post_url(@post) } + # + # The redirection happens as a `302 Found` header unless otherwise specified + # using the `:status` option: + # + # redirect_to post_url(@post), status: :found + # redirect_to action: 'atom', status: :moved_permanently + # redirect_to post_url(@post), status: 301 + # redirect_to action: 'atom', status: 302 + # + # The status code can either be a standard [HTTP Status + # code](https://www.iana.org/assignments/http-status-codes) as an integer, or a + # symbol representing the downcased, underscored and symbolized description. + # Note that the status code must be a 3xx HTTP code, or redirection will not + # occur. + # + # If you are using XHR requests other than GET or POST and redirecting after the + # request then some browsers will follow the redirect using the original request + # method. This may lead to undesirable behavior such as a double DELETE. To work + # around this you can return a `303 See Other` status code which will be + # followed using a GET request. + # + # redirect_to posts_url, status: :see_other + # redirect_to action: 'index', status: 303 + # + # It is also possible to assign a flash message as part of the redirection. + # There are two special accessors for the commonly used flash names `alert` and + # `notice` as well as a general purpose `flash` bucket. + # + # redirect_to post_url(@post), alert: "Watch it, mister!" + # redirect_to post_url(@post), status: :found, notice: "Pay attention to the road" + # redirect_to post_url(@post), status: 301, flash: { updated_post_id: @post.id } + # redirect_to({ action: 'atom' }, alert: "Something serious happened") + # + # Statements after `redirect_to` in our controller get executed, so + # `redirect_to` doesn't stop the execution of the function. To terminate the + # execution of the function immediately after the `redirect_to`, use return. + # + # redirect_to post_url(@post) and return + # + # ### Open Redirect protection + # + # By default, Rails protects against redirecting to external hosts for your + # app's safety, so called open redirects. + # + # Here #redirect_to automatically validates the potentially-unsafe URL: + # + # redirect_to params[:redirect_url] + # + # The `action_on_open_redirect` configuration option controls the behavior when an unsafe + # redirect is detected: + # * `:log` - Logs a warning but allows the redirect + # * `:notify` - Sends an Active Support notification for monitoring + # * `:raise` - Raises an UnsafeRedirectError + # + # To allow any external redirects pass `allow_other_host: true`, though using a + # user-provided param in that case is unsafe. + # + # redirect_to "https://rubyonrails.org", allow_other_host: true + # + # See #url_from for more information on what an internal and safe URL is, or how + # to fall back to an alternate redirect URL in the unsafe case. + # + # ### Path Relative URL Redirect Protection + # + # Rails also protects against potentially unsafe path relative URL redirects that don't + # start with a leading slash. These can create security vulnerabilities: + # + # redirect_to "example.com" # Creates http://yourdomain.comexample.com + # redirect_to "@attacker.com" # Creates http://yourdomain.com@attacker.com + # # which browsers interpret as user@host + # + # You can configure how Rails handles these cases using: + # + # config.action_controller.action_on_path_relative_redirect = :log # default + # config.action_controller.action_on_path_relative_redirect = :notify + # config.action_controller.action_on_path_relative_redirect = :raise + # + # * `:log` - Logs a warning but allows the redirect + # * `:notify` - Sends an Active Support notification but allows the redirect + # (includes stack trace to help identify the source) + # * `:raise` - Raises an UnsafeRedirectError + # + # @raise [ActionControllerError] + # + # source://actionpack//lib/action_controller/metal/redirecting.rb#150 + def redirect_to(options = T.unsafe(nil), response_options = T.unsafe(nil)); end + + # Verifies the passed `location` is an internal URL that's safe to redirect to + # and returns it, or nil if not. Useful to wrap a params provided redirect URL + # and fall back to an alternate URL to redirect to: + # + # redirect_to url_from(params[:redirect_url]) || root_url + # + # The `location` is considered internal, and safe, if it's on the same host as + # `request.host`: + # + # # If request.host is example.com: + # url_from("https://example.com/profile") # => "https://example.com/profile" + # url_from("http://example.com/profile") # => "http://example.com/profile" + # url_from("http://evil.com/profile") # => nil + # + # Subdomains are considered part of the host: + # + # # If request.host is on https://example.com or https://app.example.com, you'd get: + # url_from("https://dev.example.com/profile") # => nil + # + # NOTE: there's a similarity with + # [url_for](rdoc-ref:ActionDispatch::Routing::UrlFor#url_for), which generates + # an internal URL from various options from within the app, e.g. + # `url_for(@post)`. However, #url_from is meant to take an external parameter to + # verify as in `url_from(params[:redirect_url])`. + # + # source://actionpack//lib/action_controller/metal/redirecting.rb#254 + def url_from(location); end + + private + + # source://actionpack//lib/action_controller/metal/redirecting.rb#260 + def _allow_other_host; end + + # source://actionpack//lib/action_controller/metal/redirecting.rb#276 + def _enforce_open_redirect_protection(location, allow_other_host:); end + + # source://actionpack//lib/action_controller/metal/redirecting.rb#317 + def _ensure_url_is_http_header_safe(url); end + + # source://actionpack//lib/action_controller/metal/redirecting.rb#266 + def _extract_redirect_to_status(options, response_options); end + + # source://actionpack//lib/action_controller/metal/redirecting.rb#327 + def _handle_path_relative_redirect(url); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/metal/redirecting.rb#304 + def _url_host_allowed?(url); end + + class << self + # source://actionpack//lib/action_controller/metal/redirecting.rb#227 + def _compute_redirect_to_location(request, options); end + end + + module GeneratedClassMethods + def _allowed_redirect_hosts; end + def _allowed_redirect_hosts=(value); end + def allowed_redirect_hosts_permissions; end + def allowed_redirect_hosts_permissions=(value); end + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end + +# source://actionpack//lib/action_controller/metal/redirecting.rb#36 +module ActionController::Redirecting::ClassMethods + # source://actionpack//lib/action_controller/metal/redirecting.rb#37 + def allowed_redirect_hosts=(hosts); end +end + +# source://actionpack//lib/action_controller/metal/redirecting.rb#26 +ActionController::Redirecting::ILLEGAL_HEADER_VALUE_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_controller/metal/redirecting.rb#14 +class ActionController::Redirecting::OpenRedirectError < ::ActionController::Redirecting::UnsafeRedirectError + # @return [OpenRedirectError] a new instance of OpenRedirectError + # + # source://actionpack//lib/action_controller/metal/redirecting.rb#15 + def initialize(location); end +end + +# source://actionpack//lib/action_controller/metal/redirecting.rb#20 +class ActionController::Redirecting::PathRelativeRedirectError < ::ActionController::Redirecting::UnsafeRedirectError + # @return [PathRelativeRedirectError] a new instance of PathRelativeRedirectError + # + # source://actionpack//lib/action_controller/metal/redirecting.rb#21 + def initialize(url); end +end + +# source://actionpack//lib/action_controller/metal/redirecting.rb#12 +class ActionController::Redirecting::UnsafeRedirectError < ::StandardError; end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#16 +class ActionController::RenderError < ::ActionController::ActionControllerError; end + +# # Action Controller Renderer +# +# ActionController::Renderer allows you to render arbitrary templates without +# being inside a controller action. +# +# You can get a renderer instance by calling `renderer` on a controller class: +# +# ApplicationController.renderer +# PostsController.renderer +# +# and render a template by calling the #render method: +# +# ApplicationController.renderer.render template: "posts/show", assigns: { post: Post.first } +# PostsController.renderer.render :show, assigns: { post: Post.first } +# +# As a shortcut, you can also call `render` directly on the controller class +# itself: +# +# ApplicationController.render template: "posts/show", assigns: { post: Post.first } +# PostsController.render :show, assigns: { post: Post.first } +# +# source://actionpack//lib/action_controller/renderer.rb#27 +class ActionController::Renderer + # Initializes a new Renderer. + # + # #### Parameters + # + # * `controller` - The controller class to instantiate for rendering. + # * `env` - The Rack env to use for mocking a request when rendering. Entries + # can be typical Rack env keys and values, or they can be any of the + # following, which will be converted appropriately: + # * `:http_host` - The HTTP host for the incoming request. Converts to + # Rack's `HTTP_HOST`. + # * `:https` - Boolean indicating whether the incoming request uses HTTPS. + # Converts to Rack's `HTTPS`. + # * `:method` - The HTTP method for the incoming request, + # case-insensitive. Converts to Rack's `REQUEST_METHOD`. + # * `:script_name` - The portion of the incoming request's URL path that + # corresponds to the application. Converts to Rack's `SCRIPT_NAME`. + # * `:input` - The input stream. Converts to Rack's `rack.input`. + # * `defaults` - Default values for the Rack env. Entries are specified in the + # same format as `env`. `env` will be merged on top of these values. + # `defaults` will be retained when calling #new on a renderer instance. + # + # + # If no `http_host` is specified, the env HTTP host will be derived from the + # routes' `default_url_options`. In this case, the `https` boolean and the + # `script_name` will also be derived from `default_url_options` if they were not + # specified. Additionally, the `https` boolean will fall back to + # `Rails.application.config.force_ssl` if `default_url_options` does not specify + # a `protocol`. + # + # @return [Renderer] a new instance of Renderer + # + # source://actionpack//lib/action_controller/renderer.rb#110 + def initialize(controller, env, defaults); end + + # Returns the value of attribute controller. + # + # source://actionpack//lib/action_controller/renderer.rb#28 + def controller; end + + # source://actionpack//lib/action_controller/renderer.rb#121 + def defaults; end + + # Creates a new renderer using the same controller, but with a new Rack env. + # + # ApplicationController.renderer.new(method: "post") + # + # source://actionpack//lib/action_controller/renderer.rb#72 + def new(env = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/renderer.rb#150 + def normalize_env(env, &_arg1); end + + # Renders a template to a string, just like + # ActionController::Rendering#render_to_string. + # + # source://actionpack//lib/action_controller/renderer.rb#128 + def render(*args); end + + # Renders a template to a string, just like + # ActionController::Rendering#render_to_string. + # + # source://actionpack//lib/action_controller/renderer.rb#137 + def render_to_string(*args); end + + # Creates a new renderer using the same controller, but with the given defaults + # merged on top of the previous defaults. + # + # source://actionpack//lib/action_controller/renderer.rb#78 + def with_defaults(defaults); end + + private + + # source://actionpack//lib/action_controller/renderer.rb#152 + def env_for_request; end + + class << self + # Creates a new renderer using the given controller class. See ::new. + # + # source://actionpack//lib/action_controller/renderer.rb#64 + def for(controller, env = T.unsafe(nil), defaults = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/renderer.rb#35 + def normalize_env(env); end + end +end + +# source://actionpack//lib/action_controller/renderer.rb#30 +ActionController::Renderer::DEFAULTS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_controller/renderer.rb#148 +ActionController::Renderer::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_controller/renderer.rb#140 +ActionController::Renderer::RACK_KEY_TRANSLATION = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_controller/metal/renderers.rb#23 +module ActionController::Renderers + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::Renderers::ClassMethods + mixes_in_class_methods ::ActionController::Renderers::DeprecatedEscapeJsonResponses + + # source://actionpack//lib/action_controller/metal/renderers.rb#158 + def _render_to_body_with_renderer(options); end + + # source://actionpack//lib/action_controller/metal/renderers.rb#89 + def _render_with_renderer_js(js, options); end + + # source://actionpack//lib/action_controller/metal/renderers.rb#89 + def _render_with_renderer_json(json, options); end + + # source://actionpack//lib/action_controller/metal/renderers.rb#89 + def _render_with_renderer_markdown(md, options); end + + # source://actionpack//lib/action_controller/metal/renderers.rb#89 + def _render_with_renderer_xml(xml, options); end + + # Called by `render` in AbstractController::Rendering which sets the return + # value as the `response_body`. + # + # If no renderer is found, `super` returns control to + # `ActionView::Rendering.render_to_body`, if present. + # + # source://actionpack//lib/action_controller/metal/renderers.rb#154 + def render_to_body(options); end + + class << self + # source://actionpack//lib/action_controller/metal/renderers.rb#104 + def _render_with_renderer_method_name(key); end + + # Adds a new renderer to call within controller actions. A renderer is invoked + # by passing its name as an option to AbstractController::Rendering#render. To + # create a renderer pass it a name and a block. The block takes two arguments, + # the first is the value paired with its key and the second is the remaining + # hash of options passed to `render`. + # + # Create a csv renderer: + # + # ActionController::Renderers.add :csv do |obj, options| + # filename = options[:filename] || 'data' + # str = obj.respond_to?(:to_csv) ? obj.to_csv : obj.to_s + # send_data str, type: Mime[:csv], + # disposition: "attachment; filename=#{filename}.csv" + # end + # + # Note that we used [Mime](:csv) for the csv mime type as it comes with Rails. + # For a custom renderer, you'll need to register a mime type with + # `Mime::Type.register`. + # + # To use the csv renderer in a controller action: + # + # def show + # @csvable = Csvable.find(params[:id]) + # respond_to do |format| + # format.html + # format.csv { render csv: @csvable, filename: @csvable.name } + # end + # end + # + # source://actionpack//lib/action_controller/metal/renderers.rb#88 + def add(key, &block); end + + # This method is the opposite of add method. + # + # To remove a csv renderer: + # + # ActionController::Renderers.remove(:csv) + # + # source://actionpack//lib/action_controller/metal/renderers.rb#98 + def remove(key); end + end + + module GeneratedClassMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; end + def escape_json_responses; end + def escape_json_responses=(value); end + def escape_json_responses?; end + end + + module GeneratedInstanceMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; end + end +end + +# Used in ActionController::Base and ActionController::API to include all +# renderers by default. +# +# source://actionpack//lib/action_controller/metal/renderers.rb#51 +module ActionController::Renderers::All + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionController::Renderers + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::Renderers::ClassMethods + mixes_in_class_methods ::ActionController::Renderers::DeprecatedEscapeJsonResponses + + module GeneratedClassMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; end + def escape_json_responses; end + def escape_json_responses=(value); end + def escape_json_responses?; end + end + + module GeneratedInstanceMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; end + end +end + +# source://actionpack//lib/action_controller/metal/renderers.rb#108 +module ActionController::Renderers::ClassMethods + # Adds, by name, a renderer or renderers to the `_renderers` available to call + # within controller actions. + # + # It is useful when rendering from an ActionController::Metal controller or + # otherwise to add an available renderer proc to a specific controller. + # + # Both ActionController::Base and ActionController::API include + # ActionController::Renderers::All, making all renderers available in the + # controller. See Renderers::RENDERERS and Renderers.add. + # + # Since ActionController::Metal controllers cannot render, the controller must + # include AbstractController::Rendering, ActionController::Rendering, and + # ActionController::Renderers, and have at least one renderer. + # + # Rather than including ActionController::Renderers::All and including all + # renderers, you may specify which renderers to include by passing the renderer + # name or names to `use_renderers`. For example, a controller that includes only + # the `:json` renderer (`_render_with_renderer_json`) might look like: + # + # class MetalRenderingController < ActionController::Metal + # include AbstractController::Rendering + # include ActionController::Rendering + # include ActionController::Renderers + # + # use_renderers :json + # + # def show + # render json: record + # end + # end + # + # You must specify a `use_renderer`, else the `controller.renderer` and + # `controller._renderers` will be `nil`, and the action will fail. + # + # source://actionpack//lib/action_controller/metal/renderers.rb#146 + def use_renderer(*args); end + + # Adds, by name, a renderer or renderers to the `_renderers` available to call + # within controller actions. + # + # It is useful when rendering from an ActionController::Metal controller or + # otherwise to add an available renderer proc to a specific controller. + # + # Both ActionController::Base and ActionController::API include + # ActionController::Renderers::All, making all renderers available in the + # controller. See Renderers::RENDERERS and Renderers.add. + # + # Since ActionController::Metal controllers cannot render, the controller must + # include AbstractController::Rendering, ActionController::Rendering, and + # ActionController::Renderers, and have at least one renderer. + # + # Rather than including ActionController::Renderers::All and including all + # renderers, you may specify which renderers to include by passing the renderer + # name or names to `use_renderers`. For example, a controller that includes only + # the `:json` renderer (`_render_with_renderer_json`) might look like: + # + # class MetalRenderingController < ActionController::Metal + # include AbstractController::Rendering + # include ActionController::Rendering + # include ActionController::Renderers + # + # use_renderers :json + # + # def show + # render json: record + # end + # end + # + # You must specify a `use_renderer`, else the `controller.renderer` and + # `controller._renderers` will be `nil`, and the action will fail. + # + # source://actionpack//lib/action_controller/metal/renderers.rb#142 + def use_renderers(*args); end +end + +# source://actionpack//lib/action_controller/metal/renderers.rb#30 +module ActionController::Renderers::DeprecatedEscapeJsonResponses + # source://actionpack//lib/action_controller/metal/renderers.rb#31 + def escape_json_responses=(value); end +end + +# A Set containing renderer names that correspond to available renderer procs. +# Default values are `:json`, `:js`, `:xml`. +# +# source://actionpack//lib/action_controller/metal/renderers.rb#28 +ActionController::Renderers::RENDERERS = T.let(T.unsafe(nil), Set) + +# source://actionpack//lib/action_controller/metal/rendering.rb#6 +module ActionController::Rendering + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::Rendering::ClassMethods + + # Renders a template and assigns the result to `self.response_body`. + # + # If no rendering mode option is specified, the template will be derived from + # the first argument. + # + # render "posts/show" + # # => renders app/views/posts/show.html.erb + # + # # In a PostsController action... + # render :show + # # => renders app/views/posts/show.html.erb + # + # If the first argument responds to `render_in`, the template will be rendered + # by calling `render_in` with the current view context. + # + # class Greeting + # def render_in(view_context) + # view_context.render html: "

Hello, World

" + # end + # + # def format + # :html + # end + # end + # + # render(Greeting.new) + # # => "

Hello, World

" + # + # render(renderable: Greeting.new) + # # => "

Hello, World

" + # + # #### Rendering Mode + # + # `:partial` + # + # render partial: "posts/form", locals: { post: Post.new } + # # => renders app/views/posts/_form.html.erb + # + # `:file` + # unsanitized user input. + # + # render file: "/path/to/some/file" + # # => renders /path/to/some/file + # + # `:inline` + # + # @name = "World" + # render inline: "

Hello, <%= @name %>!

" + # # => renders "

Hello, World!

" + # + # `:body` + # + # render body: "Hello, World!" + # # => renders "Hello, World!" + # + # `:plain` + # + # render plain: "Hello, World!" + # # => renders "Hello, World!" + # + # `:html` + # `text/html`. If the string is not `html_safe?`, performs HTML escaping on + # the string before rendering. + # + # render html: "

Hello, World!

".html_safe + # # => renders "

Hello, World!

" + # + # render html: "

Hello, World!

" + # # => renders "<h1>Hello, World!</h1>" + # + # `:json` + # `application/json`. If the object is not a string, it will be converted to + # JSON by calling `to_json`. + # + # render json: { hello: "world" } + # # => renders "{\"hello\":\"world\"}" + # + # `:renderable` + # context. The response format is determined by calling `format` on the + # renderable if it responds to `format`, falling back to `text/html` by + # default. + # + # render renderable: Greeting.new + # # => renders "

Hello, World

" + # + # + # By default, when a rendering mode is specified, no layout template is + # rendered. + # + # #### Options + # + # `:assigns` + # + # render inline: "

Hello, <%= @name %>!

", assigns: { name: "World" } + # # => renders "

Hello, World!

" + # + # `:locals` + # + # render inline: "

Hello, <%= name %>!

", locals: { name: "World" } + # # => renders "

Hello, World!

" + # + # `:layout` + # (re)enable the default layout template. + # + # render "posts/show", layout: "holiday" + # # => renders app/views/posts/show.html.erb with the app/views/layouts/holiday.html.erb layout + # + # render "posts/show", layout: false + # # => renders app/views/posts/show.html.erb with no layout + # + # render inline: "

Hello, World!

", layout: true + # # => renders "

Hello, World!

" with the default layout + # + # `:status` + # number or as the status name in Symbol form. Defaults to 200. + # + # render "posts/new", status: 422 + # # => renders app/views/posts/new.html.erb with HTTP status code 422 + # + # render "posts/new", status: :unprocessable_entity + # # => renders app/views/posts/new.html.erb with HTTP status code 422 + # + # `:variants` + # + # render "posts/index", variants: [:mobile] + # # => renders app/views/posts/index.html+mobile.erb + # + # -- + # Check for double render errors and set the content_type after rendering. + # + # @raise [::AbstractController::DoubleRenderError] + # + # source://actionpack//lib/action_controller/metal/rendering.rb#171 + def render(*args); end + + # source://actionpack//lib/action_controller/metal/rendering.rb#191 + def render_to_body(options = T.unsafe(nil)); end + + # Similar to #render, but only returns the rendered template as a string, + # instead of setting `self.response_body`. + # -- + # Override render_to_string because body can now be set to a Rack body. + # + # source://actionpack//lib/action_controller/metal/rendering.rb#180 + def render_to_string(*_arg0); end + + private + + # Normalize both text and status options. + # + # source://actionpack//lib/action_controller/metal/rendering.rb#233 + def _normalize_options(options); end + + # source://actionpack//lib/action_controller/metal/rendering.rb#247 + def _normalize_text(options); end + + # Process controller specific options, as status, content-type and location. + # + # source://actionpack//lib/action_controller/metal/rendering.rb#256 + def _process_options(options); end + + # source://actionpack//lib/action_controller/metal/rendering.rb#202 + def _process_variant(options); end + + # source://actionpack//lib/action_controller/metal/rendering.rb#208 + def _render_in_priorities(options); end + + # source://actionpack//lib/action_controller/metal/rendering.rb#216 + def _set_html_content_type; end + + # source://actionpack//lib/action_controller/metal/rendering.rb#220 + def _set_rendered_content_type(format); end + + # source://actionpack//lib/action_controller/metal/rendering.rb#226 + def _set_vary_header; end + + # Before processing, set the request formats in current controller formats. + # + # source://actionpack//lib/action_controller/metal/rendering.rb#197 + def process_action(*_arg0); end +end + +# source://actionpack//lib/action_controller/metal/rendering.rb#11 +module ActionController::Rendering::ClassMethods + # source://actionpack//lib/action_controller/metal/rendering.rb#23 + def inherited(klass); end + + # source://actionpack//lib/action_controller/metal/rendering.rb#13 + def render(*_arg0, **_arg1, &_arg2); end + + # Returns a renderer instance (inherited from ActionController::Renderer) for + # the controller. + # + # source://actionpack//lib/action_controller/metal/rendering.rb#17 + def renderer; end + + # source://actionpack//lib/action_controller/metal/rendering.rb#19 + def setup_renderer!; end +end + +# source://actionpack//lib/action_controller/metal/rendering.rb#9 +ActionController::Rendering::RENDER_FORMATS_IN_PRIORITY = T.let(T.unsafe(nil), Array) + +# # Action Controller Request Forgery Protection +# +# Controller actions are protected from Cross-Site Request Forgery (CSRF) +# attacks by including a token in the rendered HTML for your application. This +# token is stored as a random string in the session, to which an attacker does +# not have access. When a request reaches your application, Rails verifies the +# received token with the token in the session. All requests are checked except +# GET requests as these should be idempotent. Keep in mind that all +# session-oriented requests are CSRF protected by default, including JavaScript +# and HTML requests. +# +# Since HTML and JavaScript requests are typically made from the browser, we +# need to ensure to verify request authenticity for the web browser. We can use +# session-oriented authentication for these types of requests, by using the +# `protect_from_forgery` method in our controllers. +# +# GET requests are not protected since they don't have side effects like writing +# to the database and don't leak sensitive information. JavaScript requests are +# an exception: a third-party site can use a +# +# The first two characters (`">`) are required in case the exception happens +# while rendering attributes for a given tag. You can check the real cause for +# the exception in your logger. +# +# ## Web server support +# +# Rack 3+ compatible servers all support streaming. +# +# source://actionpack//lib/action_controller/metal/streaming.rb#169 +module ActionController::Streaming + private + + # Call render_body if we are streaming instead of usual `render`. + # + # source://actionpack//lib/action_controller/metal/streaming.rb#172 + def _render_template(options); end +end + +# # Strong Parameters +# +# It provides an interface for protecting attributes from end-user assignment. +# This makes Action Controller parameters forbidden to be used in Active Model +# mass assignment until they have been explicitly enumerated. +# +# In addition, parameters can be marked as required and flow through a +# predefined raise/rescue flow to end up as a `400 Bad Request` with no effort. +# +# class PeopleController < ActionController::Base +# # Using "Person.create(params[:person])" would raise an +# # ActiveModel::ForbiddenAttributesError exception because it'd +# # be using mass assignment without an explicit permit step. +# # This is the recommended form: +# def create +# Person.create(person_params) +# end +# +# # This will pass with flying colors as long as there's a person key in the +# # parameters, otherwise it'll raise an ActionController::ParameterMissing +# # exception, which will get caught by ActionController::Base and turned +# # into a 400 Bad Request reply. +# def update +# redirect_to current_account.people.find(params[:id]).tap { |person| +# person.update!(person_params) +# } +# end +# +# private +# # Using a private method to encapsulate the permissible parameters is +# # a good pattern since you'll be able to reuse the same permit +# # list between create and update. Also, you can specialize this method +# # with per-user checking of permissible attributes. +# def person_params +# params.expect(person: [:name, :age]) +# end +# end +# +# In order to use `accepts_nested_attributes_for` with Strong Parameters, you +# will need to specify which nested attributes should be permitted. You might +# want to allow `:id` and `:_destroy`, see ActiveRecord::NestedAttributes for +# more information. +# +# class Person +# has_many :pets +# accepts_nested_attributes_for :pets +# end +# +# class PeopleController < ActionController::Base +# def create +# Person.create(person_params) +# end +# +# ... +# +# private +# +# def person_params +# # It's mandatory to specify the nested attributes that should be permitted. +# # If you use `permit` with just the key that points to the nested attributes hash, +# # it will return an empty hash. +# params.expect(person: [ :name, :age, pets_attributes: [ :id, :name, :category ] ]) +# end +# end +# +# See ActionController::Parameters.expect, +# See ActionController::Parameters.require, and +# ActionController::Parameters.permit for more information. +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#1508 +module ActionController::StrongParameters + # Returns a new ActionController::Parameters object that has been instantiated + # with the `request.parameters`. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1511 + def params; end + + # Assigns the given `value` to the `params` hash. If `value` is a Hash, this + # will create an ActionController::Parameters object that has been instantiated + # with the given `value` hash. + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#1526 + def params=(value); end +end + +# source://actionpack//lib/action_controller/structured_event_subscriber.rb#4 +class ActionController::StructuredEventSubscriber < ::ActiveSupport::StructuredEventSubscriber + # @return [Boolean] + # + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#91 + def exist_fragment?(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#95 + def expire_fragment(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#43 + def halted_callback(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#25 + def process_action(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#87 + def read_fragment(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#64 + def redirect_to(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#47 + def rescue_from_callback(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#68 + def send_data(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#60 + def send_file(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#7 + def start_processing(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#72 + def unpermitted_parameters(event); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#83 + def write_fragment(event); end + + private + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#110 + def additions_for(payload); end + + # source://actionpack//lib/action_controller/structured_event_subscriber.rb#100 + def fragment_cache(method_name, event); end +end + +# source://actionpack//lib/action_controller/structured_event_subscriber.rb#5 +ActionController::StructuredEventSubscriber::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_controller/template_assertions.rb#6 +module ActionController::TemplateAssertions + # @raise [NoMethodError] + # + # source://actionpack//lib/action_controller/template_assertions.rb#7 + def assert_template(options = T.unsafe(nil), message = T.unsafe(nil)); end +end + +# # Action Controller Test Case +# +# Superclass for ActionController functional tests. Functional tests allow you +# to test a single controller action per test method. +# +# ## Use integration style controller tests over functional style controller tests. +# +# Rails discourages the use of functional tests in favor of integration tests +# (use ActionDispatch::IntegrationTest). +# +# New Rails applications no longer generate functional style controller tests +# and they should only be used for backward compatibility. Integration style +# controller tests perform actual requests, whereas functional style controller +# tests merely simulate a request. Besides, integration tests are as fast as +# functional tests and provide lot of helpers such as `as`, `parsed_body` for +# effective testing of controller actions including even API endpoints. +# +# ## Basic example +# +# Functional tests are written as follows: +# 1. First, one uses the `get`, `post`, `patch`, `put`, `delete`, or `head` +# method to simulate an HTTP request. +# 2. Then, one asserts whether the current state is as expected. "State" can be +# anything: the controller's HTTP response, the database contents, etc. +# +# +# For example: +# +# class BooksControllerTest < ActionController::TestCase +# def test_create +# # Simulate a POST response with the given HTTP parameters. +# post(:create, params: { book: { title: "Love Hina" }}) +# +# # Asserts that the controller tried to redirect us to +# # the created book's URI. +# assert_response :found +# +# # Asserts that the controller really put the book in the database. +# assert_not_nil Book.find_by(title: "Love Hina") +# end +# end +# +# You can also send a real document in the simulated HTTP request. +# +# def test_create +# json = {book: { title: "Love Hina" }}.to_json +# post :create, body: json +# end +# +# ## Special instance variables +# +# ActionController::TestCase will also automatically provide the following +# instance variables for use in the tests: +# +# +# You can modify this object before sending the HTTP request. For example, +# you might want to set some session properties before sending a GET +# request. +# +# last HTTP response. In the above example, `@response` becomes valid after +# calling `post`. If the various assert methods are not sufficient, then you +# may use this object to inspect the HTTP response in detail. +# +# +# ## Controller is automatically inferred +# +# ActionController::TestCase will automatically infer the controller under test +# from the test class name. If the controller cannot be inferred from the test +# class name, you can explicitly set it with `tests`. +# +# class SpecialEdgeCaseWidgetsControllerTest < ActionController::TestCase +# tests WidgetController +# end +# +# ## Testing controller internals +# +# In addition to these specific assertions, you also have easy access to various +# collections that the regular test/unit assertions can be used against. These +# collections are: +# +# * session: Objects being saved in the session. +# * flash: The flash objects currently in the session. +# * cookies: Cookies being sent to the user on this request. +# +# +# These collections can be used just like any other hash: +# +# assert_equal "Dave", cookies[:name] # makes sure that a cookie called :name was set as "Dave" +# assert flash.empty? # makes sure that there's nothing in the flash +# +# On top of the collections, you have the complete URL that a given action +# redirected to available in `redirect_to_url`. +# +# For redirects within the same controller, you can even call follow_redirect +# and the redirect will be followed, triggering another action call which can +# then be asserted against. +# +# ## Manipulating session and cookie variables +# +# Sometimes you need to set up the session and cookie variables for a test. To +# do this just assign a value to the session or cookie collection: +# +# session[:key] = "value" +# cookies[:key] = "value" +# +# To clear the cookies for a test just clear the cookie collection: +# +# cookies.clear +# +# ## Testing named routes +# +# If you're using named routes, they can be easily tested using the original +# named routes' methods straight in the test case. +# +# assert_redirected_to page_url(title: 'foo') +# +# source://actionpack//lib/action_controller/test_case.rb#368 +class ActionController::TestCase < ::ActiveSupport::TestCase + include ::ActiveSupport::Testing::ConstantLookup + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionController::TestCase::Behavior + include ::ActionController::TemplateAssertions + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions + extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods + extend ::ActionController::TestCase::Behavior::ClassMethods + extend ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # source://actionpack//lib/action_controller/test_case.rb#599 + def _controller_class; end + + # source://actionpack//lib/action_controller/test_case.rb#599 + def _controller_class=(_arg0); end + + # source://actionpack//lib/action_controller/test_case.rb#599 + def _controller_class?; end + + # source://actionpack//lib/action_controller/test_case.rb#600 + def _run_setup_callbacks(&block); end + + class << self + # source://actionpack//lib/action_controller/test_case.rb#599 + def _controller_class; end + + # source://actionpack//lib/action_controller/test_case.rb#599 + def _controller_class=(value); end + + # source://actionpack//lib/action_controller/test_case.rb#599 + def _controller_class?; end + + # source://actionpack//lib/action_controller/test_case.rb#369 + def executor_around_each_request; end + + # source://actionpack//lib/action_controller/test_case.rb#369 + def executor_around_each_request=(_arg0); end + + private + + # source://actionpack//lib/action_controller/test_case.rb#600 + def __class_attr___callbacks; end + + # source://actionpack//lib/action_controller/test_case.rb#600 + def __class_attr___callbacks=(new_value); end + + # source://actionpack//lib/action_controller/test_case.rb#599 + def __class_attr__controller_class; end + + # source://actionpack//lib/action_controller/test_case.rb#599 + def __class_attr__controller_class=(new_value); end + end +end + +# source://actionpack//lib/action_controller/test_case.rb#371 +module ActionController::TestCase::Behavior + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Testing::ConstantLookup + include ::ActionController::TemplateAssertions + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods + mixes_in_class_methods ::ActionController::TestCase::Behavior::ClassMethods + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # source://actionpack//lib/action_controller/test_case.rb#592 + def build_response(klass); end + + # source://actionpack//lib/action_controller/test_case.rb#552 + def controller_class_name; end + + # Simulate a DELETE request with the given parameters and set/volley the + # response. See `get` for more details. + # + # source://actionpack//lib/action_controller/test_case.rb#463 + def delete(action, **args); end + + # source://actionpack//lib/action_controller/test_case.rb#556 + def generated_path(generated_extras); end + + # Simulate a GET request with the given parameters. + # + # * `action`: The controller action to call. + # * `params`: The hash with HTTP parameters that you want to pass. This may be + # `nil`. + # * `body`: The request body with a string that is appropriately encoded + # (`application/x-www-form-urlencoded` or `multipart/form-data`). + # * `session`: A hash of parameters to store in the session. This may be + # `nil`. + # * `flash`: A hash of parameters to store in the flash. This may be `nil`. + # + # + # You can also simulate POST, PATCH, PUT, DELETE, and HEAD requests with `post`, + # `patch`, `put`, `delete`, and `head`. Example sending parameters, session, and + # setting a flash message: + # + # get :show, + # params: { id: 7 }, + # session: { user_id: 1 }, + # flash: { notice: 'This is flash message' } + # + # Note that the request method is not verified. The different methods are + # available to make the tests more expressive. + # + # source://actionpack//lib/action_controller/test_case.rb#439 + def get(action, **args); end + + # Simulate a HEAD request with the given parameters and set/volley the response. + # See `get` for more details. + # + # source://actionpack//lib/action_controller/test_case.rb#469 + def head(action, **args); end + + # Simulate a PATCH request with the given parameters and set/volley the + # response. See `get` for more details. + # + # source://actionpack//lib/action_controller/test_case.rb#451 + def patch(action, **args); end + + # Simulate a POST request with the given parameters and set/volley the response. + # See `get` for more details. + # + # source://actionpack//lib/action_controller/test_case.rb#445 + def post(action, **args); end + + # Simulate an HTTP request to `action` by specifying request method, parameters + # and set/volley the response. + # + # * `action`: The controller action to call. + # * `method`: Request method used to send the HTTP request. Possible values + # are `GET`, `POST`, `PATCH`, `PUT`, `DELETE`, `HEAD`. Defaults to `GET`. + # Can be a symbol. + # * `params`: The hash with HTTP parameters that you want to pass. This may be + # `nil`. + # * `body`: The request body with a string that is appropriately encoded + # (`application/x-www-form-urlencoded` or `multipart/form-data`). + # * `session`: A hash of parameters to store in the session. This may be + # `nil`. + # * `flash`: A hash of parameters to store in the flash. This may be `nil`. + # * `format`: Request format. Defaults to `nil`. Can be string or symbol. + # * `as`: Content type. Defaults to `nil`. Must be a symbol that corresponds + # to a mime type. + # + # + # Example calling `create` action and sending two params: + # + # process :create, + # method: 'POST', + # params: { + # user: { name: 'Gaurish Sharma', email: 'user@example.com' } + # }, + # session: { user_id: 1 }, + # flash: { notice: 'This is flash message' } + # + # To simulate `GET`, `POST`, `PATCH`, `PUT`, `DELETE`, and `HEAD` requests + # prefer using #get, #post, #patch, #put, #delete and #head methods respectively + # which will make tests more expressive. + # + # It's not recommended to make more than one request in the same test. Instance + # variables that are set in one request will not persist to the next request, + # but it's not guaranteed that all Rails internal state will be reset. Prefer + # ActionDispatch::IntegrationTest for making multiple requests in the same test. + # + # Note that the request method is not verified. + # + # source://actionpack//lib/action_controller/test_case.rb#512 + def process(action, method: T.unsafe(nil), params: T.unsafe(nil), session: T.unsafe(nil), body: T.unsafe(nil), flash: T.unsafe(nil), format: T.unsafe(nil), xhr: T.unsafe(nil), as: T.unsafe(nil)); end + + # Simulate a PUT request with the given parameters and set/volley the response. + # See `get` for more details. + # + # source://actionpack//lib/action_controller/test_case.rb#457 + def put(action, **args); end + + # source://actionpack//lib/action_controller/test_case.rb#560 + def query_parameter_names(generated_extras); end + + # Returns the value of attribute request. + # + # source://actionpack//lib/action_controller/test_case.rb#377 + def request; end + + # Returns the value of attribute response. + # + # source://actionpack//lib/action_controller/test_case.rb#377 + def response; end + + # source://actionpack//lib/action_controller/test_case.rb#564 + def setup_controller_request_and_response; end + + private + + # source://actionpack//lib/action_controller/test_case.rb#685 + def check_required_ivars; end + + # source://actionpack//lib/action_controller/test_case.rb#681 + def document_root_element; end + + # source://actionpack//lib/action_controller/test_case.rb#635 + def process_controller_response(action, cookies, xhr); end + + # source://actionpack//lib/action_controller/test_case.rb#671 + def scrub_env!(env); end + + # source://actionpack//lib/action_controller/test_case.rb#605 + def setup_request(controller_class_name, action, parameters, session, flash, xhr); end + + # source://actionpack//lib/action_controller/test_case.rb#627 + def wrap_execution(&block); end + + module GeneratedClassMethods + def _controller_class; end + def _controller_class=(value); end + def _controller_class?; end + end + + module GeneratedInstanceMethods + def _controller_class; end + def _controller_class=(value); end + def _controller_class?; end + end +end + +# source://actionpack//lib/action_controller/test_case.rb#379 +module ActionController::TestCase::Behavior::ClassMethods + # source://actionpack//lib/action_controller/test_case.rb#401 + def controller_class; end + + # source://actionpack//lib/action_controller/test_case.rb#397 + def controller_class=(new_class); end + + # source://actionpack//lib/action_controller/test_case.rb#409 + def determine_default_controller_class(name); end + + # Sets the controller class name. Useful if the name can't be inferred from test + # class. Normalizes `controller_class` before using. + # + # tests WidgetController + # tests :widget + # tests 'widget' + # + # source://actionpack//lib/action_controller/test_case.rb#386 + def tests(controller_class); end +end + +# ActionController::TestCase will be deprecated and moved to a gem in the +# future. Please use ActionDispatch::IntegrationTest going forward. +# +# source://actionpack//lib/action_controller/test_case.rb#46 +class ActionController::TestRequest < ::ActionDispatch::TestRequest + # @return [TestRequest] a new instance of TestRequest + # + # source://actionpack//lib/action_controller/test_case.rb#69 + def initialize(env, session, controller_class); end + + # source://actionpack//lib/action_controller/test_case.rb#88 + def assign_parameters(routes, controller_path, action, parameters, generated_path, query_string_keys); end + + # source://actionpack//lib/action_controller/test_case.rb#84 + def content_type=(type); end + + # Returns the value of attribute controller_class. + # + # source://actionpack//lib/action_controller/test_case.rb#54 + def controller_class; end + + # source://actionpack//lib/action_controller/test_case.rb#80 + def query_string=(string); end + + private + + # source://actionpack//lib/action_controller/test_case.rb#179 + def params_parsers; end + + class << self + # Create a new test request with default `env` values. + # + # source://actionpack//lib/action_controller/test_case.rb#57 + def create(controller_class); end + + # source://actionpack//lib/action_controller/test_case.rb#50 + def new_session; end + + private + + # source://actionpack//lib/action_controller/test_case.rb#64 + def default_env; end + end +end + +# source://actionpack//lib/action_controller/test_case.rb#47 +ActionController::TestRequest::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_controller/test_case.rb#151 +ActionController::TestRequest::ENCODER = T.let(T.unsafe(nil), T.untyped) + +# Methods #destroy and #load! are overridden to avoid calling methods on the +# +# source://actionpack//lib/action_controller/test_case.rb#197 +class ActionController::TestSession < ::Rack::Session::Abstract::PersistedSecure::SecureSessionHash + # @return [TestSession] a new instance of TestSession + # + # source://actionpack//lib/action_controller/test_case.rb#200 + def initialize(session = T.unsafe(nil), id = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/test_case.rb#220 + def destroy; end + + # source://actionpack//lib/action_controller/test_case.rb#224 + def dig(*keys); end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/test_case.rb#233 + def enabled?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_controller/test_case.rb#208 + def exists?; end + + # source://actionpack//lib/action_controller/test_case.rb#229 + def fetch(key, *args, &block); end + + # source://actionpack//lib/action_controller/test_case.rb#237 + def id_was; end + + # source://actionpack//lib/action_controller/test_case.rb#212 + def keys; end + + # source://actionpack//lib/action_controller/test_case.rb#216 + def values; end + + private + + # source://actionpack//lib/action_controller/test_case.rb#242 + def load!; end +end + +# source://actionpack//lib/action_controller/test_case.rb#198 +ActionController::TestSession::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_controller/metal/testing.rb#6 +module ActionController::Testing; end + +# Behavior specific to functional tests +# +# source://actionpack//lib/action_controller/metal/testing.rb#8 +module ActionController::Testing::Functional + # source://actionpack//lib/action_controller/metal/testing.rb#9 + def clear_instance_variables_between_requests; end + + # source://actionpack//lib/action_controller/metal/testing.rb#18 + def recycle!; end +end + +# Raised when a Rate Limit is exceeded by too many requests within a period of +# time. +# +# source://actionpack//lib/action_controller/metal/exceptions.rb#109 +class ActionController::TooManyRequests < ::ActionController::ActionControllerError; end + +# Raised when a Parameters instance is not marked as permitted and an operation +# to transform it to hash is called. +# +# params = ActionController::Parameters.new(a: "123", b: "456") +# params.to_h +# # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#74 +class ActionController::UnfilteredParameters < ::ArgumentError + # @return [UnfilteredParameters] a new instance of UnfilteredParameters + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#75 + def initialize; end +end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#75 +class ActionController::UnknownFormat < ::ActionController::ActionControllerError; end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#72 +class ActionController::UnknownHttpMethod < ::ActionController::ActionControllerError; end + +# Raised when a supplied parameter is not expected and +# ActionController::Parameters.action_on_unpermitted_parameters is set to +# `:raise`. +# +# params = ActionController::Parameters.new(a: "123", b: "456") +# params.permit(:c) +# # => ActionController::UnpermittedParameters: found unpermitted parameters: :a, :b +# +# source://actionpack//lib/action_controller/metal/strong_parameters.rb#59 +class ActionController::UnpermittedParameters < ::IndexError + # @return [UnpermittedParameters] a new instance of UnpermittedParameters + # + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#62 + def initialize(params); end + + # source://actionpack//lib/action_controller/metal/strong_parameters.rb#60 + def params; end +end + +# # Action Controller UrlFor +# +# Includes `url_for` into the host class. The class has to provide a `RouteSet` +# by implementing the `_routes` method. Otherwise, an exception will be raised. +# +# In addition to AbstractController::UrlFor, this module accesses the HTTP layer +# to define URL options like the `host`. In order to do so, this module requires +# the host class to implement `env` which needs to be Rack-compatible, and +# `request` which returns an ActionDispatch::Request instance. +# +# class RootUrl +# include ActionController::UrlFor +# include Rails.application.routes.url_helpers +# +# delegate :env, :request, to: :controller +# +# def initialize(controller) +# @controller = controller +# @url = root_path # named route from the application. +# end +# end +# +# source://actionpack//lib/action_controller/metal/url_for.rb#27 +module ActionController::UrlFor + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Routing::UrlFor + include ::AbstractController::UrlFor + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods + + # source://actionpack//lib/action_controller/metal/url_for.rb#32 + def initialize(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_controller/metal/url_for.rb#37 + def url_options; end + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end + +# source://actionpack//lib/action_controller/metal/exceptions.rb#27 +class ActionController::UrlGenerationError < ::ActionController::ActionControllerError + include ::DidYouMean::Correctable + + # @return [UrlGenerationError] a new instance of UrlGenerationError + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#30 + def initialize(message, routes = T.unsafe(nil), route_name = T.unsafe(nil), method_name = T.unsafe(nil)); end + + # source://actionpack//lib/action_controller/metal/exceptions.rb#41 + def corrections; end + + # Returns the value of attribute method_name. + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#28 + def method_name; end + + # Returns the value of attribute route_name. + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#28 + def route_name; end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_controller/metal/exceptions.rb#28 + def routes; end +end + +# # Action Dispatch +# +# Action Dispatch is a module of Action Pack. +# +# Action Dispatch parses information about the web request, handles routing as +# defined by the user, and does advanced processing related to HTTP such as +# MIME-type negotiation, decoding parameters in POST, PATCH, or PUT bodies, +# handling HTTP caching logic, cookies and sessions. +# +# source://actionpack//lib/action_dispatch/deprecator.rb#5 +module ActionDispatch + extend ::ActiveSupport::Autoload + + # source://actionpack//lib/action_dispatch.rb#149 + def eager_load!; end + + # source://actionpack//lib/action_dispatch.rb#127 + def test_app; end + + # source://actionpack//lib/action_dispatch.rb#127 + def test_app=(val); end + + class << self + # source://actionpack//lib/action_dispatch/deprecator.rb#6 + def deprecator; end + + # source://actionpack//lib/action_dispatch.rb#127 + def test_app; end + + # source://actionpack//lib/action_dispatch.rb#127 + def test_app=(val); end + + # source://actionpack//lib/action_dispatch.rb#146 + def verbose_redirect_logs; end + + # source://actionpack//lib/action_dispatch.rb#146 + def verbose_redirect_logs=(_arg0); end + end +end + +# source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#9 +class ActionDispatch::ActionableExceptions + # @return [ActionableExceptions] a new instance of ActionableExceptions + # + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#12 + def initialize(app); end + + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#16 + def call(env); end + + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#10 + def endpoint; end + + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#10 + def endpoint=(val); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#26 + def actionable_request?(request); end + + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#30 + def redirect_to(location); end + + class << self + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#10 + def endpoint; end + + # source://actionpack//lib/action_dispatch/middleware/actionable_exceptions.rb#10 + def endpoint=(val); end + end +end + +# This is a class that abstracts away an asserted response. It purposely does +# not inherit from Response because it doesn't need it. That means it does not +# have headers or a body. +# +# source://actionpack//lib/action_dispatch/testing/assertion_response.rb#9 +class ActionDispatch::AssertionResponse + # Accepts a specific response status code as an Integer (404) or String ('404') + # or a response status range as a Symbol pseudo-code (:success, indicating any + # 200-299 status code). + # + # @raise [ArgumentError] + # @return [AssertionResponse] a new instance of AssertionResponse + # + # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#22 + def initialize(code_or_name); end + + # Returns the value of attribute code. + # + # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#10 + def code; end + + # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#35 + def code_and_name; end + + # Returns the value of attribute name. + # + # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#10 + def name; end + + private + + # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#40 + def code_from_name(name); end + + # source://actionpack//lib/action_dispatch/testing/assertion_response.rb#44 + def name_from_code(code); end +end + +# source://actionpack//lib/action_dispatch/testing/assertion_response.rb#12 +ActionDispatch::AssertionResponse::GENERIC_RESPONSE_CODES = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/testing/assertions/response.rb#6 +module ActionDispatch::Assertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + extend ::ActiveSupport::Concern + include ::ActionDispatch::Assertions::RoutingAssertions + + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # source://actionpack//lib/action_dispatch/testing/assertions.rb#17 + def html_document; end +end + +# A small suite of assertions that test responses from Rails applications. +# +# source://actionpack//lib/action_dispatch/testing/assertions/response.rb#8 +module ActionDispatch::Assertions::ResponseAssertions + # Asserts that the given +text+ is present somewhere in the response body. + # + # assert_in_body fixture(:name).description + # + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#77 + def assert_in_body(text); end + + # Asserts that the given +text+ is not present anywhere in the response body. + # + # assert_not_in_body fixture(:name).description + # + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#84 + def assert_not_in_body(text); end + + # Asserts that the response is a redirect to a URL matching the given options. + # + # # Asserts that the redirection was to the "index" action on the WeblogController + # assert_redirected_to controller: "weblog", action: "index" + # + # # Asserts that the redirection was to the named route login_url + # assert_redirected_to login_url + # + # # Asserts that the redirection was to the URL for @customer + # assert_redirected_to @customer + # + # # Asserts that the redirection matches the regular expression + # assert_redirected_to %r(\Ahttp://example.org) + # + # # Asserts that the redirection has the HTTP status code 301 (Moved + # # Permanently). + # assert_redirected_to "/some/path", status: :moved_permanently + # + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#60 + def assert_redirected_to(url_options = T.unsafe(nil), options = T.unsafe(nil), message = T.unsafe(nil)); end + + # Asserts that the response is one of the following types: + # + # * `:success` - Status code was in the 200-299 range + # * `:redirect` - Status code was in the 300-399 range + # * `:missing` - Status code was 404 + # * `:error` - Status code was in the 500-599 range + # + # + # You can also pass an explicit status number like `assert_response(501)` or its + # symbolic equivalent `assert_response(:not_implemented)`. See + # `Rack::Utils::SYMBOL_TO_STATUS_CODE` for a full list. + # + # # Asserts that the response was a redirection + # assert_response :redirect + # + # # Asserts that the response code was status code 401 (unauthorized) + # assert_response 401 + # + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#33 + def assert_response(type, message = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#129 + def code_with_name(code_or_name); end + + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#118 + def exception_if_present; end + + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#103 + def generate_response_message(expected, actual = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#123 + def location_if_redirected; end + + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#94 + def normalize_argument_to_redirection(fragment); end + + # Proxy to to_param if the object will respond to it. + # + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#90 + def parameterize(value); end + + # source://actionpack//lib/action_dispatch/testing/assertions/response.rb#113 + def response_body_if_short; end +end + +# source://actionpack//lib/action_dispatch/testing/assertions/response.rb#9 +ActionDispatch::Assertions::ResponseAssertions::RESPONSE_PREDICATES = T.let(T.unsafe(nil), Hash) + +# Suite of assertions to test routes generated by Rails and the handling of +# requests made to them. +# +# source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#15 +module ActionDispatch::Assertions::RoutingAssertions + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # Asserts that the provided options can be used to generate the provided path. + # This is the inverse of `assert_recognizes`. The `extras` parameter is used to + # tell the request the names and values of additional request parameters that + # would be in a query string. The `message` parameter allows you to specify a + # custom error message for assertion failures. + # + # The `defaults` parameter is unused. + # + # # Asserts that the default action is generated for a route with no action + # assert_generates "/items", controller: "items", action: "index" + # + # # Tests that the list action is properly routed + # assert_generates "/items/list", controller: "items", action: "list" + # + # # Tests the generation of a route with a parameter + # assert_generates "/items/list/1", { controller: "items", action: "list", id: "1" } + # + # # Asserts that the generated route gives us our custom route + # assert_generates "changesets/12", { controller: 'scm', action: 'show_diff', revision: "12" } + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#216 + def assert_generates(expected_path, options, defaults = T.unsafe(nil), extras = T.unsafe(nil), message = T.unsafe(nil)); end + + # Asserts that the routing of the given `path` was handled correctly and that + # the parsed options (given in the `expected_options` hash) match `path`. + # Basically, it asserts that Rails recognizes the route given by + # `expected_options`. + # + # Pass a hash in the second argument (`path`) to specify the request method. + # This is useful for routes requiring a specific HTTP method. The hash should + # contain a `:path` with the incoming request path and a `:method` containing + # the required HTTP verb. + # + # # Asserts that POSTing to /items will call the create action on ItemsController + # assert_recognizes({controller: 'items', action: 'create'}, {path: 'items', method: :post}) + # + # You can also pass in `extras` with a hash containing URL parameters that would + # normally be in the query string. This can be used to assert that values in the + # query string will end up in the params hash correctly. To test query strings + # you must use the extras argument because appending the query string on the + # path directly will not work. For example: + # + # # Asserts that a path of '/items/list/1?view=print' returns the correct options + # assert_recognizes({controller: 'items', action: 'list', id: '1', view: 'print'}, 'items/list/1', { view: "print" }) + # + # The `message` parameter allows you to pass in an error message that is + # displayed upon failure. + # + # # Check the default route (i.e., the index action) + # assert_recognizes({controller: 'items', action: 'index'}, 'items') + # + # # Test a specific action + # assert_recognizes({controller: 'items', action: 'list'}, 'items/list') + # + # # Test an action with a parameter + # assert_recognizes({controller: 'items', action: 'destroy', id: '1'}, 'items/destroy/1') + # + # # Test a custom route + # assert_recognizes({controller: 'items', action: 'show', id: '1'}, 'view/item1') + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#176 + def assert_recognizes(expected_options, path, extras = T.unsafe(nil), msg = T.unsafe(nil)); end + + # Asserts that path and options match both ways; in other words, it verifies + # that `path` generates `options` and then that `options` generates `path`. This + # essentially combines `assert_recognizes` and `assert_generates` into one step. + # + # The `extras` hash allows you to specify options that would normally be + # provided as a query string to the action. The `message` parameter allows you + # to specify a custom error message to display upon failure. + # + # # Asserts a basic route: a controller with the default action (index) + # assert_routing '/home', controller: 'home', action: 'index' + # + # # Test a route generated with a specific controller, action, and parameter (id) + # assert_routing '/entries/show/23', controller: 'entries', action: 'show', id: 23 + # + # # Asserts a basic route (controller + default action), with an error message if it fails + # assert_routing '/store', { controller: 'store', action: 'index' }, {}, {}, 'Route for store index not generated properly' + # + # # Tests a route, providing a defaults hash + # assert_routing 'controller/action/9', {id: "9", item: "square"}, {controller: "controller", action: "action"}, {}, {item: "square"} + # + # # Tests a route with an HTTP method + # assert_routing({ method: 'put', path: '/product/321' }, { controller: "product", action: "update", id: "321" }) + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#260 + def assert_routing(path, options, defaults = T.unsafe(nil), extras = T.unsafe(nil), message = T.unsafe(nil)); end + + # ROUTES TODO: These assertions should really work in an integration context + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#273 + def method_missing(selector, *_arg1, **_arg2, &_arg3); end + + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#115 + def setup; end + + # A helper to make it easier to test different route configurations. This method + # temporarily replaces @routes with a new RouteSet instance. + # + # The new instance is yielded to the passed block. Typically the block will + # create some routes using `set.draw { match ... }`: + # + # with_routing do |set| + # set.draw do + # resources :users + # end + # assert_equal "/users", users_path + # end + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#133 + def with_routing(config = T.unsafe(nil), &block); end + + private + + # @yield [@routes] + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#282 + def create_routes(config = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#348 + def fail_on(exception_class, message); end + + # Recognizes the route for a given path. + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#314 + def recognized_request_for(path, extras = T.unsafe(nil), msg); end + + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#306 + def reset_routes(old_routes, old_controller); end +end + +# source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#88 +module ActionDispatch::Assertions::RoutingAssertions::ClassMethods + # A helper to make it easier to test different route configurations. This method + # temporarily replaces @routes with a new RouteSet instance before each test. + # + # The new instance is yielded to the passed block. Typically the block will + # create some routes using `set.draw { match ... }`: + # + # with_routing do |set| + # set.draw do + # resources :users + # end + # end + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#101 + def with_routing(&block); end +end + +# source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#18 +module ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting::ClassMethods + + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#40 + def with_routing(&block); end + + private + + # @yield [routes] + # + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#58 + def create_routes; end + + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#50 + def initialize_lazy_routes(routes); end + + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#80 + def reset_routes(old_routes, old_routes_call_method, old_integration_session); end +end + +# source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#21 +module ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting::ClassMethods + # source://actionpack//lib/action_dispatch/testing/assertions/routing.rb#22 + def with_routing(&block); end +end + +# # Action Dispatch AssumeSSL +# +# When proxying through a load balancer that terminates SSL, the forwarded +# request will appear as though it's HTTP instead of HTTPS to the application. +# This makes redirects and cookie security target HTTP instead of HTTPS. This +# middleware makes the server assume that the proxy already terminated SSL, and +# that the request really is HTTPS. +# +# source://actionpack//lib/action_dispatch/middleware/assume_ssl.rb#13 +class ActionDispatch::AssumeSSL + # @return [AssumeSSL] a new instance of AssumeSSL + # + # source://actionpack//lib/action_dispatch/middleware/assume_ssl.rb#14 + def initialize(app); end + + # source://actionpack//lib/action_dispatch/middleware/assume_ssl.rb#18 + def call(env); end +end + +# # Action Dispatch Callbacks +# +# Provides callbacks to be executed before and after dispatching the request. +# +# source://actionpack//lib/action_dispatch/middleware/callbacks.rb#9 +class ActionDispatch::Callbacks + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # @return [Callbacks] a new instance of Callbacks + # + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#24 + def initialize(app); end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#10 + def __callbacks; end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#12 + def _call_callbacks; end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#12 + def _run_call_callbacks; end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#12 + def _run_call_callbacks!(&block); end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#28 + def call(env); end + + class << self + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#10 + def __callbacks; end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#10 + def __callbacks=(value); end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#12 + def _call_callbacks; end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#12 + def _call_callbacks=(value); end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#19 + def after(*args, &block); end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#15 + def before(*args, &block); end + + private + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#10 + def __class_attr___callbacks; end + + # source://actionpack//lib/action_dispatch/middleware/callbacks.rb#10 + def __class_attr___callbacks=(new_value); end + end +end + +# source://actionpack//lib/action_dispatch/constants.rb#8 +module ActionDispatch::Constants; end + +# source://actionpack//lib/action_dispatch/constants.rb#23 +ActionDispatch::Constants::CONTENT_ENCODING = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#24 +ActionDispatch::Constants::CONTENT_SECURITY_POLICY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#25 +ActionDispatch::Constants::CONTENT_SECURITY_POLICY_REPORT_ONLY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#27 +ActionDispatch::Constants::FEATURE_POLICY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#26 +ActionDispatch::Constants::LOCATION = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#30 +ActionDispatch::Constants::SERVER_TIMING = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#31 +ActionDispatch::Constants::STRICT_TRANSPORT_SECURITY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#37 +ActionDispatch::Constants::UNPROCESSABLE_CONTENT = T.let(T.unsafe(nil), Symbol) + +# source://actionpack//lib/action_dispatch/constants.rb#22 +ActionDispatch::Constants::VARY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#29 +ActionDispatch::Constants::X_CASCADE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/constants.rb#28 +ActionDispatch::Constants::X_REQUEST_ID = T.let(T.unsafe(nil), String) + +# # Action Dispatch Content Security Policy +# +# Configures the HTTP [Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) +# response header to help protect against XSS and +# injection attacks. +# +# Example global policy: +# +# Rails.application.config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# +# # Specify URI for violation reports +# policy.report_uri "/csp-violation-report-endpoint" +# end +# +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#28 +class ActionDispatch::ContentSecurityPolicy + # @return [ContentSecurityPolicy] a new instance of ContentSecurityPolicy + # @yield [_self] + # @yieldparam _self [ActionDispatch::ContentSecurityPolicy] the object that the method was called on + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#182 + def initialize; end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def base_uri(*sources); end + + # Specify whether to prevent the user agent from loading any assets over HTTP + # when the page uses HTTPS: + # + # policy.block_all_mixed_content + # + # Pass `false` to allow it again: + # + # policy.block_all_mixed_content false + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#210 + def block_all_mixed_content(enabled = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#299 + def build(context = T.unsafe(nil), nonce = T.unsafe(nil), nonce_directives = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def child_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def connect_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def default_src(*sources); end + + # Returns the value of attribute directives. + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#180 + def directives; end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def font_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def form_action(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def frame_ancestors(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def frame_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def img_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def manifest_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def media_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def object_src(*sources); end + + # Restricts the set of plugins that can be embedded: + # + # policy.plugin_types "application/x-shockwave-flash" + # + # Leave empty to allow all plugins: + # + # policy.plugin_types + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#226 + def plugin_types(*types); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def prefetch_src(*sources); end + + # Enable the [report-uri](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-uri) + # directive. Violation reports will be sent to the + # specified URI: + # + # policy.report_uri "/csp-violation-report-endpoint" + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#240 + def report_uri(uri); end + + # Specify asset types for which [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) is required: + # + # policy.require_sri_for :script, :style + # + # Leave empty to not require Subresource Integrity: + # + # policy.require_sri_for + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#252 + def require_sri_for(*types); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def require_trusted_types_for(*sources); end + + # Specify whether a [sandbox](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/sandbox) + # should be enabled for the requested resource: + # + # policy.sandbox + # + # Values can be passed as arguments: + # + # policy.sandbox "allow-scripts", "allow-modals" + # + # Pass `false` to disable the sandbox: + # + # policy.sandbox false + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#273 + def sandbox(*values); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def script_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def script_src_attr(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def script_src_elem(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def style_src(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def style_src_attr(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def style_src_elem(*sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def trusted_types(*sources); end + + # Specify whether user agents should treat any assets over HTTP as HTTPS: + # + # policy.upgrade_insecure_requests + # + # Pass `false` to disable it: + # + # policy.upgrade_insecure_requests false + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#291 + def upgrade_insecure_requests(enabled = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#192 + def worker_src(*sources); end + + private + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#324 + def apply_mapping(source); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#305 + def apply_mappings(sources); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#358 + def build_directive(directive, sources, context); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#330 + def build_directives(context, nonce, nonce_directives); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#386 + def hash_source?(source); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#187 + def initialize_copy(other); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#382 + def nonce_directive?(directive, nonce_directives); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#364 + def resolve_source(source, context); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#346 + def validate(directive, sources); end +end + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#176 +ActionDispatch::ContentSecurityPolicy::DEFAULT_NONCE_DIRECTIVES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#149 +ActionDispatch::ContentSecurityPolicy::DIRECTIVES = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#174 +ActionDispatch::ContentSecurityPolicy::HASH_SOURCE_ALGORITHM_PREFIXES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#29 +class ActionDispatch::ContentSecurityPolicy::InvalidDirectiveError < ::StandardError; end + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#128 +ActionDispatch::ContentSecurityPolicy::MAPPINGS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#32 +class ActionDispatch::ContentSecurityPolicy::Middleware + # @return [Middleware] a new instance of Middleware + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#33 + def initialize(app); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#37 + def call(env); end + + private + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#59 + def header_name(request); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#67 + def policy_present?(headers); end +end + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#73 +module ActionDispatch::ContentSecurityPolicy::Request + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#80 + def content_security_policy; end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#84 + def content_security_policy=(policy); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#112 + def content_security_policy_nonce; end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#104 + def content_security_policy_nonce_directives; end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#108 + def content_security_policy_nonce_directives=(generator); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#96 + def content_security_policy_nonce_generator; end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#100 + def content_security_policy_nonce_generator=(generator); end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#88 + def content_security_policy_report_only; end + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#92 + def content_security_policy_report_only=(value); end + + private + + # source://actionpack//lib/action_dispatch/http/content_security_policy.rb#123 + def generate_content_security_policy_nonce; end +end + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#77 +ActionDispatch::ContentSecurityPolicy::Request::NONCE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#78 +ActionDispatch::ContentSecurityPolicy::Request::NONCE_DIRECTIVES = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#76 +ActionDispatch::ContentSecurityPolicy::Request::NONCE_GENERATOR = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#74 +ActionDispatch::ContentSecurityPolicy::Request::POLICY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/content_security_policy.rb#75 +ActionDispatch::ContentSecurityPolicy::Request::POLICY_REPORT_ONLY = T.let(T.unsafe(nil), String) + +# Read and write data to cookies through ActionController::Cookies#cookies. +# +# When reading cookie data, the data is read from the HTTP request header, +# Cookie. When writing cookie data, the data is sent out in the HTTP response +# header, `Set-Cookie`. +# +# Examples of writing: +# +# # Sets a simple session cookie. +# # This cookie will be deleted when the user's browser is closed. +# cookies[:user_name] = "david" +# +# # Cookie values are String-based. Other data types need to be serialized. +# cookies[:lat_lon] = JSON.generate([47.68, -122.37]) +# +# # Sets a cookie that expires in 1 hour. +# cookies[:login] = { value: "XJ-122", expires: 1.hour } +# +# # Sets a cookie that expires at a specific time. +# cookies[:login] = { value: "XJ-122", expires: Time.utc(2020, 10, 15, 5) } +# +# # Sets a signed cookie, which prevents users from tampering with its value. +# cookies.signed[:user_id] = current_user.id +# # It can be read using the signed method. +# cookies.signed[:user_id] # => 123 +# +# # Sets an encrypted cookie value before sending it to the client which +# # prevent users from reading and tampering with its value. +# cookies.encrypted[:discount] = 45 +# # It can be read using the encrypted method. +# cookies.encrypted[:discount] # => 45 +# +# # Sets a "permanent" cookie (which expires in 20 years from now). +# cookies.permanent[:login] = "XJ-122" +# +# # You can also chain these methods: +# cookies.signed.permanent[:login] = "XJ-122" +# +# Examples of reading: +# +# cookies[:user_name] # => "david" +# cookies.size # => 2 +# JSON.parse(cookies[:lat_lon]) # => [47.68, -122.37] +# cookies.signed[:login] # => "XJ-122" +# cookies.encrypted[:discount] # => 45 +# +# Example for deleting: +# +# cookies.delete :user_name +# +# Please note that if you specify a `:domain` when setting a cookie, you must +# also specify the domain when deleting the cookie: +# +# cookies[:name] = { +# value: 'a yummy cookie', +# expires: 1.year, +# domain: 'domain.com' +# } +# +# cookies.delete(:name, domain: 'domain.com') +# +# The option symbols for setting cookies are: +# +# * `:value` - The cookie's value. +# * `:path` - The path for which this cookie applies. Defaults to the root of +# the application. +# * `:domain` - The domain for which this cookie applies so you can restrict +# to the domain level. If you use a schema like www.example.com and want to +# share session with user.example.com set `:domain` to `:all`. To support +# multiple domains, provide an array, and the first domain matching +# `request.host` will be used. Make sure to specify the `:domain` option +# with `:all` or `Array` again when deleting cookies. For more flexibility +# you can set the domain on a per-request basis by specifying `:domain` with +# a proc. +# +# domain: nil # Does not set cookie domain. (default) +# domain: :all # Allow the cookie for the top most level +# # domain and subdomains. +# domain: %w(.example.com .example.org) # Allow the cookie +# # for concrete domain names. +# domain: proc { Tenant.current.cookie_domain } # Set cookie domain dynamically +# domain: proc { |req| ".sub.#{req.host}" } # Set cookie domain dynamically based on request +# +# * `:tld_length` - When using `:domain => :all`, this option can be used to +# explicitly set the TLD length when using a short (<= 3 character) domain +# that is being interpreted as part of a TLD. For example, to share cookies +# between user1.lvh.me and user2.lvh.me, set `:tld_length` to 2. +# * `:expires` - The time at which this cookie expires, as a Time or +# ActiveSupport::Duration object. +# * `:secure` - Whether this cookie is only transmitted to HTTPS servers. +# Default is `false`. +# * `:httponly` - Whether this cookie is accessible via scripting or only +# HTTP. Defaults to `false`. +# * `:same_site` - The value of the `SameSite` cookie attribute, which +# determines how this cookie should be restricted in cross-site contexts. +# Possible values are `nil`, `:none`, `:lax`, and `:strict`. Defaults to +# `:lax`. +# +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#195 +class ActionDispatch::Cookies + # @return [Cookies] a new instance of Cookies + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#702 + def initialize(app); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#706 + def call(env); end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#201 +ActionDispatch::Cookies::AUTHENTICATED_ENCRYPTED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#506 +class ActionDispatch::Cookies::AbstractCookieJar + include ::ActionDispatch::Cookies::ChainedCookieJars + + # @return [AbstractCookieJar] a new instance of AbstractCookieJar + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#509 + def initialize(parent_jar); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#513 + def [](name); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#525 + def []=(name, options); end + + protected + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#537 + def request; end + + private + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#555 + def commit(name, options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#548 + def cookie_metadata(name, options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#540 + def expiry_options(options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#554 + def parse(name, data, purpose: T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#207 +ActionDispatch::Cookies::COOKIES_DIGEST = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#208 +ActionDispatch::Cookies::COOKIES_ROTATIONS = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#209 +ActionDispatch::Cookies::COOKIES_SAME_SITE_PROTECTION = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#206 +ActionDispatch::Cookies::COOKIES_SERIALIZER = T.let(T.unsafe(nil), String) + +# Include in a cookie jar to allow chaining, e.g. `cookies.permanent.signed`. +# +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#219 +module ActionDispatch::Cookies::ChainedCookieJars + # Returns a jar that'll automatically encrypt cookie values before sending them + # to the client and will decrypt them for read. If the cookie was tampered with + # by the user (or a 3rd party), `nil` will be returned. + # + # If `config.action_dispatch.encrypted_cookie_salt` and + # `config.action_dispatch.encrypted_signed_cookie_salt` are both set, legacy + # cookies encrypted with HMAC AES-256-CBC will be transparently upgraded. + # + # This jar requires that you set a suitable secret for the verification on your + # app's `secret_key_base`. + # + # Example: + # + # cookies.encrypted[:discount] = 45 + # # => Set-Cookie: discount=DIQ7fw==--K3n//8vvnSbGq9dA--7Xh91HfLpwzbj1czhBiwOg==; path=/ + # + # cookies.encrypted[:discount] # => 45 + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#274 + def encrypted; end + + # Returns a jar that'll automatically set the assigned cookies to have an + # expiration date 20 years from now. Example: + # + # cookies.permanent[:prefers_open_id] = true + # # => Set-Cookie: prefers_open_id=true; path=/; expires=Sun, 16-Dec-2029 03:24:16 GMT + # + # This jar is only meant for writing. You'll read permanent cookies through the + # regular accessor. + # + # This jar allows chaining with the signed jar as well, so you can set + # permanent, signed cookies. Examples: + # + # cookies.permanent.signed[:remember_me] = current_user.id + # # => Set-Cookie: remember_me=BAhU--848956038e692d7046deab32b7131856ab20e14e; path=/; expires=Sun, 16-Dec-2029 03:24:16 GMT + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#234 + def permanent; end + + # Returns a jar that'll automatically generate a signed representation of cookie + # value and verify it when reading from the cookie again. This is useful for + # creating cookies with values that the user is not supposed to change. If a + # signed cookie was tampered with by the user (or a 3rd party), `nil` will be + # returned. + # + # This jar requires that you set a suitable secret for the verification on your + # app's `secret_key_base`. + # + # Example: + # + # cookies.signed[:discount] = 45 + # # => Set-Cookie: discount=BAhpMg==--2c1c6906c90a3bc4fd54a51ffb41dffa4bf6b5f7; path=/ + # + # cookies.signed[:discount] # => 45 + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#253 + def signed; end + + # Returns the `signed` or `encrypted` jar, preferring `encrypted` if + # `secret_key_base` is set. Used by ActionDispatch::Session::CookieStore to + # avoid the need to introduce new cookie stores. + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#281 + def signed_or_encrypted; end + + private + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#304 + def encrypted_cookie_cipher; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#298 + def prepare_upgrade_legacy_hmac_aes_cbc_cookies?; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#308 + def signed_cookie_digest; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#291 + def upgrade_legacy_hmac_aes_cbc_cookies?; end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#313 +class ActionDispatch::Cookies::CookieJar + include ::ActionDispatch::Cookies::ChainedCookieJars + include ::Enumerable + + # @return [CookieJar] a new instance of CookieJar + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#324 + def initialize(request); end + + # Returns the value of the cookie by `name`, or `nil` if no such cookie exists. + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#345 + def [](name); end + + # Sets the cookie named `name`. The second argument may be the cookie's value or + # a hash of options as documented above. + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#379 + def []=(name, options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#441 + def always_write_cookie; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#441 + def always_write_cookie=(val); end + + # Removes all cookies on the client machine by calling `delete` for each cookie. + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#425 + def clear(options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#334 + def commit!; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#332 + def committed?; end + + # Removes the cookie on the client machine by setting the value to an empty + # string and the expiration date in the past. Like `[]=`, you can pass in an + # options hash to delete cookies with extra data such as a `:path`. + # + # Returns the value of the cookie, or `nil` if the cookie does not exist. + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#404 + def delete(name, options = T.unsafe(nil)); end + + # Whether the given cookie is to be deleted by this CookieJar. Like `[]=`, you + # can pass in an options hash to test if a deletion applies to a specific + # `:path`, `:domain` etc. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#418 + def deleted?(name, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#340 + def each(&block); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#349 + def fetch(name, *args, &block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#356 + def has_key?(name); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#353 + def key?(name); end + + # Returns the value of attribute request. + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#322 + def request; end + + # Returns the cookies as Hash. + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#359 + def to_hash(*_arg0); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#373 + def to_header; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#361 + def update(other_hash); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#366 + def update_cookies_from_jar; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#429 + def write(response); end + + private + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#444 + def escape(string); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#452 + def handle_options(options); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#448 + def write_cookie?(cookie); end + + class << self + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#441 + def always_write_cookie; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#441 + def always_write_cookie=(val); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#316 + def build(req, cookies); end + end +end + +# Raised when storing more than 4K of session data. +# +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#216 +class ActionDispatch::Cookies::CookieOverflow < ::StandardError; end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#203 +ActionDispatch::Cookies::ENCRYPTED_COOKIE_CIPHER = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#199 +ActionDispatch::Cookies::ENCRYPTED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#200 +ActionDispatch::Cookies::ENCRYPTED_SIGNED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#650 +class ActionDispatch::Cookies::EncryptedKeyRotatingCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar + include ::ActionDispatch::Cookies::SerializedCookieJars + + # @return [EncryptedKeyRotatingCookieJar] a new instance of EncryptedKeyRotatingCookieJar + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#653 + def initialize(parent_jar); end + + private + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#695 + def commit(name, options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#687 + def parse(name, encrypted_message, purpose: T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#197 +ActionDispatch::Cookies::GENERATOR_KEY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#196 +ActionDispatch::Cookies::HTTP_HEADER = T.let(T.unsafe(nil), String) + +# Cookies can typically store 4096 bytes. +# +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#213 +ActionDispatch::Cookies::MAX_COOKIE_SIZE = T.let(T.unsafe(nil), Integer) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#558 +class ActionDispatch::Cookies::PermanentCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar + private + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#560 + def commit(name, options); end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#205 +ActionDispatch::Cookies::SECRET_KEY_BASE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#204 +ActionDispatch::Cookies::SIGNED_COOKIE_DIGEST = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#198 +ActionDispatch::Cookies::SIGNED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#565 +module ActionDispatch::Cookies::SerializedCookieJars + protected + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#569 + def digest; end + + private + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#612 + def check_for_overflow!(name, options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#608 + def commit(name, options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#594 + def parse(name, dumped, force_reserialize: T.unsafe(nil), **_arg3); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#588 + def reserialize?(dumped); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#574 + def serializer; end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#566 +ActionDispatch::Cookies::SerializedCookieJars::SERIALIZER = ActiveSupport::MessageEncryptor::NullSerializer + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#621 +class ActionDispatch::Cookies::SignedKeyRotatingCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar + include ::ActionDispatch::Cookies::SerializedCookieJars + + # @return [SignedKeyRotatingCookieJar] a new instance of SignedKeyRotatingCookieJar + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#624 + def initialize(parent_jar); end + + private + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#643 + def commit(name, options); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#637 + def parse(name, signed_message, purpose: T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#202 +ActionDispatch::Cookies::USE_AUTHENTICATED_COOKIE_ENCRYPTION = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#210 +ActionDispatch::Cookies::USE_COOKIES_WITH_METADATA = T.let(T.unsafe(nil), String) + +# # Action Dispatch DebugExceptions +# +# This middleware is responsible for logging exceptions and showing a debugging +# page in case the request is local. +# +# source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#15 +class ActionDispatch::DebugExceptions + # @return [DebugExceptions] a new instance of DebugExceptions + # + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#23 + def initialize(app, routes_app = T.unsafe(nil), response_format = T.unsafe(nil), interceptors = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#30 + def call(env); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#206 + def api_request?(content_type); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#148 + def compose_exception_message(wrapper); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#118 + def create_template(request, wrapper); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#50 + def invoke_interceptors(request, exception, wrapper); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#180 + def log_array(logger, lines, request); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#138 + def log_error(request, wrapper); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#210 + def log_rescued_responses?(request); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#192 + def logger(request); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#134 + def render(status, body, format); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#58 + def render_exception(request, exception, wrapper); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#94 + def render_for_api_request(content_type, wrapper); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#80 + def render_for_browser_request(request, wrapper); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#200 + def routes_inspector(exception); end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#196 + def stderr_logger; end + + class << self + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#16 + def interceptors; end + + # source://actionpack//lib/action_dispatch/middleware/debug_exceptions.rb#18 + def register_interceptor(object = T.unsafe(nil), &block); end + end +end + +# # Action Dispatch DebugLocks +# +# This middleware can be used to diagnose deadlocks in the autoload interlock. +# +# To use it, insert it near the top of the middleware stack, using +# `config/application.rb`: +# +# config.middleware.insert_before Rack::Sendfile, ActionDispatch::DebugLocks +# +# After restarting the application and re-triggering the deadlock condition, the +# route `/rails/locks` will show a summary of all threads currently known to the +# interlock, which lock level they are holding or awaiting, and their current +# backtrace. +# +# Generally a deadlock will be caused by the interlock conflicting with some +# other external lock or blocking I/O call. These cannot be automatically +# identified, but should be visible in the displayed backtraces. +# +# NOTE: The formatting and content of this middleware's output is intended for +# human consumption, and should be expected to change between releases. +# +# This middleware exposes operational details of the server, with no access +# control. It should only be enabled when in use, and removed thereafter. +# +# source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#29 +class ActionDispatch::DebugLocks + # @return [DebugLocks] a new instance of DebugLocks + # + # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#30 + def initialize(app, path = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#35 + def call(env); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#108 + def blocked_by?(victim, blocker, all_threads); end + + # source://actionpack//lib/action_dispatch/middleware/debug_locks.rb#49 + def render_details(req); end +end + +# source://actionpack//lib/action_dispatch/middleware/debug_view.rb#11 +class ActionDispatch::DebugView < ::ActionView::Base + # @return [DebugView] a new instance of DebugView + # + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#14 + def initialize(assigns); end + + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#20 + def compiled_method_container; end + + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#44 + def debug_hash(object); end + + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#36 + def debug_headers(headers); end + + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#24 + def debug_params(params); end + + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#58 + def editor_url(location, line: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#73 + def params_valid?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#69 + def protect_against_forgery?; end + + # source://actionpack//lib/action_dispatch/middleware/debug_view.rb#48 + def render(*_arg0); end +end + +# source://actionpack//lib/action_dispatch/middleware/debug_view.rb#12 +ActionDispatch::DebugView::RESCUES_TEMPLATE_PATHS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#11 +class ActionDispatch::ExceptionWrapper + # @return [ExceptionWrapper] a new instance of ExceptionWrapper + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#51 + def initialize(backtrace_cleaner, exception); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#102 + def actions; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#114 + def annotated_source_code; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#136 + def application_trace; end + + # Returns the value of attribute backtrace_cleaner. + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#49 + def backtrace_cleaner; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#90 + def corrections; end + + # Returns the value of attribute exception. + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#49 + def exception; end + + # Returns the value of attribute exception_class_name. + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#49 + def exception_class_name; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#234 + def exception_id; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#230 + def exception_inspect; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#222 + def exception_name; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#130 + def exception_trace; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#78 + def failures; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#94 + def file_name; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#140 + def framework_trace; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#144 + def full_trace; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#74 + def has_cause?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#82 + def has_corrections?; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#98 + def line_number; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#226 + def message; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#86 + def original_message; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#200 + def rescue_response?; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#12 + def rescue_responses; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#12 + def rescue_responses=(val); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#122 + def rescue_template; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#31 + def rescue_templates; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#31 + def rescue_templates=(val); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#62 + def routing_error?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#185 + def show?(request); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 + def silent_exceptions; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 + def silent_exceptions=(val); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#204 + def source_extracts; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#218 + def source_to_show_id; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#126 + def status_code; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#70 + def sub_template_message; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#66 + def template_error?; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#210 + def trace_to_show; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#148 + def traces; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#106 + def unwrapped_exception; end + + # Returns the value of attribute wrapped_causes. + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#49 + def wrapped_causes; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#40 + def wrapper_exceptions; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#40 + def wrapper_exceptions=(val); end + + private + + # Returns the value of attribute backtrace. + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#258 + def backtrace; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#260 + def build_backtrace; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#283 + def causes_for(exception); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#293 + def clean_backtrace(*args); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#346 + def extract_file_and_line_number(trace); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#301 + def extract_source(trace); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#330 + def extract_source_fragment_lines(source_lines, line); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#336 + def source_fragment(path, line); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#289 + def wrapped_causes_for(exception, backtrace_cleaner); end + + class << self + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#12 + def rescue_responses; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#12 + def rescue_responses=(val); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#31 + def rescue_templates; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#31 + def rescue_templates=(val); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 + def silent_exceptions; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#44 + def silent_exceptions=(val); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#181 + def status_code_for_exception(class_name); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#40 + def wrapper_exceptions; end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#40 + def wrapper_exceptions=(val); end + end +end + +# source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#239 +class ActionDispatch::ExceptionWrapper::SourceMapLocation + # @return [SourceMapLocation] a new instance of SourceMapLocation + # + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#240 + def initialize(location, template); end + + # source://actionpack//lib/action_dispatch/middleware/exception_wrapper.rb#245 + def spot(exc); end +end + +# source://actionpack//lib/action_dispatch/middleware/executor.rb#8 +class ActionDispatch::Executor + # @return [Executor] a new instance of Executor + # + # source://actionpack//lib/action_dispatch/middleware/executor.rb#9 + def initialize(app, executor); end + + # source://actionpack//lib/action_dispatch/middleware/executor.rb#13 + def call(env); end +end + +# # Action Dispatch FileHandler +# +# This endpoint serves static files from disk using `Rack::Files`. +# +# URL paths are matched with static files according to expected conventions: +# `path`, `path`.html, `path`/index.html. +# +# Precompressed versions of these files are checked first. Brotli (.br) and gzip +# (.gz) files are supported. If `path`.br exists, this endpoint returns that +# +# If no matching file is found, this endpoint responds `404 Not Found`. +# +# Pass the `root` directory to search for matching files, an optional `index: +# "index"` to change the default `path`/index.html, and optional additional +# response headers. +# +# source://actionpack//lib/action_dispatch/middleware/static.rb#47 +class ActionDispatch::FileHandler + # @return [FileHandler] a new instance of FileHandler + # + # source://actionpack//lib/action_dispatch/middleware/static.rb#55 + def initialize(root, index: T.unsafe(nil), headers: T.unsafe(nil), precompressed: T.unsafe(nil), compressible_content_types: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/static.rb#69 + def attempt(env); end + + # source://actionpack//lib/action_dispatch/middleware/static.rb#65 + def call(env); end + + private + + # source://actionpack//lib/action_dispatch/middleware/static.rb#185 + def clean_path(path_info); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/static.rb#149 + def compressible?(content_type); end + + # @yield [path, content_type || "text/plain"] + # + # source://actionpack//lib/action_dispatch/middleware/static.rb#162 + def each_candidate_filepath(path_info); end + + # source://actionpack//lib/action_dispatch/middleware/static.rb#153 + def each_precompressed_filepath(filepath); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/static.rb#144 + def file_readable?(path); end + + # Match a URI path to a static file to be served. + # + # Used by the `Static` class to negotiate a servable file in the `public/` + # directory (see Static#call). + # + # Checks for `path`, `path`.html, and `path`/index.html files, in that order, + # including .br and .gzip compressed extensions. + # + # If a matching file is found, the path and necessary response headers + # (Content-Type, Content-Encoding) are returned. + # + # source://actionpack//lib/action_dispatch/middleware/static.rb#104 + def find_file(path_info, accept_encoding:); end + + # source://actionpack//lib/action_dispatch/middleware/static.rb#80 + def serve(request, filepath, content_headers); end + + # source://actionpack//lib/action_dispatch/middleware/static.rb#112 + def try_files(filepath, content_type, accept_encoding:); end + + # source://actionpack//lib/action_dispatch/middleware/static.rb#122 + def try_precompressed_files(filepath, headers, accept_encoding:); end +end + +# `Accept-Encoding` value -> file extension +# +# source://actionpack//lib/action_dispatch/middleware/static.rb#49 +ActionDispatch::FileHandler::PRECOMPRESSED = T.let(T.unsafe(nil), Hash) + +# # Action Dispatch Flash +# +# The flash provides a way to pass temporary primitive-types (String, Array, +# Hash) between actions. Anything you place in the flash will be exposed to the +# very next action and then cleared out. This is a great way of doing notices +# and alerts, such as a create action that sets `flash[:notice] = "Post +# successfully created"` before redirecting to a display action that can then +# expose the flash to its template. Actually, that exposure is automatically +# done. +# +# class PostsController < ActionController::Base +# def create +# # save post +# flash[:notice] = "Post successfully created" +# redirect_to @post +# end +# +# def show +# # doesn't need to assign the flash notice to the template, that's done automatically +# end +# end +# +# Then in `show.html.erb`: +# +# <% if flash[:notice] %> +#
<%= flash[:notice] %>
+# <% end %> +# +# Since the `notice` and `alert` keys are a common idiom, convenience accessors +# are available: +# +# flash.alert = "You must be logged in" +# flash.notice = "Post successfully created" +# +# This example places a string in the flash. And of course, you can put as many +# as you like at a time too. If you want to pass non-primitive types, you will +# have to handle that in your application. Example: To show messages with links, +# you will have to use sanitize helper. +# +# Just remember: They'll be gone by the time the next action has been performed. +# +# See docs on the FlashHash class for more details about the flash. +# +# source://actionpack//lib/action_dispatch/middleware/flash.rb#50 +class ActionDispatch::Flash + class << self + # source://actionpack//lib/action_dispatch/middleware/flash.rb#312 + def new(app); end + end +end + +# source://actionpack//lib/action_dispatch/middleware/flash.rb#119 +class ActionDispatch::Flash::FlashHash + include ::Enumerable + + # @return [FlashHash] a new instance of FlashHash + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#149 + def initialize(flashes = T.unsafe(nil), discard = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#169 + def [](k); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#163 + def []=(k, v); end + + # Convenience accessor for `flash[:alert]`. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#280 + def alert; end + + # Convenience accessor for `flash[:alert]=`. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#285 + def alert=(message); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#204 + def clear; end + + # Immediately deletes the single flash entry. Use this method when you want + # remove the message within the current action. See also #discard. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#189 + def delete(key); end + + # Marks the entire flash or a single flash entry to be discarded by the end of + # the current action: + # + # flash.discard # discard the entire flash at the end of the current action + # flash.discard(:warning) # discard only the "warning" entry at the end of the current action + # + # Use this method when you want to display the message in the current action but + # not in the next one. See also #delete. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#264 + def discard(k = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#209 + def each(&block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#200 + def empty?; end + + # Keeps either the entire current flash or a specific flash entry available for + # the next action: + # + # flash.keep # keeps the entire flash + # flash.keep(:notice) # keeps only the "notice" entry, the rest of the flash is discarded + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#250 + def keep(k = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#183 + def key?(name); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#179 + def keys; end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#213 + def merge!(h); end + + # Convenience accessor for `flash[:notice]`. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#290 + def notice; end + + # Convenience accessor for `flash[:notice]=`. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#295 + def notice=(message); end + + # Sets a flash that will not be available to the next action, only to the + # current. + # + # flash.now[:message] = "Hello current action" + # + # This method enables you to use the flash as a central messaging system in your + # app. When you need to pass an object to the next action, you use the standard + # flash assign (`[]=`). When you need to pass an object to the current action, + # you use `now`, and your object will vanish when the current action is done. + # + # Entries set via `now` are accessed the same way as standard entries: + # `flash['my-key']`. + # + # Also, brings two convenience accessors: + # + # flash.now.alert = "Beware now!" + # # Equivalent to flash.now[:alert] = "Beware now!" + # + # flash.now.notice = "Good luck now!" + # # Equivalent to flash.now[:notice] = "Good luck now!" + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#241 + def now; end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#215 + def replace(h); end + + # 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. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#274 + def sweep; end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#196 + def to_hash; end + + # Builds a hash containing the flashes to keep for the next request. If there + # are none to keep, returns `nil`. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#143 + def to_session_value; end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#173 + def update(h); end + + protected + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#300 + def now_is_loaded?; end + + private + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#155 + def initialize_copy(other); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#305 + def stringify_array(array); end + + class << self + # source://actionpack//lib/action_dispatch/middleware/flash.rb#122 + def from_session_value(value); end + end +end + +# source://actionpack//lib/action_dispatch/middleware/flash.rb#90 +class ActionDispatch::Flash::FlashNow + # @return [FlashNow] a new instance of FlashNow + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#93 + def initialize(flash); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#104 + def [](k); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#97 + def []=(k, v); end + + # Convenience accessor for `flash.now[:alert]=`. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#109 + def alert=(message); end + + # Returns the value of attribute flash. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#91 + def flash; end + + # Sets the attribute flash + # + # @param value the value to set the attribute flash to. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#91 + def flash=(_arg0); end + + # Convenience accessor for `flash.now[:notice]=`. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#114 + def notice=(message); end +end + +# source://actionpack//lib/action_dispatch/middleware/flash.rb#51 +ActionDispatch::Flash::KEY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/flash.rb#53 +module ActionDispatch::Flash::RequestMethods + # source://actionpack//lib/action_dispatch/middleware/flash.rb#71 + def commit_flash; end + + # Access the contents of the flash. Returns a ActionDispatch::Flash::FlashHash. + # + # See ActionDispatch::Flash for example usage. + # + # source://actionpack//lib/action_dispatch/middleware/flash.rb#57 + def flash; end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#63 + def flash=(flash); end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#67 + def flash_hash; end + + # source://actionpack//lib/action_dispatch/middleware/flash.rb#84 + def reset_session; end +end + +# # Action Dispatch HostAuthorization +# +# This middleware guards from DNS rebinding attacks by explicitly permitting the +# hosts a request can be sent to, and is passed the options set in +# `config.host_authorization`. +# +# Requests can opt-out of Host Authorization with `exclude`: +# +# config.host_authorization = { exclude: ->(request) { request.path =~ /healthcheck/ } } +# +# When a request comes to an unauthorized host, the `response_app` application +# will be executed and rendered. If no `response_app` is given, a default one +# will run. The default response app logs blocked host info with level 'error' +# and responds with `403 Forbidden`. The body of the response contains debug +# info if `config.consider_all_requests_local` is set to true, otherwise the +# body is empty. +# +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#22 +class ActionDispatch::HostAuthorization + # @return [HostAuthorization] a new instance of HostAuthorization + # + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#127 + def initialize(app, hosts, exclude: T.unsafe(nil), response_app: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#135 + def call(env); end + + private + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#151 + def blocked_hosts(request); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#163 + def excluded?(request); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#167 + def mark_as_authorized(request); end +end + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#23 +ActionDispatch::HostAuthorization::ALLOWED_HOSTS_IN_DEVELOPMENT = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#88 +class ActionDispatch::HostAuthorization::DefaultResponseApp + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#91 + def call(env); end + + private + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#122 + def available_logger(request); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#114 + def log_error(request); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#107 + def response(format, body); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#100 + def response_body(request); end +end + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#89 +ActionDispatch::HostAuthorization::DefaultResponseApp::RESPONSE_STATUS = T.let(T.unsafe(nil), Integer) + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#26 +ActionDispatch::HostAuthorization::IPV4_HOSTNAME = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#27 +ActionDispatch::HostAuthorization::IPV6_HOSTNAME = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#28 +ActionDispatch::HostAuthorization::IPV6_HOSTNAME_WITH_PORT = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#24 +ActionDispatch::HostAuthorization::PORT_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#35 +class ActionDispatch::HostAuthorization::Permissions + # @return [Permissions] a new instance of Permissions + # + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#36 + def initialize(hosts); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#44 + def allows?(host); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#40 + def empty?; end + + private + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#83 + def extract_hostname(host); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#61 + def sanitize_hosts(hosts); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#71 + def sanitize_regexp(host); end + + # source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#75 + def sanitize_string(host); end +end + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#25 +ActionDispatch::HostAuthorization::SUBDOMAIN_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/middleware/host_authorization.rb#29 +ActionDispatch::HostAuthorization::VALID_IP_HOSTNAME = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch.rb#95 +module ActionDispatch::Http + extend ::ActiveSupport::Autoload +end + +# source://actionpack//lib/action_dispatch/http/cache.rb#7 +module ActionDispatch::Http::Cache; end + +# source://actionpack//lib/action_dispatch/http/cache.rb#8 +module ActionDispatch::Http::Cache::Request + # source://actionpack//lib/action_dispatch/http/cache.rb#67 + def cache_control_directives; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#32 + def etag_matches?(etag); end + + # Check response freshness (`Last-Modified` and `ETag`) against request + # `If-Modified-Since` and `If-None-Match` conditions. + # If both headers are supplied, based on configuration, either `ETag` is preferred over `Last-Modified` + # or both are considered equally. You can adjust the preference with + # `config.action_dispatch.strict_freshness`. + # Reference: http://tools.ietf.org/html/rfc7232#section-6 + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#45 + def fresh?(response); end + + # source://actionpack//lib/action_dispatch/http/cache.rb#14 + def if_modified_since; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#20 + def if_none_match; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#24 + def if_none_match_etags; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#28 + def not_modified?(modified_at); end + + # source://actionpack//lib/action_dispatch/http/cache.rb#12 + def strict_freshness; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#12 + def strict_freshness=(val); end + + class << self + # source://actionpack//lib/action_dispatch/http/cache.rb#12 + def strict_freshness; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#12 + def strict_freshness=(val); end + end +end + +# Represents the HTTP Cache-Control header for requests, +# providing methods to access various cache control directives +# Reference: https://www.rfc-editor.org/rfc/rfc9111.html#name-request-directives +# +# source://actionpack//lib/action_dispatch/http/cache.rb#74 +class ActionDispatch::Http::Cache::Request::CacheControlDirectives + # @return [CacheControlDirectives] a new instance of CacheControlDirectives + # + # source://actionpack//lib/action_dispatch/http/cache.rb#75 + def initialize(cache_control_header); end + + # Returns the value of the max-age directive. + # This directive indicates that the client is willing to accept a response + # whose age is no greater than the specified number of seconds. + # + # source://actionpack//lib/action_dispatch/http/cache.rb#118 + def max_age; end + + # Returns the value of the max-stale directive. + # When max-stale is present with a value, returns that integer value. + # When max-stale is present without a value, returns true (unlimited staleness). + # When max-stale is not present, returns nil. + # + # source://actionpack//lib/action_dispatch/http/cache.rb#124 + def max_stale; end + + # Returns true if max-stale directive is present (with or without a value) + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#127 + def max_stale?; end + + # Returns true if max-stale directive is present without a value (unlimited staleness) + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#132 + def max_stale_unlimited?; end + + # Returns the value of the min-fresh directive. + # This directive indicates that the client is willing to accept a response + # whose freshness lifetime is no less than its current age plus the specified time in seconds. + # + # source://actionpack//lib/action_dispatch/http/cache.rb#139 + def min_fresh; end + + # Returns true if the no-cache directive is present. + # This directive indicates that a cache must not use the response + # to satisfy subsequent requests without successful validation on the origin server. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#98 + def no_cache?; end + + # Returns true if the no-store directive is present. + # This directive indicates that a cache must not store any part of the + # request or response. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#105 + def no_store?; end + + # Returns true if the no-transform directive is present. + # This directive indicates that a cache or proxy must not transform the payload. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#111 + def no_transform?; end + + # Returns true if the only-if-cached directive is present. + # This directive indicates that the client only wishes to obtain a + # stored response. If a valid stored response is not available, + # the server should respond with a 504 (Gateway Timeout) status. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#91 + def only_if_cached?; end + + # Returns the value of the stale-if-error directive. + # This directive indicates that the client is willing to accept a stale response + # if the check for a fresh one fails with an error for the specified number of seconds. + # + # source://actionpack//lib/action_dispatch/http/cache.rb#144 + def stale_if_error; end + + private + + # source://actionpack//lib/action_dispatch/http/cache.rb#147 + def parse_directives(header_value); end +end + +# source://actionpack//lib/action_dispatch/http/cache.rb#9 +ActionDispatch::Http::Cache::Request::HTTP_IF_MODIFIED_SINCE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#10 +ActionDispatch::Http::Cache::Request::HTTP_IF_NONE_MATCH = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#176 +module ActionDispatch::Http::Cache::Response + # Returns the value of attribute cache_control. + # + # source://actionpack//lib/action_dispatch/http/cache.rb#177 + def cache_control; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#193 + def date; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#203 + def date=(utc_time); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#199 + def date?; end + + # This method sets a weak ETag validator on the response so browsers and proxies + # may cache the response, keyed on the ETag. On subsequent requests, the + # `If-None-Match` header is set to the cached ETag. If it matches the current + # ETag, we can return a `304 Not Modified` response with no body, letting the + # browser or proxy know that their cache is current. Big savings in request time + # and network bandwidth. + # + # Weak ETags are considered to be semantically equivalent but not byte-for-byte + # identical. This is perfect for browser caching of HTML pages where we don't + # care about exact equality, just what the user is viewing. + # + # Strong ETags are considered byte-for-byte identical. They allow a browser or + # proxy cache to support `Range` requests, useful for paging through a PDF file + # or scrubbing through a video. Some CDNs only support strong ETags and will + # ignore weak ETags entirely. + # + # Weak ETags are what we almost always need, so they're the default. Check out + # #strong_etag= to provide a strong ETag validator. + # + # source://actionpack//lib/action_dispatch/http/cache.rb#225 + def etag=(weak_validators); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#237 + def etag?; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#179 + def last_modified; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#189 + def last_modified=(utc_time); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#185 + def last_modified?; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#233 + def strong_etag=(strong_validators); end + + # True if an ETag is set, and it isn't a weak validator (not preceded with + # `W/`). + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#246 + def strong_etag?; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#229 + def weak_etag=(weak_validators); end + + # True if an ETag is set, and it's a weak validator (preceded with `W/`). + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/cache.rb#240 + def weak_etag?; end + + private + + # source://actionpack//lib/action_dispatch/http/cache.rb#269 + def cache_control_headers; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#263 + def cache_control_segments; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#259 + def generate_strong_etag(validators); end + + # source://actionpack//lib/action_dispatch/http/cache.rb#255 + def generate_weak_etag(validators); end + + # source://actionpack//lib/action_dispatch/http/cache.rb#300 + def handle_conditional_get!; end + + # source://actionpack//lib/action_dispatch/http/cache.rb#309 + def merge_and_normalize_cache_control!(cache_control); end + + # source://actionpack//lib/action_dispatch/http/cache.rb#287 + def prepare_cache_control!; end +end + +# source://actionpack//lib/action_dispatch/http/cache.rb#251 +ActionDispatch::Http::Cache::Response::DATE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#291 +ActionDispatch::Http::Cache::Response::DEFAULT_CACHE_CONTROL = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#297 +ActionDispatch::Http::Cache::Response::IMMUTABLE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#252 +ActionDispatch::Http::Cache::Response::LAST_MODIFIED = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#296 +ActionDispatch::Http::Cache::Response::MUST_REVALIDATE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#298 +ActionDispatch::Http::Cache::Response::MUST_UNDERSTAND = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#293 +ActionDispatch::Http::Cache::Response::NO_CACHE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#292 +ActionDispatch::Http::Cache::Response::NO_STORE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#295 +ActionDispatch::Http::Cache::Response::PRIVATE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#294 +ActionDispatch::Http::Cache::Response::PUBLIC = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/cache.rb#253 +ActionDispatch::Http::Cache::Response::SPECIAL_KEYS = T.let(T.unsafe(nil), Set) + +# source://actionpack//lib/action_dispatch/http/content_disposition.rb#7 +class ActionDispatch::Http::ContentDisposition + # @return [ContentDisposition] a new instance of ContentDisposition + # + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#14 + def initialize(disposition:, filename:); end + + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#21 + def ascii_filename; end + + # Returns the value of attribute disposition. + # + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#12 + def disposition; end + + # Returns the value of attribute filename. + # + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#12 + def filename; end + + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#31 + def to_s; end + + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#27 + def utf8_filename; end + + private + + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#40 + def percent_escape(string, pattern); end + + class << self + # source://actionpack//lib/action_dispatch/http/content_disposition.rb#8 + def format(disposition:, filename:); end + end +end + +# source://actionpack//lib/action_dispatch/http/content_disposition.rb#25 +ActionDispatch::Http::ContentDisposition::RFC_5987_ESCAPED_CHAR = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/http/content_disposition.rb#19 +ActionDispatch::Http::ContentDisposition::TRADITIONAL_ESCAPED_CHAR = T.let(T.unsafe(nil), Regexp) + +# # Action Dispatch HTTP Filter Parameters +# +# Allows you to specify sensitive query string and POST parameters to filter +# from the request log. +# +# # Replaces values with "[FILTERED]" for keys that match /foo|bar/i. +# env["action_dispatch.parameter_filter"] = [:foo, "bar"] +# +# For more information about filter behavior, see +# ActiveSupport::ParameterFilter. +# +# source://actionpack//lib/action_dispatch/http/filter_parameters.rb#19 +module ActionDispatch::Http::FilterParameters + # :startdoc: + # + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#26 + def initialize; end + + # Returns a hash of request.env with all sensitive data replaced. + # + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#42 + def filtered_env; end + + # Returns a hash of parameters with all sensitive data replaced. + # + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#35 + def filtered_parameters; end + + # Reconstructs a path with all sensitive GET parameters replaced. + # + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#47 + def filtered_path; end + + # Returns the `ActiveSupport::ParameterFilter` object used to filter in this + # request. + # + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#53 + def parameter_filter; end + + private + + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#62 + def env_filter; end + + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#73 + def filtered_query_string; end + + # source://actionpack//lib/action_dispatch/http/filter_parameters.rb#69 + def parameter_filter_for(filters); end +end + +# :stopdoc: +# +# source://actionpack//lib/action_dispatch/http/filter_parameters.rb#21 +ActionDispatch::Http::FilterParameters::ENV_MATCH = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/filter_parameters.rb#23 +ActionDispatch::Http::FilterParameters::NULL_ENV_FILTER = T.let(T.unsafe(nil), ActiveSupport::ParameterFilter) + +# source://actionpack//lib/action_dispatch/http/filter_parameters.rb#22 +ActionDispatch::Http::FilterParameters::NULL_PARAM_FILTER = T.let(T.unsafe(nil), ActiveSupport::ParameterFilter) + +# source://actionpack//lib/action_dispatch/http/filter_redirect.rb#7 +module ActionDispatch::Http::FilterRedirect + # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#10 + def filtered_location; end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#27 + def location_filter_match?; end + + # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#19 + def location_filters; end + + # source://actionpack//lib/action_dispatch/http/filter_redirect.rb#37 + def parameter_filtered_location; end +end + +# source://actionpack//lib/action_dispatch/http/filter_redirect.rb#8 +ActionDispatch::Http::FilterRedirect::FILTERED = T.let(T.unsafe(nil), String) + +# # Action Dispatch HTTP Headers +# +# Provides access to the request's HTTP headers from the environment. +# +# env = { "CONTENT_TYPE" => "text/plain", "HTTP_USER_AGENT" => "curl/7.43.0" } +# headers = ActionDispatch::Http::Headers.from_hash(env) +# headers["Content-Type"] # => "text/plain" +# headers["User-Agent"] # => "curl/7.43.0" +# +# Also note that when headers are mapped to CGI-like variables by the Rack +# server, both dashes and underscores are converted to underscores. This +# ambiguity cannot be resolved at this stage anymore. Both underscores and +# dashes have to be interpreted as if they were originally sent as dashes. +# +# # GET / HTTP/1.1 +# # ... +# # User-Agent: curl/7.43.0 +# # X_Custom_Header: token +# +# headers["X_Custom_Header"] # => nil +# headers["X-Custom-Header"] # => "token" +# +# source://actionpack//lib/action_dispatch/http/headers.rb#28 +class ActionDispatch::Http::Headers + include ::Enumerable + + # @return [Headers] a new instance of Headers + # + # source://actionpack//lib/action_dispatch/http/headers.rb#58 + def initialize(request); end + + # Returns the value for the given key mapped to @env. + # + # source://actionpack//lib/action_dispatch/http/headers.rb#63 + def [](key); end + + # Sets the given value for the key mapped to @env. + # + # source://actionpack//lib/action_dispatch/http/headers.rb#68 + def []=(key, value); end + + # Add a value to a multivalued header like `Vary` or `Accept-Encoding`. + # + # source://actionpack//lib/action_dispatch/http/headers.rb#73 + def add(key, value); end + + # source://actionpack//lib/action_dispatch/http/headers.rb#98 + def each(&block); end + + # source://actionpack//lib/action_dispatch/http/headers.rb#118 + def env; end + + # Returns the value for the given key mapped to @env. + # + # If the key is not found and an optional code block is not provided, raises a + # `KeyError` exception. + # + # If the code block is provided, then it will be run and its result returned. + # + # source://actionpack//lib/action_dispatch/http/headers.rb#90 + def fetch(key, default = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/headers.rb#80 + def include?(key); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/headers.rb#77 + def key?(key); end + + # Returns a new Http::Headers instance containing the contents of + # `headers_or_env` and the original instance. + # + # source://actionpack//lib/action_dispatch/http/headers.rb#104 + def merge(headers_or_env); end + + # Adds the contents of `headers_or_env` to original instance entries; duplicate + # keys are overwritten with the values from `headers_or_env`. + # + # source://actionpack//lib/action_dispatch/http/headers.rb#112 + def merge!(headers_or_env); end + + private + + # Converts an HTTP header name to an environment variable name if it is not + # contained within the headers hash. + # + # source://actionpack//lib/action_dispatch/http/headers.rb#123 + def env_name(key); end + + class << self + # source://actionpack//lib/action_dispatch/http/headers.rb#54 + def from_hash(hash); end + end +end + +# source://actionpack//lib/action_dispatch/http/headers.rb#29 +ActionDispatch::Http::Headers::CGI_VARIABLES = T.let(T.unsafe(nil), Set) + +# source://actionpack//lib/action_dispatch/http/headers.rb#82 +ActionDispatch::Http::Headers::DEFAULT = T.let(T.unsafe(nil), Object) + +# source://actionpack//lib/action_dispatch/http/headers.rb#50 +ActionDispatch::Http::Headers::HTTP_HEADER = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#9 +module ActionDispatch::Http::MimeNegotiation + extend ::ActiveSupport::Concern + + # Returns the accepted MIME type for the request. + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#42 + def accepts; end + + # The MIME type of the HTTP request, such as [Mime](:xml). + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#24 + def content_mime_type; end + + # Returns the MIME type for the format used in the request. + # + # # GET /posts/5.xml + # request.format # => Mime[:xml] + # + # # GET /posts/5.xhtml + # request.format # => Mime[:html] + # + # # GET /posts/5 + # request.format # => Mime[:html] or Mime[:js], or request.accepts.first + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#68 + def format(_view_path = T.unsafe(nil)); end + + # Sets the format by string extension, which can be used to force custom formats + # that are not controlled by the extension. + # + # class ApplicationController < ActionController::Base + # before_action :adjust_format_for_iphone + # + # private + # def adjust_format_for_iphone + # request.format = :iphone if request.env["HTTP_USER_AGENT"][/iPhone/] + # end + # end + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#174 + def format=(extension); end + + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#72 + def formats; end + + # Sets the formats by string extensions. This differs from #format= by allowing + # you to set multiple, ordered formats, which is useful when you want to have a + # fallback. + # + # In this example, the `:iphone` format will be used if it's available, + # otherwise it'll fall back to the `:html` format. + # + # class ApplicationController < ActionController::Base + # before_action :adjust_format_for_iphone_with_html_fallback + # + # private + # def adjust_format_for_iphone_with_html_fallback + # request.formats = [ :iphone, :html ] if request.env["HTTP_USER_AGENT"][/iPhone/] + # end + # end + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#194 + def formats=(extensions); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#37 + def has_content_type?; end + + # Returns the first MIME type that matches the provided array of MIME types. + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#202 + def negotiate_mime(order); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#214 + def should_apply_vary_header?; end + + # Returns the \variant for the response template as an instance of + # ActiveSupport::ArrayInquirer. + # + # request.variant = :phone + # request.variant.phone? # => true + # request.variant.tablet? # => false + # + # request.variant = [:phone, :tablet] + # request.variant.phone? # => true + # request.variant.desktop? # => false + # request.variant.any?(:phone, :desktop) # => true + # request.variant.any?(:desktop, :watch) # => false + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#159 + def variant; end + + # Sets the \variant for the response template. + # + # When determining which template to render, Action View will incorporate + # all variants from the request. For example, if an + # `ArticlesController#index` action needs to respond to + # `request.variant = [:ios, :turbo_native]`, it will render the + # first template file it can find in the following list: + # + # - `app/views/articles/index.html+ios.erb` + # - `app/views/articles/index.html+turbo_native.erb` + # - `app/views/articles/index.html.erb` + # + # Variants add context to the requests that views render appropriately. + # Variant names are arbitrary, and can communicate anything from the + # request's platform (`:android`, `:ios`, `:linux`, `:macos`, `:windows`) + # to its browser (`:chrome`, `:edge`, `:firefox`, `:safari`), to the type + # of user (`:admin`, `:guest`, `:user`). + # + # Note: Adding many new variant templates with similarities to existing + # template files can make maintaining your view code more difficult. + # + # #### Parameters + # + # * `variant` - a symbol name or an array of symbol names for variants + # used to render the response template + # + # #### Examples + # + # class ApplicationController < ActionController::Base + # before_action :determine_variants + # + # private + # def determine_variants + # variants = [] + # + # # some code to determine the variant(s) to use + # + # variants << :ios if request.user_agent.include?("iOS") + # variants << :turbo_native if request.user_agent.include?("Turbo Native") + # + # request.variant = variants + # end + # end + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#137 + def variant=(variant); end + + private + + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#238 + def format_from_path_extension; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#223 + def params_readable?; end + + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#234 + def use_accept_header; end + + # source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#229 + def valid_accept_header; end +end + +# We use normal content negotiation unless you include **/** in your list, in +# which case we assume you're a browser and send HTML. +# +# source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#221 +ActionDispatch::Http::MimeNegotiation::BROWSER_LIKE_ACCEPTS = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#12 +class ActionDispatch::Http::MimeNegotiation::InvalidType < ::Mime::Type::InvalidMimeType; end + +# source://actionpack//lib/action_dispatch/http/mime_negotiation.rb#14 +ActionDispatch::Http::MimeNegotiation::RESCUABLE_MIME_FORMAT_ERRORS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/parameters.rb#7 +module ActionDispatch::Http::Parameters + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionDispatch::Http::Parameters::ClassMethods + + # Returns both GET and POST parameters in a single hash. + # + # source://actionpack//lib/action_dispatch/http/parameters.rb#52 + def parameters; end + + # Returns both GET and POST parameters in a single hash. + # + # source://actionpack//lib/action_dispatch/http/parameters.rb#65 + def params; end + + # Returns a hash with the parameters used to form the path of the request. + # Returned hash keys are symbols: + # + # { action: "my_action", controller: "my_controller" } + # + # source://actionpack//lib/action_dispatch/http/parameters.rb#84 + def path_parameters; end + + # source://actionpack//lib/action_dispatch/http/parameters.rb#67 + def path_parameters=(parameters); end + + private + + # source://actionpack//lib/action_dispatch/http/parameters.rb#102 + def log_parse_error_once; end + + # source://actionpack//lib/action_dispatch/http/parameters.rb#114 + def params_parsers; end + + # source://actionpack//lib/action_dispatch/http/parameters.rb#89 + def parse_formatted_parameters(parsers); end +end + +# source://actionpack//lib/action_dispatch/http/parameters.rb#36 +module ActionDispatch::Http::Parameters::ClassMethods + # Configure the parameter parser for a given MIME type. + # + # It accepts a hash where the key is the symbol of the MIME type and the value + # is a proc. + # + # original_parsers = ActionDispatch::Request.parameter_parsers + # xml_parser = -> (raw_post) { Hash.from_xml(raw_post) || {} } + # new_parsers = original_parsers.merge(xml: xml_parser) + # ActionDispatch::Request.parameter_parsers = new_parsers + # + # source://actionpack//lib/action_dispatch/http/parameters.rb#46 + def parameter_parsers=(parsers); end +end + +# source://actionpack//lib/action_dispatch/http/parameters.rb#12 +ActionDispatch::Http::Parameters::DEFAULT_PARSERS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/parameters.rb#10 +ActionDispatch::Http::Parameters::PARAMETERS_KEY = T.let(T.unsafe(nil), String) + +# Raised when raw data from the request cannot be parsed by the parser defined +# for request's content MIME type. +# +# source://actionpack//lib/action_dispatch/http/parameters.rb#21 +class ActionDispatch::Http::Parameters::ParseError < ::StandardError + # @return [ParseError] a new instance of ParseError + # + # source://actionpack//lib/action_dispatch/http/parameters.rb#22 + def initialize(message = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/http/url.rb#9 +module ActionDispatch::Http::URL + # source://actionpack//lib/action_dispatch/http/url.rb#277 + def initialize; end + + # Returns the domain part of a host, such as "rubyonrails.org" in + # "www.rubyonrails.org". You can specify a different `tld_length`, such as 2 to + # catch rubyonrails.co.uk in "www.rubyonrails.co.uk". + # + # source://actionpack//lib/action_dispatch/http/url.rb#420 + def domain(tld_length = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/url.rb#112 + def domain_extractor; end + + # source://actionpack//lib/action_dispatch/http/url.rb#112 + def domain_extractor=(val); end + + # Returns the host for this request, such as "example.com". + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.host # => "example.com" + # + # source://actionpack//lib/action_dispatch/http/url.rb#324 + def host; end + + # Returns a host:port string for this request, such as "example.com" or + # "example.com:8080". Port is only included if it is not a default port (80 or + # 443) + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.host_with_port # => "example.com" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.host_with_port # => "example.com" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.host_with_port # => "example.com:8080" + # + # source://actionpack//lib/action_dispatch/http/url.rb#340 + def host_with_port; end + + # Returns a number port suffix like 8080 if the port number of this request is + # not the default HTTP port 80 or HTTPS port 443. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.optional_port # => nil + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.optional_port # => 8080 + # + # source://actionpack//lib/action_dispatch/http/url.rb#390 + def optional_port; end + + # Returns the port number of this request as an integer. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.port # => 80 + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.port # => 8080 + # + # source://actionpack//lib/action_dispatch/http/url.rb#351 + def port; end + + # Returns a string port suffix, including colon, like ":8080" if the port number + # of this request is not the default HTTP port 80 or HTTPS port 443. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.port_string # => "" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.port_string # => ":8080" + # + # source://actionpack//lib/action_dispatch/http/url.rb#402 + def port_string; end + + # Returns 'https://' if this is an SSL request and 'http://' otherwise. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.protocol # => "http://" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com', 'HTTPS' => 'on' + # req.protocol # => "https://" + # + # source://actionpack//lib/action_dispatch/http/url.rb#298 + def protocol; end + + # Returns the host and port for this request, such as "example.com:8080". + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.raw_host_with_port # => "example.com" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.raw_host_with_port # => "example.com:80" + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.raw_host_with_port # => "example.com:8080" + # + # source://actionpack//lib/action_dispatch/http/url.rb#312 + def raw_host_with_port; end + + # source://actionpack//lib/action_dispatch/http/url.rb#110 + def secure_protocol; end + + # source://actionpack//lib/action_dispatch/http/url.rb#110 + def secure_protocol=(val); end + + # Returns the requested port, such as 8080, based on SERVER_PORT. + # + # req = ActionDispatch::Request.new 'SERVER_PORT' => '80' + # req.server_port # => 80 + # + # req = ActionDispatch::Request.new 'SERVER_PORT' => '8080' + # req.server_port # => 8080 + # + # source://actionpack//lib/action_dispatch/http/url.rb#413 + def server_port; end + + # Returns the standard port number for this request's protocol. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.standard_port # => 80 + # + # source://actionpack//lib/action_dispatch/http/url.rb#363 + def standard_port; end + + # Returns whether this request is using the standard port. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:80' + # req.standard_port? # => true + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.standard_port? # => false + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/url.rb#378 + def standard_port?; end + + # Returns all the subdomains as a string, so `"dev.www"` would be returned for + # "dev.www.rubyonrails.org". You can specify a different `tld_length`, such as 2 + # to catch `"www"` instead of `"www.rubyonrails"` in "www.rubyonrails.co.uk". + # + # source://actionpack//lib/action_dispatch/http/url.rb#435 + def subdomain(tld_length = T.unsafe(nil)); end + + # Returns all the subdomains as an array, so `["dev", "www"]` would be returned + # for "dev.www.rubyonrails.org". You can specify a different `tld_length`, such + # as 2 to catch `["www"]` instead of `["www", "rubyonrails"]` in + # "www.rubyonrails.co.uk". + # + # source://actionpack//lib/action_dispatch/http/url.rb#428 + def subdomains(tld_length = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/url.rb#111 + def tld_length; end + + # source://actionpack//lib/action_dispatch/http/url.rb#111 + def tld_length=(val); end + + # Returns the complete URL used for this request. + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com' + # req.url # => "http://example.com" + # + # source://actionpack//lib/action_dispatch/http/url.rb#287 + def url; end + + class << self + # source://actionpack//lib/action_dispatch/http/url.rb#112 + def domain_extractor; end + + # source://actionpack//lib/action_dispatch/http/url.rb#112 + def domain_extractor=(val); end + + # Returns the domain part of a host given the domain level. + # + # # Top-level domain example + # extract_domain('www.example.com', 1) # => "example.com" + # # Second-level domain example + # extract_domain('dev.www.example.co.uk', 2) # => "example.co.uk" + # + # source://actionpack//lib/action_dispatch/http/url.rb#121 + def extract_domain(host, tld_length); end + + # Returns the subdomains of a host as a String given the domain level. + # + # # Top-level domain example + # extract_subdomain('www.example.com', 1) # => "www" + # # Second-level domain example + # extract_subdomain('dev.www.example.co.uk', 2) # => "dev.www" + # + # source://actionpack//lib/action_dispatch/http/url.rb#145 + def extract_subdomain(host, tld_length); end + + # Returns the subdomains of a host as an Array given the domain level. + # + # # Top-level domain example + # extract_subdomains('www.example.com', 1) # => ["www"] + # # Second-level domain example + # extract_subdomains('dev.www.example.co.uk', 2) # => ["dev", "www"] + # + # source://actionpack//lib/action_dispatch/http/url.rb#131 + def extract_subdomains(host, tld_length); end + + # source://actionpack//lib/action_dispatch/http/url.rb#157 + def full_url_for(options); end + + # source://actionpack//lib/action_dispatch/http/url.rb#169 + def path_for(options); end + + # source://actionpack//lib/action_dispatch/http/url.rb#110 + def secure_protocol; end + + # source://actionpack//lib/action_dispatch/http/url.rb#110 + def secure_protocol=(val); end + + # source://actionpack//lib/action_dispatch/http/url.rb#111 + def tld_length; end + + # source://actionpack//lib/action_dispatch/http/url.rb#111 + def tld_length=(val); end + + # source://actionpack//lib/action_dispatch/http/url.rb#149 + def url_for(options); end + + private + + # source://actionpack//lib/action_dispatch/http/url.rb#189 + def add_anchor(path, anchor); end + + # source://actionpack//lib/action_dispatch/http/url.rb#182 + def add_params(path, params); end + + # source://actionpack//lib/action_dispatch/http/url.rb#203 + def build_host_url(host, port, protocol, options, path); end + + # source://actionpack//lib/action_dispatch/http/url.rb#195 + def extract_domain_from(host, tld_length); end + + # source://actionpack//lib/action_dispatch/http/url.rb#199 + def extract_subdomains_from(host, tld_length); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/url.rb#227 + def named_host?(host); end + + # source://actionpack//lib/action_dispatch/http/url.rb#244 + def normalize_host(_host, options); end + + # source://actionpack//lib/action_dispatch/http/url.rb#264 + def normalize_port(port, protocol); end + + # source://actionpack//lib/action_dispatch/http/url.rb#231 + def normalize_protocol(protocol); end + end +end + +# DomainExtractor provides utility methods for extracting domain and subdomain +# information from host strings. This module is used internally by Action Dispatch +# to parse host names and separate the domain from subdomains based on the +# top-level domain (TLD) length. +# +# The module assumes a standard domain structure where domains consist of: +# - Subdomains (optional, can be multiple levels) +# - Domain name +# - Top-level domain (TLD, can be multiple levels like .co.uk) +# +# For example, in "api.staging.example.co.uk": +# - Subdomains: ["api", "staging"] +# - Domain: "example.co.uk" (with tld_length=2) +# - TLD: "co.uk" +# +# source://actionpack//lib/action_dispatch/http/url.rb#28 +module ActionDispatch::Http::URL::DomainExtractor + extend ::ActionDispatch::Http::URL::DomainExtractor + + # Extracts the domain part from a host string, including the specified + # number of top-level domain components. + # + # The domain includes the main domain name plus the TLD components. + # The +tld_length+ parameter specifies how many components from the right + # should be considered part of the TLD. + # + # ==== Parameters + # + # [+host+] + # The host string to extract the domain from. + # + # [+tld_length+] + # The number of domain components that make up the TLD. For example, + # use 1 for ".com" or 2 for ".co.uk". + # + # ==== Examples + # + # # Standard TLD (tld_length = 1) + # DomainExtractor.domain_from("www.example.com", 1) + # # => "example.com" + # + # # Country-code TLD (tld_length = 2) + # DomainExtractor.domain_from("www.example.co.uk", 2) + # # => "example.co.uk" + # + # # Multiple subdomains + # DomainExtractor.domain_from("api.staging.myapp.herokuapp.com", 1) + # # => "herokuapp.com" + # + # # Single component (returns the host itself) + # DomainExtractor.domain_from("localhost", 1) + # # => "localhost" + # + # source://actionpack//lib/action_dispatch/http/url.rb#64 + def domain_from(host, tld_length); end + + # Extracts the subdomain components from a host string as an Array. + # + # Returns all the components that come before the domain and TLD parts. + # The +tld_length+ parameter is used to determine where the domain begins + # so that everything before it is considered a subdomain. + # + # ==== Parameters + # + # [+host+] + # The host string to extract subdomains from. + # + # [+tld_length+] + # The number of domain components that make up the TLD. This affects + # where the domain boundary is calculated. + # + # ==== Examples + # + # # Standard TLD (tld_length = 1) + # DomainExtractor.subdomains_from("www.example.com", 1) + # # => ["www"] + # + # # Country-code TLD (tld_length = 2) + # DomainExtractor.subdomains_from("api.staging.example.co.uk", 2) + # # => ["api", "staging"] + # + # # No subdomains + # DomainExtractor.subdomains_from("example.com", 1) + # # => [] + # + # # Single subdomain with complex TLD + # DomainExtractor.subdomains_from("www.mysite.co.uk", 2) + # # => ["www"] + # + # # Multiple levels of subdomains + # DomainExtractor.subdomains_from("dev.api.staging.example.com", 1) + # # => ["dev", "api", "staging"] + # + # source://actionpack//lib/action_dispatch/http/url.rb#104 + def subdomains_from(host, tld_length); end +end + +# source://actionpack//lib/action_dispatch/http/url.rb#11 +ActionDispatch::Http::URL::HOST_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/http/url.rb#10 +ActionDispatch::Http::URL::IP_HOST_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/http/url.rb#12 +ActionDispatch::Http::URL::PROTOCOL_REGEXP = T.let(T.unsafe(nil), Regexp) + +# # Action Dispatch HTTP UploadedFile +# +# Models uploaded files. +# +# The actual file is accessible via the `tempfile` accessor, though some of its +# interface is available directly for convenience. +# +# Uploaded files are temporary files whose lifespan is one request. When the +# object is finalized Ruby unlinks the file, so there is no need to clean them +# with a separate maintenance task. +# +# source://actionpack//lib/action_dispatch/http/upload.rb#17 +class ActionDispatch::Http::UploadedFile + # @raise [ArgumentError] + # @return [UploadedFile] a new instance of UploadedFile + # + # source://actionpack//lib/action_dispatch/http/upload.rb#31 + def initialize(hash); end + + # Shortcut for `tempfile.close`. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#73 + def close(unlink_now = T.unsafe(nil)); end + + # A string with the MIME type of the file. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#22 + def content_type; end + + # A string with the MIME type of the file. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#22 + def content_type=(_arg0); end + + # Shortcut for `tempfile.eof?`. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/upload.rb#98 + def eof?; end + + # A string with the headers of the multipart request. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#29 + def headers; end + + # A string with the headers of the multipart request. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#29 + def headers=(_arg0); end + + # Shortcut for `tempfile.open`. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#68 + def open; end + + # The basename of the file in the client. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#19 + def original_filename; end + + # The basename of the file in the client. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#19 + def original_filename=(_arg0); end + + # Shortcut for `tempfile.path`. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#78 + def path; end + + # Shortcut for `tempfile.read`. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#63 + def read(length = T.unsafe(nil), buffer = T.unsafe(nil)); end + + # Shortcut for `tempfile.rewind`. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#88 + def rewind; end + + # Shortcut for `tempfile.size`. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#93 + def size; end + + # A `Tempfile` object with the actual uploaded file. Note that some of its + # interface is available directly. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#26 + def tempfile; end + + # A `Tempfile` object with the actual uploaded file. Note that some of its + # interface is available directly. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#26 + def tempfile=(_arg0); end + + # source://actionpack//lib/action_dispatch/http/upload.rb#102 + def to_io; end + + # Shortcut for `tempfile.to_path`. + # + # source://actionpack//lib/action_dispatch/http/upload.rb#83 + def to_path; end +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#14 +module ActionDispatch::Integration; end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#15 +module ActionDispatch::Integration::RequestHelpers + # Performs a DELETE request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#42 + def delete(path, **args); end + + # Follow a single redirect response. If the last response was not a redirect, an + # exception will be raised. Otherwise, the redirect is performed on the location + # header. If the redirection is a 307 or 308 redirect, the same HTTP verb will + # be used when redirecting, otherwise a GET request will be performed. Any + # arguments are passed to the underlying request. + # + # The HTTP_REFERER header will be set to the previous url. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#65 + def follow_redirect!(headers: T.unsafe(nil), **args); end + + # Performs a GET request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#18 + def get(path, **args); end + + # Performs a HEAD request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#48 + def head(path, **args); end + + # Performs an OPTIONS request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#54 + def options(path, **args); end + + # Performs a PATCH request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#30 + def patch(path, **args); end + + # Performs a POST request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#24 + def post(path, **args); end + + # Performs a PUT request with the given parameters. See + # ActionDispatch::Integration::Session#process for more details. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#36 + def put(path, **args); end +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#334 +module ActionDispatch::Integration::Runner + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + extend ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # source://actionpack//lib/action_dispatch/testing/integration.rb#342 + def initialize(*args, &blk); end + + # Returns the value of attribute app. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#339 + def app; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#412 + def assertions; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#416 + def assertions=(assertions); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def assigns(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#347 + def before_setup; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def cookies(*_arg0, **_arg1, &_arg2); end + + # Copy the instance variables from the current session instance into the test + # instance. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#422 + def copy_session_variables!; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#362 + def create_session(app); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#428 + def default_url_options; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#432 + def default_url_options=(options); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def delete(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def follow_redirect!(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def get(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def head(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#352 + def integration_session; end + + # Open a new session instance. If a block is given, the new session is yielded + # to the block before being returned. + # + # session = open_session do |sess| + # sess.extend(CustomAssertions) + # end + # + # By default, a single session is automatically created for you, but you can use + # this method to open multiple sessions that ought to be tested simultaneously. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#404 + def open_session; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def patch(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def post(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#384 + def put(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#374 + def remove!; end + + # Reset the current session. This is useful for testing multiple sessions in a + # single test case. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#358 + def reset!; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#340 + def root_session; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#340 + def root_session=(_arg0); end + + private + + # Delegate unhandled messages to the current session instance. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#442 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#437 + def respond_to_missing?(method, _); end +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#337 +ActionDispatch::Integration::Runner::APP_SESSIONS = T.let(T.unsafe(nil), Hash) + +# An instance of this class represents a set of requests and responses performed +# sequentially by a test process. Because you can instantiate multiple sessions +# and run them side-by-side, you can also mimic (to some limited extent) +# multiple simultaneous users interacting with your system. +# +# Typically, you will instantiate a new session using Runner#open_session, +# rather than instantiating a Session directly. +# +# source://actionpack//lib/action_dispatch/testing/integration.rb#91 +class ActionDispatch::Integration::Session + include ::Minitest::Assertions + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + include ::ActionDispatch::Integration::RequestHelpers + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + extend ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + + # Create and initialize a new Session instance. + # + # @return [Session] a new instance of Session + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#133 + def initialize(app); end + + # The Accept header to send. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#110 + def accept; end + + # The Accept header to send. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#110 + def accept=(_arg0); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#97 + def body(*_arg0, **_arg1, &_arg2); end + + # A reference to the controller instance used by the last request. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#119 + def controller; end + + # A map of the cookies returned by the last response, and which will be sent + # with the next request. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#114 + def cookies; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def default_url_options; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def default_url_options=(_arg0); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def default_url_options?; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#97 + def headers(*_arg0, **_arg1, &_arg2); end + + # The hostname used in the last request. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#101 + def host; end + + # Sets the attribute host + # Set the host name to use in the next request. + # + # session.host! "www.example.com" + # + # @param value the value to set the attribute host to. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#315 + def host!(_arg0); end + + # Sets the attribute host + # + # @param value the value to set the attribute host to. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#104 + def host=(_arg0); end + + # Specify whether or not the session should mimic a secure HTTPS request. + # + # session.https! + # session.https!(false) + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#180 + def https!(flag = T.unsafe(nil)); end + + # Returns `true` if the session is mimicking a secure HTTPS request. + # + # if session.https? + # ... + # end + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#189 + def https?; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#98 + def path(*_arg0, **_arg1, &_arg2); end + + # Performs the actual request. + # + # * `method`: The HTTP method (GET, POST, PATCH, PUT, DELETE, HEAD, OPTIONS) + # as a symbol. + # * `path`: The URI (as a String) on which you want to perform the request. + # * `params`: The HTTP parameters that you want to pass. This may be `nil`, a + # Hash, or a String that is appropriately encoded + # (`application/x-www-form-urlencoded` or `multipart/form-data`). + # * `headers`: Additional headers to pass, as a Hash. The headers will be + # merged into the Rack env hash. + # * `env`: Additional env to pass, as a Hash. The headers will be merged into + # the Rack env hash. + # * `xhr`: Set to `true` if you want to make an Ajax request. Adds request + # headers characteristic of XMLHttpRequest e.g. HTTP_X_REQUESTED_WITH. The + # headers will be merged into the Rack env hash. + # * `as`: Used for encoding the request with different content type. Supports + # `:json` by default and will set the appropriate request headers. The + # headers will be merged into the Rack env hash. + # + # + # This method is rarely used directly. Use RequestHelpers#get, + # RequestHelpers#post, or other standard HTTP methods in integration tests. + # `#process` is only required when using a request method that doesn't have a + # method defined in the integration tests. + # + # This method returns the response status, after performing the request. + # Furthermore, if this method was called from an ActionDispatch::IntegrationTest + # object, then that object's `@response` instance variable will point to a + # Response object which one can use to inspect the details of the response. + # + # Example: + # process :get, '/author', params: { since: 201501011400 } + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#225 + def process(method, path, params: T.unsafe(nil), headers: T.unsafe(nil), env: T.unsafe(nil), xhr: T.unsafe(nil), as: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#97 + def redirect?(*_arg0, **_arg1, &_arg2); end + + # The remote_addr used in the last request. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#107 + def remote_addr; end + + # The remote_addr used in the last request. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#107 + def remote_addr=(_arg0); end + + # A reference to the request instance used by the last request. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#122 + def request; end + + # A running counter of the number of requests processed. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#128 + def request_count; end + + # A running counter of the number of requests processed. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#128 + def request_count=(_arg0); end + + # Resets the instance. This can be used to reset the state information in an + # existing session instance, so it can be used from a clean-slate condition. + # + # session.reset! + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#156 + def reset!; end + + # A reference to the response instance used by the last request. + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#125 + def response; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#97 + def status(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#97 + def status_message(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#140 + def url_options; end + + private + + # source://actionpack//lib/action_dispatch/testing/integration.rb#318 + def _mock_session; end + + # @yield [location] + # + # source://actionpack//lib/action_dispatch/testing/integration.rb#326 + def build_expanded_path(path); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#322 + def build_full_uri(path, env); end + + class << self + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def default_url_options; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def default_url_options=(value); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def default_url_options?; end + + private + + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def __class_attr_default_url_options; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#130 + def __class_attr_default_url_options=(new_value); end + end +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#92 +ActionDispatch::Integration::Session::DEFAULT_HOST = T.let(T.unsafe(nil), String) + +# An integration test spans multiple controllers and actions, tying them all +# together to ensure they work together as expected. It tests more completely +# than either unit or functional tests do, exercising the entire stack, from the +# dispatcher to the database. +# +# At its simplest, you simply extend `IntegrationTest` and write your tests +# using the Integration::RequestHelpers#get and/or +# Integration::RequestHelpers#post methods: +# +# require "test_helper" +# +# class ExampleTest < ActionDispatch::IntegrationTest +# fixtures :people +# +# def test_login +# # get the login page +# get "/login" +# assert_equal 200, status +# +# # post the login and follow through to the home page +# post "/login", params: { username: people(:jamis).username, +# password: people(:jamis).password } +# follow_redirect! +# assert_equal 200, status +# assert_equal "/home", path +# end +# end +# +# However, you can also have multiple session instances open per test, and even +# extend those instances with assertions and methods to create a very powerful +# testing DSL that is specific for your application. You can even reference any +# named routes you happen to have defined. +# +# require "test_helper" +# +# class AdvancedTest < ActionDispatch::IntegrationTest +# fixtures :people, :rooms +# +# def test_login_and_speak +# jamis, david = login(:jamis), login(:david) +# room = rooms(:office) +# +# jamis.enter(room) +# jamis.speak(room, "anybody home?") +# +# david.enter(room) +# david.speak(room, "hello!") +# end +# +# private +# +# module CustomAssertions +# def enter(room) +# # reference a named route, for maximum internal consistency! +# get(room_url(id: room.id)) +# assert(...) +# ... +# end +# +# def speak(room, message) +# post "/say/#{room.id}", xhr: true, params: { message: message } +# assert(...) +# ... +# end +# end +# +# def login(who) +# open_session do |sess| +# sess.extend(CustomAssertions) +# who = people(who) +# sess.post "/login", params: { username: who.username, +# password: who.password } +# assert(...) +# end +# end +# end +# +# Another longer example would be: +# +# A simple integration test that exercises multiple controllers: +# +# require "test_helper" +# +# class UserFlowsTest < ActionDispatch::IntegrationTest +# test "login and browse site" do +# # login via https +# https! +# get "/login" +# assert_response :success +# +# post "/login", params: { username: users(:david).username, password: users(:david).password } +# follow_redirect! +# assert_equal '/welcome', path +# assert_equal 'Welcome david!', flash[:notice] +# +# https!(false) +# get "/articles/all" +# assert_response :success +# assert_dom 'h1', 'Articles' +# end +# end +# +# As you can see the integration test involves multiple controllers and +# exercises the entire stack from database to dispatcher. In addition you can +# have multiple session instances open simultaneously in a test and extend those +# instances with assertion methods to create a very powerful testing DSL +# (domain-specific language) just for your application. +# +# Here's an example of multiple sessions and custom DSL in an integration test +# +# require "test_helper" +# +# class UserFlowsTest < ActionDispatch::IntegrationTest +# test "login and browse site" do +# # User david logs in +# david = login(:david) +# # User guest logs in +# guest = login(:guest) +# +# # Both are now available in different sessions +# assert_equal 'Welcome david!', david.flash[:notice] +# assert_equal 'Welcome guest!', guest.flash[:notice] +# +# # User david can browse site +# david.browses_site +# # User guest can browse site as well +# guest.browses_site +# +# # Continue with other assertions +# end +# +# private +# +# module CustomDsl +# def browses_site +# get "/products/all" +# assert_response :success +# assert_dom 'h1', 'Products' +# end +# end +# +# def login(user) +# open_session do |sess| +# sess.extend(CustomDsl) +# u = users(user) +# sess.https! +# sess.post "/login", params: { username: u.username, password: u.password } +# assert_equal '/welcome', sess.path +# sess.https!(false) +# end +# end +# end +# +# See the [request helpers documentation](rdoc-ref:ActionDispatch::Integration::RequestHelpers) +# for help on how to use `get`, etc. +# +# ### Changing the request encoding +# +# You can also test your JSON API easily by setting what the request should be +# encoded as: +# +# require "test_helper" +# +# class ApiTest < ActionDispatch::IntegrationTest +# test "creates articles" do +# assert_difference -> { Article.count } do +# post articles_path, params: { article: { title: "Ahoy!" } }, as: :json +# end +# +# assert_response :success +# assert_equal({ "id" => Article.last.id, "title" => "Ahoy!" }, response.parsed_body) +# end +# end +# +# The `as` option passes an "application/json" Accept header (thereby setting +# the request format to JSON unless overridden), sets the content type to +# "application/json" and encodes the parameters as JSON. +# +# Calling TestResponse#parsed_body on the response parses the response body +# based on the last response MIME type. +# +# Out of the box, only `:json` is supported. But for any custom MIME types +# you've registered, you can add your own encoders with: +# +# ActionDispatch::IntegrationTest.register_encoder :wibble, +# param_encoder: -> params { params.to_wibble }, +# response_parser: -> body { body } +# +# Where `param_encoder` defines how the params should be encoded and +# `response_parser` defines how the response body should be parsed through +# TestResponse#parsed_body. +# +# Consult the [Rails Testing Guide](https://guides.rubyonrails.org/testing.html) +# for more. +# +# source://actionpack//lib/action_dispatch/testing/integration.rb#649 +class ActionDispatch::IntegrationTest < ::ActiveSupport::TestCase + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + include ::ActionDispatch::Integration::Runner + include ::ActionController::TemplateAssertions + include ::ActionDispatch::TestHelpers::PageDumpHelper + include ::ActionDispatch::IntegrationTest::Behavior + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + include ::ActionDispatch::IntegrationTest::UrlOptions + include ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting + extend ::ActionDispatch::IntegrationTest::Behavior::ClassMethods + extend ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting::ClassMethods +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#659 +module ActionDispatch::IntegrationTest::Behavior + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + include ::ActionDispatch::Integration::Runner + include ::ActionController::TemplateAssertions + include ::ActionDispatch::TestHelpers::PageDumpHelper + extend ::ActiveSupport::Concern + include ::ActionDispatch::Routing::UrlFor + include ::ActionDispatch::IntegrationTest::UrlOptions + include ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting + + mixes_in_class_methods ::ActionDispatch::IntegrationTest::Behavior::ClassMethods + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::WithIntegrationRouting::ClassMethods + + # source://actionpack//lib/action_dispatch/testing/integration.rb#692 + def app; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#696 + def document_root_element; end +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#674 +module ActionDispatch::IntegrationTest::Behavior::ClassMethods + # source://actionpack//lib/action_dispatch/testing/integration.rb#675 + def app; end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#683 + def app=(app); end + + # source://actionpack//lib/action_dispatch/testing/integration.rb#687 + def register_encoder(*args, **options); end +end + +# source://actionpack//lib/action_dispatch/testing/integration.rb#652 +module ActionDispatch::IntegrationTest::UrlOptions + extend ::ActiveSupport::Concern + + # source://actionpack//lib/action_dispatch/testing/integration.rb#654 + def url_options; end +end + +# source://actionpack//lib/action_dispatch/http/param_error.rb#21 +class ActionDispatch::InvalidParameterError < ::ActionDispatch::ParamError; end + +# :stopdoc: +# +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#6 +module ActionDispatch::Journey; end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#9 +class ActionDispatch::Journey::Ast + # @return [Ast] a new instance of Ast + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#13 + def initialize(tree, formatted); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#38 + def glob?; end + + # Returns the value of attribute names. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#10 + def names; end + + # Returns the value of attribute path_params. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#10 + def path_params; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#25 + def requirements=(requirements); end + + # Returns the value of attribute tree. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#11 + def root; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#34 + def route=(route); end + + # Returns the value of attribute terminals. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#10 + def terminals; end + + # Returns the value of attribute tree. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#10 + def tree; end + + # Returns the value of attribute wildcard_options. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#10 + def wildcard_options; end + + private + + # Returns the value of attribute stars. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#43 + def stars; end + + # Returns the value of attribute symbols. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#43 + def symbols; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#45 + def visit_tree(formatted); end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#8 +class ActionDispatch::Journey::Format + # @return [Format] a new instance of Format + # + # source://actionpack//lib/action_dispatch/journey/visitors.rb#24 + def initialize(parts); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#39 + def evaluate(hash); end + + class << self + # source://actionpack//lib/action_dispatch/journey/visitors.rb#16 + def required_path(symbol); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#20 + def required_segment(symbol); end + end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#9 +ActionDispatch::Journey::Format::ESCAPE_PATH = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#10 +ActionDispatch::Journey::Format::ESCAPE_SEGMENT = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#12 +class ActionDispatch::Journey::Format::Parameter < ::Struct + # source://actionpack//lib/action_dispatch/journey/visitors.rb#13 + def escape(value); end + + # Returns the value of attribute escaper + # + # @return [Object] the current value of escaper + # + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def escaper; end + + # Sets the attribute escaper + # + # @param value [Object] the value to set the attribute escaper to. + # @return [Object] the newly set value + # + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def escaper=(_); end + + # Returns the value of attribute name + # + # @return [Object] the current value of name + # + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def name; end + + # Sets the attribute name + # + # @param value [Object] the value to set the attribute name to. + # @return [Object] the newly set value + # + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def name=(_); end + + class << self + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def [](*_arg0); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def inspect; end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def keyword_init?; end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def members; end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#12 + def new(*_arg0); end + end +end + +# The Formatter class is used for formatting URLs. For example, parameters +# passed to `url_for` in Rails will eventually call Formatter#generate. +# +# source://actionpack//lib/action_dispatch/journey/formatter.rb#12 +class ActionDispatch::Journey::Formatter + # @return [Formatter] a new instance of Formatter + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#15 + def initialize(routes); end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#110 + def clear; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#114 + def eager_load!; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#61 + def generate(name, options, path_parameters); end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#13 + def routes; end + + private + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#214 + def build_cache; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#225 + def cache; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#120 + def extract_parameterized_parts(route, options, recall); end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#147 + def match_route(name, options); end + + # Returns an array populated with missing keys if any are present. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#186 + def missing_keys(route, parts); end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#143 + def named_routes; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#169 + def non_recursive(cache, options); end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#206 + def possibles(cache, options, depth = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/journey/formatter.rb#34 +class ActionDispatch::Journey::Formatter::MissingRoute + # @return [MissingRoute] a new instance of MissingRoute + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#37 + def initialize(constraints, missing_keys, unmatched_keys, routes, name); end + + # Returns the value of attribute constraints. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#35 + def constraints; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#53 + def message; end + + # Returns the value of attribute missing_keys. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#35 + def missing_keys; end + + # Returns the value of attribute name. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#35 + def name; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#49 + def params; end + + # @raise [ActionController::UrlGenerationError] + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#45 + def path(method_name); end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#35 + def routes; end + + # Returns the value of attribute unmatched_keys. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#35 + def unmatched_keys; end +end + +# source://actionpack//lib/action_dispatch/journey/formatter.rb#20 +class ActionDispatch::Journey::Formatter::RouteWithParams + # @return [RouteWithParams] a new instance of RouteWithParams + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#23 + def initialize(route, parameterized_parts, params); end + + # Returns the value of attribute params. + # + # source://actionpack//lib/action_dispatch/journey/formatter.rb#21 + def params; end + + # source://actionpack//lib/action_dispatch/journey/formatter.rb#29 + def path(_); end +end + +# source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#9 +module ActionDispatch::Journey::GTG; end + +# source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#10 +class ActionDispatch::Journey::GTG::Builder + # @return [Builder] a new instance of Builder + # + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#15 + def initialize(root); end + + # Returns the value of attribute ast. + # + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#13 + def ast; end + + # Returns the value of attribute endpoints. + # + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#13 + def endpoints; end + + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#87 + def firstpos(node); end + + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#108 + def lastpos(node); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#66 + def nullable?(node); end + + # Returns the value of attribute root. + # + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#13 + def root; end + + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#21 + def transition_table; end + + private + + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#130 + def build_followpos; end + + # source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#143 + def symbol(edge); end +end + +# source://actionpack//lib/action_dispatch/journey/gtg/builder.rb#11 +ActionDispatch::Journey::GTG::Builder::DUMMY_END_NODE = T.let(T.unsafe(nil), ActionDispatch::Journey::Nodes::Dummy) + +# source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#8 +class ActionDispatch::Journey::GTG::MatchData + # @return [MatchData] a new instance of MatchData + # + # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#11 + def initialize(memos); end + + # Returns the value of attribute memos. + # + # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#9 + def memos; end +end + +# source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#16 +class ActionDispatch::Journey::GTG::Simulator + # @return [Simulator] a new instance of Simulator + # + # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#27 + def initialize(transition_table); end + + # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#31 + def memos(string); end + + # Returns the value of attribute tt. + # + # source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#25 + def tt; end +end + +# source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#23 +ActionDispatch::Journey::GTG::Simulator::INITIAL_STATE = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/journey/gtg/simulator.rb#17 +ActionDispatch::Journey::GTG::Simulator::STATIC_TOKENS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#10 +class ActionDispatch::Journey::GTG::TransitionTable + include ::ActionDispatch::Journey::NFA::Dot + + # @return [TransitionTable] a new instance of TransitionTable + # + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#17 + def initialize; end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#168 + def []=(from, to, sym); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#33 + def accepting?(state); end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#29 + def accepting_states; end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#25 + def add_accepting(state); end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#37 + def add_memo(idx, memo); end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#103 + def as_json(options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#45 + def eclosure(t); end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#41 + def memo(idx); end + + # Returns the value of attribute memos. + # + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#13 + def memos; end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#49 + def move(t, full_string, token, start_index, token_matches_default); end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#187 + def states; end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#120 + def to_svg; end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#194 + def transitions; end + + # source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#130 + def visualizer(paths, title = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/journey/gtg/transition_table.rb#15 +ActionDispatch::Journey::GTG::TransitionTable::DEFAULT_EXP = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/journey/nfa/dot.rb#7 +module ActionDispatch::Journey::NFA; end + +# source://actionpack//lib/action_dispatch/journey/nfa/dot.rb#8 +module ActionDispatch::Journey::NFA::Dot + # source://actionpack//lib/action_dispatch/journey/nfa/dot.rb#9 + def to_dot; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#68 +module ActionDispatch::Journey::Nodes; end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#182 +class ActionDispatch::Journey::Nodes::Binary < ::ActionDispatch::Journey::Nodes::Node + # @return [Binary] a new instance of Binary + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#185 + def initialize(left, right); end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#190 + def children; end + + # Returns the value of attribute right. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#183 + def right; end + + # Sets the attribute right + # + # @param value the value to set the attribute right to. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#183 + def right=(_arg0); end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#193 +class ActionDispatch::Journey::Nodes::Cat < ::ActionDispatch::Journey::Nodes::Binary + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#194 + def cat?; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#195 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#134 +class ActionDispatch::Journey::Nodes::Dot < ::ActionDispatch::Journey::Nodes::Terminal + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#135 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#122 +class ActionDispatch::Journey::Nodes::Dummy < ::ActionDispatch::Journey::Nodes::Literal + # @return [Dummy] a new instance of Dummy + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#123 + def initialize(x = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#127 + def literal?; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#159 +class ActionDispatch::Journey::Nodes::Group < ::ActionDispatch::Journey::Nodes::Unary + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#161 + def group?; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#160 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#117 +class ActionDispatch::Journey::Nodes::Literal < ::ActionDispatch::Journey::Nodes::Terminal + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#118 + def literal?; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#119 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#69 +class ActionDispatch::Journey::Nodes::Node + include ::Enumerable + + # @return [Node] a new instance of Node + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#74 + def initialize(left); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#108 + def cat?; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#80 + def each(&block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#109 + def group?; end + + # Returns the value of attribute left. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#72 + def left; end + + # Sets the attribute left + # + # @param value the value to set the attribute left to. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#72 + def left=(_arg0); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#105 + def literal?; end + + # Returns the value of attribute memo. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#72 + def memo; end + + # Sets the attribute memo + # + # @param value the value to set the attribute memo to. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#72 + def memo=(_arg0); end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#96 + def name; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#107 + def star?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#104 + def symbol?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#106 + def terminal?; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#88 + def to_dot; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#84 + def to_s; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#92 + def to_sym; end + + # @raise [NotImplementedError] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#100 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#198 +class ActionDispatch::Journey::Nodes::Or < ::ActionDispatch::Journey::Nodes::Node + # @return [Or] a new instance of Or + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#201 + def initialize(children); end + + # Returns the value of attribute children. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#199 + def children; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#205 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#130 +class ActionDispatch::Journey::Nodes::Slash < ::ActionDispatch::Journey::Nodes::Terminal + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#131 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#164 +class ActionDispatch::Journey::Nodes::Star < ::ActionDispatch::Journey::Nodes::Unary + # @return [Star] a new instance of Star + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#167 + def initialize(left); end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#177 + def name; end + + # Returns the value of attribute regexp. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#165 + def regexp; end + + # Sets the attribute regexp + # + # @param value the value to set the attribute regexp to. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#165 + def regexp=(_arg0); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#174 + def star?; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#175 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#138 +class ActionDispatch::Journey::Nodes::Symbol < ::ActionDispatch::Journey::Nodes::Terminal + # @return [Symbol] a new instance of Symbol + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#145 + def initialize(left, regexp = T.unsafe(nil)); end + + # Returns the value of attribute name. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#141 + def name; end + + # Returns the value of attribute regexp. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#139 + def regexp; end + + # Sets the attribute regexp + # + # @param value the value to set the attribute regexp to. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#139 + def regexp=(_arg0); end + + # Returns the value of attribute regexp. + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#140 + def symbol; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#152 + def symbol?; end + + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#151 + def type; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#143 +ActionDispatch::Journey::Nodes::Symbol::DEFAULT_EXP = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#144 +ActionDispatch::Journey::Nodes::Symbol::GREEDY_EXP = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#112 +class ActionDispatch::Journey::Nodes::Terminal < ::ActionDispatch::Journey::Nodes::Node + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#113 + def symbol; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#114 + def terminal?; end +end + +# source://actionpack//lib/action_dispatch/journey/nodes/node.rb#155 +class ActionDispatch::Journey::Nodes::Unary < ::ActionDispatch::Journey::Nodes::Node + # source://actionpack//lib/action_dispatch/journey/nodes/node.rb#156 + def children; end +end + +# source://actionpack//lib/action_dispatch/journey/parser.rb#8 +class ActionDispatch::Journey::Parser + include ::ActionDispatch::Journey::Nodes + + # @return [Parser] a new instance of Parser + # + # source://actionpack//lib/action_dispatch/journey/parser.rb#15 + def initialize; end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#20 + def parse(string); end + + private + + # source://actionpack//lib/action_dispatch/journey/parser.rb#27 + def advance_token; end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#31 + def do_parse; end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#58 + def parse_expression; end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#35 + def parse_expressions; end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#74 + def parse_group; end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#52 + def parse_or(lhs); end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#68 + def parse_star; end + + # source://actionpack//lib/action_dispatch/journey/parser.rb#86 + def parse_terminal; end + + class << self + # source://actionpack//lib/action_dispatch/journey/parser.rb#11 + def parse(string); end + end +end + +# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#7 +module ActionDispatch::Journey::Path; end + +# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#8 +class ActionDispatch::Journey::Path::Pattern + # @return [Pattern] a new instance of Pattern + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#11 + def initialize(ast, requirements, separators, anchored); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#163 + def =~(other); end + + # Returns the value of attribute anchored. + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#9 + def anchored; end + + # Returns the value of attribute ast. + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#9 + def ast; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#25 + def build_formatter; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#29 + def eager_load!; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#159 + def match(other); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#165 + def match?(other); end + + # Returns the value of attribute names. + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#9 + def names; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#62 + def optional_names; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#58 + def required_names; end + + # Returns the value of attribute requirements. + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#9 + def requirements; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#36 + def requirements_anchored?; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#177 + def requirements_for_missing_keys_check; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#169 + def source; end + + # Returns the value of attribute spec. + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#9 + def spec; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#173 + def to_regexp; end + + private + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#188 + def offsets; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#184 + def regexp_visitor; end +end + +# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#68 +class ActionDispatch::Journey::Path::Pattern::AnchoredRegexp < ::ActionDispatch::Journey::Visitors::Visitor + # @return [AnchoredRegexp] a new instance of AnchoredRegexp + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#69 + def initialize(separator, matchers); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#76 + def accept(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#80 + def visit_CAT(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#100 + def visit_DOT(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#93 + def visit_GROUP(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#97 + def visit_LITERAL(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#111 + def visit_OR(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#102 + def visit_SLASH(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#106 + def visit_STAR(node); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#84 + def visit_SYMBOL(node); end +end + +# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#124 +class ActionDispatch::Journey::Path::Pattern::MatchData + # @return [MatchData] a new instance of MatchData + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#127 + def initialize(names, offsets, match); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#141 + def [](x); end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#133 + def captures; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#146 + def length; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#137 + def named_captures; end + + # Returns the value of attribute names. + # + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#125 + def names; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#150 + def post_match; end + + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#154 + def to_s; end +end + +# source://actionpack//lib/action_dispatch/journey/path/pattern.rb#117 +class ActionDispatch::Journey::Path::Pattern::UnanchoredRegexp < ::ActionDispatch::Journey::Path::Pattern::AnchoredRegexp + # source://actionpack//lib/action_dispatch/journey/path/pattern.rb#118 + def accept(node); end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#8 +class ActionDispatch::Journey::Route + # +path+ is a path constraint. + # `constraints` is a hash of constraints to be applied to this route. + # + # @return [Route] a new instance of Route + # + # source://actionpack//lib/action_dispatch/journey/route.rb#79 + def initialize(name:, path:, app: T.unsafe(nil), constraints: T.unsafe(nil), required_defaults: T.unsafe(nil), defaults: T.unsafe(nil), via: T.unsafe(nil), precedence: T.unsafe(nil), scope_options: T.unsafe(nil), internal: T.unsafe(nil), source_location: T.unsafe(nil)); end + + # Returns the value of attribute app. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def app; end + + # Returns the value of attribute ast. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def ast; end + + # Returns the value of attribute constraints. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#12 + def conditions; end + + # Returns the value of attribute constraints. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def constraints; end + + # Returns the value of attribute defaults. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def defaults; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/route.rb#165 + def dispatcher?; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#101 + def eager_load!; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#143 + def format(path_options); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/route.rb#161 + def glob?; end + + # Returns the value of attribute internal. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def internal; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#189 + def ip; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/route.rb#169 + def matches?(request); end + + # Returns the value of attribute name. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def name; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#138 + def parts; end + + # Returns the value of attribute path. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def path; end + + # Returns the value of attribute precedence. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def precedence; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/route.rb#151 + def required_default?(key); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#155 + def required_defaults; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#126 + def required_keys; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#147 + def required_parts; end + + # Needed for `bin/rails routes`. Picks up succinctly defined requirements for a + # route, for example route + # + # get 'photo/:id', :controller => 'photos', :action => 'show', + # :id => /[A-Z]\d{5}/ + # + # will have {:controller=>"photos", :action=>"show", :[id=>/](A-Z){5}/} as + # requirements. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#116 + def requirements; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/route.rb#193 + def requires_matching_verb?; end + + # Returns the value of attribute scope_options. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def scope_options; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#130 + def score(supplied_keys); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#141 + def segment_keys; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#122 + def segments; end + + # Returns the value of attribute source_location. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#9 + def source_location; end + + # source://actionpack//lib/action_dispatch/journey/route.rb#197 + def verb; end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#14 +module ActionDispatch::Journey::Route::VerbMatchers + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#65 + def for(verbs); end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#36 +class ActionDispatch::Journey::Route::VerbMatchers::All + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#37 + def call(_); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#38 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::DELETE + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::GET + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::HEAD + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::LINK + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::OPTIONS + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#41 +class ActionDispatch::Journey::Route::VerbMatchers::Or + # @return [Or] a new instance of Or + # + # source://actionpack//lib/action_dispatch/journey/route.rb#44 + def initialize(verbs); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#49 + def call(req); end + + # Returns the value of attribute verb. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#42 + def verb; end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::PATCH + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::POST + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::PUT + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::TRACE + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#19 +class ActionDispatch::Journey::Route::VerbMatchers::UNLINK + class << self + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def call(req); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#17 + def verb; end + end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#26 +class ActionDispatch::Journey::Route::VerbMatchers::Unknown + # @return [Unknown] a new instance of Unknown + # + # source://actionpack//lib/action_dispatch/journey/route.rb#29 + def initialize(verb); end + + # source://actionpack//lib/action_dispatch/journey/route.rb#33 + def call(request); end + + # Returns the value of attribute verb. + # + # source://actionpack//lib/action_dispatch/journey/route.rb#27 + def verb; end +end + +# source://actionpack//lib/action_dispatch/journey/route.rb#15 +ActionDispatch::Journey::Route::VerbMatchers::VERBS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/journey/route.rb#54 +ActionDispatch::Journey::Route::VerbMatchers::VERB_TO_CLASS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#7 +class ActionDispatch::Journey::Router + # @return [Router] a new instance of Router + # + # source://actionpack//lib/action_dispatch/journey/router.rb#19 + def initialize(routes); end + + # source://actionpack//lib/action_dispatch/journey/router.rb#23 + def eager_load!; end + + # source://actionpack//lib/action_dispatch/journey/router.rb#43 + def recognize(req, &block); end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_dispatch/journey/router.rb#17 + def routes; end + + # Sets the attribute routes + # + # @param value the value to set the attribute routes to. + # + # source://actionpack//lib/action_dispatch/journey/router.rb#17 + def routes=(_arg0); end + + # source://actionpack//lib/action_dispatch/journey/router.rb#30 + def serve(req); end + + private + + # source://actionpack//lib/action_dispatch/journey/router.rb#107 + def custom_routes; end + + # source://actionpack//lib/action_dispatch/journey/router.rb#111 + def filter_routes(path); end + + # source://actionpack//lib/action_dispatch/journey/router.rb#115 + def match_head_routes(routes, req); end + + # source://actionpack//lib/action_dispatch/journey/router.rb#103 + def simulator; end +end + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#8 +class ActionDispatch::Journey::Router::Utils + class << self + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#93 + def escape_fragment(fragment); end + + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#85 + def escape_path(path); end + + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#89 + def escape_segment(segment); end + + # Normalizes URI path. + # + # Strips off trailing slash and ensures there is a leading slash. Also converts + # downcase URL encoded string to uppercase. + # + # normalize_path("/foo") # => "/foo" + # normalize_path("/foo/") # => "/foo" + # normalize_path("foo") # => "/foo" + # normalize_path("") # => "/" + # normalize_path("/%ab") # => "/%AB" + # + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#19 + def normalize_path(path); end + end +end + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#83 +ActionDispatch::Journey::Router::Utils::ENCODER = T.let(T.unsafe(nil), ActionDispatch::Journey::Router::Utils::UriEncoder) + +# URI path and fragment escaping https://tools.ietf.org/html/rfc3986 +# +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#41 +class ActionDispatch::Journey::Router::Utils::UriEncoder + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#59 + def escape_fragment(fragment); end + + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#63 + def escape_path(path); end + + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#67 + def escape_segment(segment); end + + private + + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#72 + def escape(component, pattern); end + + # source://actionpack//lib/action_dispatch/journey/router/utils.rb#76 + def percent_encode(unsafe); end +end + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#48 +ActionDispatch::Journey::Router::Utils::UriEncoder::ALPHA = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#46 +ActionDispatch::Journey::Router::Utils::UriEncoder::DEC2HEX = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#49 +ActionDispatch::Journey::Router::Utils::UriEncoder::DIGIT = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#45 +ActionDispatch::Journey::Router::Utils::UriEncoder::EMPTY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#42 +ActionDispatch::Journey::Router::Utils::UriEncoder::ENCODE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#53 +ActionDispatch::Journey::Router::Utils::UriEncoder::ESCAPED = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#55 +ActionDispatch::Journey::Router::Utils::UriEncoder::FRAGMENT = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#57 +ActionDispatch::Journey::Router::Utils::UriEncoder::PATH = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#56 +ActionDispatch::Journey::Router::Utils::UriEncoder::SEGMENT = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#51 +ActionDispatch::Journey::Router::Utils::UriEncoder::SUB_DELIMS = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#50 +ActionDispatch::Journey::Router::Utils::UriEncoder::UNRESERVED = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#43 +ActionDispatch::Journey::Router::Utils::UriEncoder::US_ASCII = T.let(T.unsafe(nil), Encoding) + +# source://actionpack//lib/action_dispatch/journey/router/utils.rb#44 +ActionDispatch::Journey::Router::Utils::UriEncoder::UTF_8 = T.let(T.unsafe(nil), Encoding) + +# The Routing table. Contains all routes for a system. Routes can be added to +# the table by calling Routes#add_route. +# +# source://actionpack//lib/action_dispatch/journey/routes.rb#9 +class ActionDispatch::Journey::Routes + include ::Enumerable + + # @return [Routes] a new instance of Routes + # + # source://actionpack//lib/action_dispatch/journey/routes.rb#14 + def initialize(routes = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#67 + def add_route(name, mapping); end + + # Returns the value of attribute anchored_routes. + # + # source://actionpack//lib/action_dispatch/journey/routes.rb#12 + def anchored_routes; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#53 + def ast; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#39 + def clear; end + + # Returns the value of attribute custom_routes. + # + # source://actionpack//lib/action_dispatch/journey/routes.rb#12 + def custom_routes; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#35 + def each(&block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/routes.rb#22 + def empty?; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#31 + def last; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#26 + def length; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#45 + def partition_route(route); end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_dispatch/journey/routes.rb#12 + def routes; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#60 + def simulator; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#29 + def size; end + + # source://actionpack//lib/action_dispatch/journey/routes.rb#75 + def visualizer; end + + private + + # source://actionpack//lib/action_dispatch/journey/routes.rb#83 + def clear_cache!; end +end + +# source://actionpack//lib/action_dispatch/journey/scanner.rb#9 +class ActionDispatch::Journey::Scanner + # @return [Scanner] a new instance of Scanner + # + # source://actionpack//lib/action_dispatch/journey/scanner.rb#28 + def initialize; end + + # source://actionpack//lib/action_dispatch/journey/scanner.rb#48 + def last_literal; end + + # source://actionpack//lib/action_dispatch/journey/scanner.rb#44 + def last_string; end + + # source://actionpack//lib/action_dispatch/journey/scanner.rb#37 + def next_token; end + + # source://actionpack//lib/action_dispatch/journey/scanner.rb#33 + def scan_setup(str); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/journey/scanner.rb#69 + def next_byte_is_not_a_token?; end + + # source://actionpack//lib/action_dispatch/journey/scanner.rb#55 + def scan; end +end + +# source://actionpack//lib/action_dispatch/journey/scanner.rb#10 +ActionDispatch::Journey::Scanner::STATIC_TOKENS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/journey/scanner.rb#20 +class ActionDispatch::Journey::Scanner::Scanner < ::StringScanner; end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#55 +module ActionDispatch::Journey::Visitors; end + +# private +# def binary(node, seed) +# visit(node.right, visit(node.left, seed)) +# end +# +# def nary(node, seed) +# last_child = node.children.last +# node.children.inject(seed) { |s, c| +# string = visit(c, s) +# string << "|" unless last_child == c +# string +# } +# end +# +# def terminal(node, seed) +# seed + node.left +# end +# +# def visit_GROUP(node, seed) +# visit(node.left, seed.dup << "(") << ")" +# end +# +# INSTANCE = new +# end +# +# source://actionpack//lib/action_dispatch/journey/visitors.rb#228 +class ActionDispatch::Journey::Visitors::Dot < ::ActionDispatch::Journey::Visitors::FunctionalVisitor + # @return [Dot] a new instance of Dot + # + # source://actionpack//lib/action_dispatch/journey/visitors.rb#229 + def initialize; end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#234 + def accept(node, seed = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#249 + def binary(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#256 + def nary(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#288 + def terminal(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#263 + def unary(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#273 + def visit_CAT(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#268 + def visit_GROUP(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#283 + def visit_OR(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#278 + def visit_STAR(node, seed); end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#294 +ActionDispatch::Journey::Visitors::Dot::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::Dot) + +# Loop through the requirements AST. +# +# source://actionpack//lib/action_dispatch/journey/visitors.rb#161 +class ActionDispatch::Journey::Visitors::Each < ::ActionDispatch::Journey::Visitors::FunctionalVisitor + # source://actionpack//lib/action_dispatch/journey/visitors.rb#162 + def visit(node, block); end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#167 +ActionDispatch::Journey::Visitors::Each::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::Each) + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#136 +class ActionDispatch::Journey::Visitors::FormatBuilder < ::ActionDispatch::Journey::Visitors::Visitor + # source://actionpack//lib/action_dispatch/journey/visitors.rb#137 + def accept(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#140 + def binary(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#138 + def terminal(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#144 + def visit_GROUP(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#146 + def visit_STAR(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#150 + def visit_SYMBOL(n); end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#97 +class ActionDispatch::Journey::Visitors::FunctionalVisitor + # source://actionpack//lib/action_dispatch/journey/visitors.rb#100 + def accept(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#108 + def binary(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#113 + def nary(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#124 + def terminal(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#118 + def unary(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#104 + def visit(node, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#111 + def visit_CAT(n, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#128 + def visit_DOT(n, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#121 + def visit_GROUP(n, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#125 + def visit_LITERAL(n, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#116 + def visit_OR(n, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#127 + def visit_SLASH(n, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#122 + def visit_STAR(n, seed); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#126 + def visit_SYMBOL(n, seed); end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#98 +ActionDispatch::Journey::Visitors::FunctionalVisitor::DISPATCH_CACHE = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#170 +class ActionDispatch::Journey::Visitors::String + # source://actionpack//lib/action_dispatch/journey/visitors.rb#171 + def accept(node, seed); end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#199 +ActionDispatch::Journey::Visitors::String::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::String) + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#56 +class ActionDispatch::Journey::Visitors::Visitor + # source://actionpack//lib/action_dispatch/journey/visitors.rb#59 + def accept(node); end + + private + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#68 + def binary(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#74 + def nary(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#85 + def terminal(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#79 + def unary(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#64 + def visit(node); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#72 + def visit_CAT(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#89 + def visit_DOT(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#82 + def visit_GROUP(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#86 + def visit_LITERAL(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#77 + def visit_OR(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#88 + def visit_SLASH(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#83 + def visit_STAR(n); end + + # source://actionpack//lib/action_dispatch/journey/visitors.rb#87 + def visit_SYMBOL(n); end +end + +# source://actionpack//lib/action_dispatch/journey/visitors.rb#57 +ActionDispatch::Journey::Visitors::Visitor::DISPATCH_CACHE = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/log_subscriber.rb#4 +class ActionDispatch::LogSubscriber < ::ActiveSupport::LogSubscriber + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def backtrace_cleaner; end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def backtrace_cleaner=(_arg0); end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def backtrace_cleaner?; end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#7 + def redirect(event); end + + class << self + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def backtrace_cleaner; end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def backtrace_cleaner=(value); end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def backtrace_cleaner?; end + + private + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def __class_attr_backtrace_cleaner; end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#5 + def __class_attr_backtrace_cleaner=(new_value); end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#25 + def __class_attr_log_levels; end + + # source://actionpack//lib/action_dispatch/log_subscriber.rb#25 + def __class_attr_log_levels=(new_value); end + end +end + +# # Action Dispatch MiddlewareStack +# +# Read more about [Rails middleware +# stack](https://guides.rubyonrails.org/rails_on_rack.html#action-dispatcher-middleware-stack) +# in the guides. +# +# source://actionpack//lib/action_dispatch/middleware/stack.rb#14 +class ActionDispatch::MiddlewareStack + include ::Enumerable + + # @return [MiddlewareStack] a new instance of MiddlewareStack + # @yield [_self] + # @yieldparam _self [ActionDispatch::MiddlewareStack] the object that the method was called on + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#76 + def initialize(*args); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#93 + def [](i); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#166 + def build(app = T.unsafe(nil), &block); end + + # Deletes a middleware from the middleware stack. + # + # Returns the array of middlewares not including the deleted item, or returns + # nil if the target is not found. + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#131 + def delete(target); end + + # Deletes a middleware from the middleware stack. + # + # Returns the array of middlewares not including the deleted item, or raises + # `RuntimeError` if the target is not found. + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#139 + def delete!(target); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#81 + def each(&block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#106 + def insert(index, klass, *args, **_arg3, &block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#114 + def insert_after(index, *args, **_arg2, &block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#112 + def insert_before(index, klass, *args, **_arg3, &block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#89 + def last; end + + # Returns the value of attribute middlewares. + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#74 + def middlewares; end + + # Sets the attribute middlewares + # + # @param value the value to set the attribute middlewares to. + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#74 + def middlewares=(_arg0); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#143 + def move(target, source); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#153 + def move_after(target, source); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#151 + def move_before(target, source); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#85 + def size; end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#120 + def swap(target, *args, **_arg2, &block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#97 + def unshift(klass, *args, **_arg2, &block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#161 + def use(klass, *args, **_arg2, &block); end + + private + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#178 + def assert_index(index, where); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#184 + def build_middleware(klass, args, block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#188 + def index_of(klass); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#102 + def initialize_copy(other); end +end + +# This class is used to instrument the execution of a single middleware. It +# proxies the `call` method transparently and instruments the method call. +# +# source://actionpack//lib/action_dispatch/middleware/stack.rb#54 +class ActionDispatch::MiddlewareStack::InstrumentationProxy + # @return [InstrumentationProxy] a new instance of InstrumentationProxy + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#57 + def initialize(middleware, class_name); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#65 + def call(env); end +end + +# source://actionpack//lib/action_dispatch/middleware/stack.rb#55 +ActionDispatch::MiddlewareStack::InstrumentationProxy::EVENT_NAME = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/middleware/stack.rb#15 +class ActionDispatch::MiddlewareStack::Middleware + # @return [Middleware] a new instance of Middleware + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#18 + def initialize(klass, args, block); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#26 + def ==(middleware); end + + # Returns the value of attribute args. + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#16 + def args; end + + # Returns the value of attribute block. + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#16 + def block; end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#43 + def build(app); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#47 + def build_instrumented(app); end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#35 + def inspect; end + + # Returns the value of attribute klass. + # + # source://actionpack//lib/action_dispatch/middleware/stack.rb#16 + def klass; end + + # source://actionpack//lib/action_dispatch/middleware/stack.rb#24 + def name; end +end + +# source://actionpack//lib/action_dispatch.rb#50 +class ActionDispatch::MissingController < ::NameError; end + +# source://actionpack//lib/action_dispatch/http/param_builder.rb#4 +class ActionDispatch::ParamBuilder + # @return [ParamBuilder] a new instance of ParamBuilder + # + # source://actionpack//lib/action_dispatch/http/param_builder.rb#15 + def initialize(param_depth_limit); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#19 + def default; end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#19 + def default=(val); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#62 + def from_hash(hash, encoding_template: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#46 + def from_pairs(pairs, encoding_template: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#42 + def from_query_string(qs, separator: T.unsafe(nil), encoding_template: T.unsafe(nil)); end + + # Returns the value of attribute param_depth_limit. + # + # source://actionpack//lib/action_dispatch/http/param_builder.rb#13 + def param_depth_limit; end + + private + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#163 + def make_params; end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#167 + def new_depth_limit(param_depth_limit); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/param_builder.rb#175 + def params_hash_has_key?(hash, key); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/param_builder.rb#171 + def params_hash_type?(obj); end + + # @raise [ParamsTooDeepError] + # + # source://actionpack//lib/action_dispatch/http/param_builder.rb#77 + def store_nested_param(params, name, v, depth, encoding_template = T.unsafe(nil)); end + + class << self + # source://actionpack//lib/action_dispatch/http/param_builder.rb#19 + def default; end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#19 + def default=(val); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#23 + def from_hash(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#23 + def from_pairs(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#23 + def from_query_string(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#25 + def ignore_leading_brackets; end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#33 + def ignore_leading_brackets=(value); end + + # source://actionpack//lib/action_dispatch/http/param_builder.rb#9 + def make_default(param_depth_limit); end + end +end + +# source://actionpack//lib/action_dispatch/http/param_error.rb#4 +class ActionDispatch::ParamError < ::ActionDispatch::Http::Parameters::ParseError + # @return [ParamError] a new instance of ParamError + # + # source://actionpack//lib/action_dispatch/http/param_error.rb#5 + def initialize(message = T.unsafe(nil)); end + + class << self + # source://actionpack//lib/action_dispatch/http/param_error.rb#9 + def ===(other); end + end +end + +# source://actionpack//lib/action_dispatch/http/param_error.rb#18 +class ActionDispatch::ParameterTypeError < ::ActionDispatch::ParamError; end + +# source://actionpack//lib/action_dispatch/http/param_error.rb#24 +class ActionDispatch::ParamsTooDeepError < ::ActionDispatch::ParamError; end + +# # Action Dispatch PermissionsPolicy +# +# Configures the HTTP +# [Feature-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy) +# response header to specify which browser features the current +# document and its iframes can use. +# +# Example global policy: +# +# Rails.application.config.permissions_policy do |policy| +# policy.camera :none +# policy.gyroscope :none +# policy.microphone :none +# policy.usb :none +# policy.fullscreen :self +# policy.payment :self, "https://secure.example.com" +# end +# +# The Feature-Policy header has been renamed to Permissions-Policy. The +# Permissions-Policy requires a different implementation and isn't yet supported +# by all browsers. To avoid having to rename this middleware in the future we +# use the new name for the middleware but keep the old header name and +# implementation for now. +# +# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#31 +class ActionDispatch::PermissionsPolicy + # @return [PermissionsPolicy] a new instance of PermissionsPolicy + # @yield [_self] + # @yieldparam _self [ActionDispatch::PermissionsPolicy] the object that the method was called on + # + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#113 + def initialize; end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def accelerometer(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def ambient_light_sensor(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def autoplay(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#132 + def build(context = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def camera(*sources); end + + # Returns the value of attribute directives. + # + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#111 + def directives; end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def display_capture(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def encrypted_media(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def fullscreen(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def geolocation(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def gyroscope(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def hid(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def idle_detection(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def keyboard_map(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def magnetometer(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def microphone(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def midi(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def payment(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def picture_in_picture(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def screen_wake_lock(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def serial(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def sync_xhr(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def usb(*sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#123 + def web_share(*sources); end + + private + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#150 + def apply_mapping(source); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#137 + def apply_mappings(sources); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#168 + def build_directive(sources, context); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#156 + def build_directives(context); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#118 + def initialize_copy(other); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#172 + def resolve_source(source, context); end +end + +# List of available permissions can be found at +# https://github.com/w3c/webappsec-permissions-policy/blob/main/features.md#policy-controlled-features +# +# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#84 +ActionDispatch::PermissionsPolicy::DIRECTIVES = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#77 +ActionDispatch::PermissionsPolicy::MAPPINGS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#32 +class ActionDispatch::PermissionsPolicy::Middleware + # @return [Middleware] a new instance of Middleware + # + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#33 + def initialize(app); end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#37 + def call(env); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#60 + def policy_empty?(policy); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#56 + def policy_present?(headers); end +end + +# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#65 +module ActionDispatch::PermissionsPolicy::Request + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#68 + def permissions_policy; end + + # source://actionpack//lib/action_dispatch/http/permissions_policy.rb#72 + def permissions_policy=(policy); end +end + +# source://actionpack//lib/action_dispatch/http/permissions_policy.rb#66 +ActionDispatch::PermissionsPolicy::Request::POLICY = T.let(T.unsafe(nil), String) + +# # Action Dispatch PublicExceptions +# +# When called, this middleware renders an error page. By default if an HTML +# response is expected it will render static error pages from the `/public` +# directory. For example when this middleware receives a 500 response it will +# render the template found in `/public/500.html`. If an internationalized +# locale is set, this middleware will attempt to render the template in +# `/public/500..html`. If an internationalized template is not found it +# will fall back on `/public/500.html`. +# +# When a request with a content type other than HTML is made, this middleware +# will attempt to convert error information into the appropriate response type. +# +# source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#18 +class ActionDispatch::PublicExceptions + # @return [PublicExceptions] a new instance of PublicExceptions + # + # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#21 + def initialize(public_path); end + + # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#25 + def call(env); end + + # Returns the value of attribute public_path. + # + # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#19 + def public_path; end + + # Sets the attribute public_path + # + # @param value the value to set the attribute public_path to. + # + # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#19 + def public_path=(_arg0); end + + private + + # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#39 + def render(status, content_type, body); end + + # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#48 + def render_format(status, content_type, body); end + + # source://actionpack//lib/action_dispatch/middleware/public_exceptions.rb#53 + def render_html(status); end +end + +# source://actionpack//lib/action_dispatch/http/query_parser.rb#7 +class ActionDispatch::QueryParser + class << self + # -- + # Note this departs from WHATWG's specified parsing algorithm by + # giving a nil value for keys that do not use '='. Callers that need + # the standard's interpretation can use `v.to_s`. + # + # source://actionpack//lib/action_dispatch/http/query_parser.rb#29 + def each_pair(s, separator = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/query_parser.rb#11 + def strict_query_string_separator; end + + # source://actionpack//lib/action_dispatch/http/query_parser.rb#18 + def strict_query_string_separator=(value); end + end +end + +# source://actionpack//lib/action_dispatch/http/query_parser.rb#9 +ActionDispatch::QueryParser::COMMON_SEP = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/query_parser.rb#8 +ActionDispatch::QueryParser::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/railtie.rb#12 +class ActionDispatch::Railtie < ::Rails::Railtie; end + +# # Action Dispatch Reloader +# +# ActionDispatch::Reloader wraps the request with callbacks provided by +# ActiveSupport::Reloader, intended to assist with code reloading during +# development. +# +# ActionDispatch::Reloader is included in the middleware stack only if reloading +# is enabled, which it is by the default in `development` mode. +# +# source://actionpack//lib/action_dispatch/middleware/reloader.rb#14 +class ActionDispatch::Reloader < ::ActionDispatch::Executor; end + +# # Action Dispatch RemoteIp +# +# This middleware calculates the IP address of the remote client that is making +# the request. It does this by checking various headers that could contain the +# address, and then picking the last-set address that is not on the list of +# trusted IPs. This follows the precedent set by e.g. [the Tomcat +# server](https://issues.apache.org/bugzilla/show_bug.cgi?id=50453). A more +# detailed explanation of the algorithm is given at GetIp#calculate_ip. +# +# Some Rack servers concatenate repeated headers, like [HTTP RFC +# 2616](https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2) requires. +# Some Rack servers simply drop preceding headers, and only report the value +# that was [given in the last +# header](https://andre.arko.net/2011/12/26/repeated-headers-and-ruby-web-servers). +# If you are behind multiple proxy servers (like NGINX to HAProxy to +# Unicorn) then you should test your Rack server to make sure your data is good. +# +# IF YOU DON'T USE A PROXY, THIS MAKES YOU VULNERABLE TO IP SPOOFING. This +# middleware assumes that there is at least one proxy sitting around and setting +# headers with the client's remote IP address. If you don't use a proxy, because +# you are hosted on e.g. Heroku without SSL, any client can claim to have any IP +# address by setting the `X-Forwarded-For` header. If you care about that, then +# you need to explicitly drop or ignore those headers sometime before this +# middleware runs. Alternatively, remove this middleware to avoid inadvertently +# relying on it. +# +# source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#33 +class ActionDispatch::RemoteIp + # Create a new `RemoteIp` middleware instance. + # + # The `ip_spoofing_check` option is on by default. When on, an exception is + # raised if it looks like the client is trying to lie about its own IP address. + # It makes sense to turn off this check on sites aimed at non-IP clients (like + # WAP devices), or behind proxies that set headers in an incorrect or confusing + # way (like AWS ELB). + # + # The `custom_proxies` argument can take an enumerable which will be used + # instead of `TRUSTED_PROXIES`. Any proxy setup will put the value you want in + # the middle (or at the beginning) of the `X-Forwarded-For` list, with your + # proxy servers after it. If your proxies aren't removed, pass them in via the + # `custom_proxies` parameter. That way, the middleware will ignore those IP + # addresses, and return the one that you want. + # + # @return [RemoteIp] a new instance of RemoteIp + # + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#67 + def initialize(app, ip_spoofing_check = T.unsafe(nil), custom_proxies = T.unsafe(nil)); end + + # Since the IP address may not be needed, we store the object here without + # calculating the IP to keep from slowing down the majority of requests. For + # those requests that do need to know the IP, the GetIp#calculate_ip method will + # calculate the memoized client IP address. + # + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#95 + def call(env); end + + # Returns the value of attribute check_ip. + # + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#51 + def check_ip; end + + # Returns the value of attribute proxies. + # + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#51 + def proxies; end +end + +# The GetIp class exists as a way to defer processing of the request data into +# an actual IP address. If the ActionDispatch::Request#remote_ip method is +# called, this class will calculate the value and then memoize it. +# +# source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#104 +class ActionDispatch::RemoteIp::GetIp + # @return [GetIp] a new instance of GetIp + # + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#105 + def initialize(req, check_ip, proxies); end + + # Sort through the various IP address headers, looking for the IP most likely to + # be the address of the actual remote client making this request. + # + # REMOTE_ADDR will be correct if the request is made directly against the Ruby + # process, on e.g. Heroku. When the request is proxied by another server like + # HAProxy or NGINX, the IP address that made the original request will be put in + # an `X-Forwarded-For` header. If there are multiple proxies, that header may + # contain a list of IPs. Other proxy services set the `Client-Ip` header + # instead, so we check that too. + # + # As discussed in [this post about Rails IP + # Spoofing](https://web.archive.org/web/20170626095448/https://blog.gingerlime.com/2012/rails-ip-spoofing-vulnerabilities-and-protection/), + # while the first IP in the list is likely to be the "originating" IP, it + # could also have been set by the client maliciously. + # + # In order to find the first address that is (probably) accurate, we take the + # list of IPs, remove known and trusted proxies, and then take the last address + # left, which was presumably set by one of those proxies. + # + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#129 + def calculate_ip; end + + # Memoizes the value returned by #calculate_ip and returns it for + # ActionDispatch::Request to use. + # + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#174 + def to_s; end + + private + + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#197 + def filter_proxies(ips); end + + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#179 + def ips_from(header); end + + # source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#185 + def sanitize_ips(ips); end +end + +# source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#34 +class ActionDispatch::RemoteIp::IpSpoofAttackError < ::StandardError; end + +# The default trusted IPs list simply includes IP addresses that are guaranteed +# by the IP specification to be private addresses. Those will not be the +# ultimate client IP in production, and so are discarded. See +# https://en.wikipedia.org/wiki/Private_network for details. +# +# source://actionpack//lib/action_dispatch/middleware/remote_ip.rb#40 +ActionDispatch::RemoteIp::TRUSTED_PROXIES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/request.rb#20 +class ActionDispatch::Request + include ::ActionDispatch::Flash::RequestMethods + include ::Rack::Request::Helpers + include ::ActionDispatch::Http::Cache::Request + include ::ActionDispatch::Http::MimeNegotiation + include ::ActionDispatch::Http::Parameters + include ::ActionDispatch::Http::FilterParameters + include ::ActionDispatch::Http::URL + include ::ActionDispatch::ContentSecurityPolicy::Request + include ::Rack::Request::Env + include ::ActionDispatch::PermissionsPolicy::Request + include ::ActionDispatch::RequestCookieMethods + extend ::ActionDispatch::Http::Parameters::ClassMethods + + # @return [Request] a new instance of Request + # + # source://actionpack//lib/action_dispatch/http/request.rb#63 + def initialize(env); end + + # Override Rack's GET method to support indifferent access. + # + # source://actionpack//lib/action_dispatch/http/request.rb#400 + def GET; end + + # Override Rack's POST method to support indifferent access. + # + # source://actionpack//lib/action_dispatch/http/request.rb#413 + def POST; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def accept; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def accept_charset; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def accept_encoding; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def accept_language; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def auth_type; end + + # Returns the authorization header regardless of whether it was specified + # directly or through one of the proxy alternatives. + # + # source://actionpack//lib/action_dispatch/http/request.rb#465 + def authorization; end + + # The request body is an IO input stream. If the RAW_POST_DATA environment + # variable is already set, wrap it in a StringIO. + # + # source://actionpack//lib/action_dispatch/http/request.rb#362 + def body; end + + # source://actionpack//lib/action_dispatch/http/request.rb#382 + def body_stream; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def cache_control; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def client_ip; end + + # source://actionpack//lib/action_dispatch/http/request.rb#78 + def commit_cookie_jar!; end + + # source://actionpack//lib/action_dispatch/http/request.rb#497 + def commit_csrf_token; end + + # source://actionpack//lib/action_dispatch/http/request.rb#486 + def commit_flash; end + + # Returns the content length of the request as an integer. + # + # source://actionpack//lib/action_dispatch/http/request.rb#297 + def content_length; end + + # source://actionpack//lib/action_dispatch/http/request.rb#87 + def controller_class; end + + # source://actionpack//lib/action_dispatch/http/request.rb#93 + def controller_class_for(name); end + + # source://actionpack//lib/action_dispatch/http/request.rb#195 + def controller_instance; end + + # source://actionpack//lib/action_dispatch/http/request.rb#199 + def controller_instance=(controller); end + + # source://actionpack//lib/action_dispatch/http/request.rb#181 + def engine_script_name(_routes); end + + # source://actionpack//lib/action_dispatch/http/request.rb#185 + def engine_script_name=(name); end + + # Determine whether the request body contains form-data by checking the request + # `Content-Type` for one of the media-types: `application/x-www-form-urlencoded` + # or `multipart/form-data`. The list of form-data media types can be modified + # through the `FORM_DATA_MEDIA_TYPES` array. + # + # A request body is not assumed to contain form-data when no `Content-Type` + # header is provided and the request_method is POST. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/request.rb#378 + def form_data?; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def from; end + + # Returns the `String` full path including params of the last URL requested. + # + # # get "/articles" + # request.fullpath # => "/articles" + # + # # get "/articles?page=2" + # request.fullpath # => "/articles?page=2" + # + # source://actionpack//lib/action_dispatch/http/request.rb#276 + def fullpath; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def gateway_interface; end + + # Provides access to the request's HTTP headers, for example: + # + # request.headers["Content-Type"] # => "text/plain" + # + # source://actionpack//lib/action_dispatch/http/request.rb#237 + def headers; end + + # source://actionpack//lib/action_dispatch/http/request.rb#203 + def http_auth_salt; end + + # source://actionpack//lib/action_dispatch/http/request.rb#23 + def ignore_accept_header; end + + # source://actionpack//lib/action_dispatch/http/request.rb#23 + def ignore_accept_header=(val); end + + # source://actionpack//lib/action_dispatch/http/request.rb#489 + def inspect; end + + # Returns the IP address of client as a `String`. + # + # source://actionpack//lib/action_dispatch/http/request.rb#311 + def ip; end + + # Returns true if the request has a header matching the given key parameter. + # + # request.key? :ip_spoofing_check # => true + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/request.rb#114 + def key?(key); end + + # True if the request came from localhost, 127.0.0.1, or ::1. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/request.rb#473 + def local?; end + + # source://actionpack//lib/action_dispatch/http/request.rb#482 + def logger; end + + # The `String` MIME type of the request. + # + # # get "/articles" + # request.media_type # => "application/x-www-form-urlencoded" + # + # source://actionpack//lib/action_dispatch/http/request.rb#292 + def media_type; end + + # Returns the original value of the environment's REQUEST_METHOD, even if it was + # overridden by middleware. See #request_method for more information. + # + # For debugging purposes, when called with arguments this method will fall back + # to Object#method + # + # source://actionpack//lib/action_dispatch/http/request.rb#217 + def method(*args, **_arg1); end + + # Returns a symbol form of the #method. + # + # source://actionpack//lib/action_dispatch/http/request.rb#230 + def method_symbol; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def negotiate; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def origin; end + + # Returns a `String` with the last requested path including their params. + # + # # get '/foo' + # request.original_fullpath # => '/foo' + # + # # get '/foo?bar' + # request.original_fullpath # => '/foo?bar' + # + # source://actionpack//lib/action_dispatch/http/request.rb#265 + def original_fullpath; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def original_script_name; end + + # Returns the original request URL as a `String`. + # + # # get "/articles?page=2" + # request.original_url # => "http://www.example.com/articles?page=2" + # + # source://actionpack//lib/action_dispatch/http/request.rb#284 + def original_url; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def path_translated; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def pragma; end + + # Override Rack's GET method to support indifferent access. + # + # source://actionpack//lib/action_dispatch/http/request.rb#410 + def query_parameters; end + + # Returns the value of attribute rack_request. + # + # source://actionpack//lib/action_dispatch/http/request.rb#76 + def rack_request; end + + # Read the request body. This is useful for web services that need to work with + # raw requests directly. + # + # source://actionpack//lib/action_dispatch/http/request.rb#353 + def raw_post; end + + # source://actionpack//lib/action_dispatch/http/request.rb#144 + def raw_request_method; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def remote_addr; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def remote_host; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def remote_ident; end + + # Returns the IP address of client as a `String`, usually set by the RemoteIp + # middleware. + # + # source://actionpack//lib/action_dispatch/http/request.rb#317 + def remote_ip; end + + # source://actionpack//lib/action_dispatch/http/request.rb#321 + def remote_ip=(remote_ip); end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def remote_user; end + + # Returns the unique request id, which is based on either the `X-Request-Id` + # header that can be generated by a firewall, load balancer, or web server, or + # by the RequestId middleware (which sets the `action_dispatch.request_id` + # environment variable). + # + # This unique ID is useful for tracing a request from end-to-end as part of + # logging or debugging. This relies on the Rack variable set by the + # ActionDispatch::RequestId middleware. + # + # source://actionpack//lib/action_dispatch/http/request.rb#336 + def request_id; end + + # source://actionpack//lib/action_dispatch/http/request.rb#340 + def request_id=(id); end + + # Returns the HTTP method that the application should see. In the case where the + # method was overridden by a middleware (for instance, if a HEAD request was + # converted to a GET, or if a _method parameter was used to determine the method + # the application should use), this method returns the overridden value, not the + # original. + # + # source://actionpack//lib/action_dispatch/http/request.rb#151 + def request_method; end + + # source://actionpack//lib/action_dispatch/http/request.rb#189 + def request_method=(request_method); end + + # Returns a symbol form of the #request_method. + # + # source://actionpack//lib/action_dispatch/http/request.rb#208 + def request_method_symbol; end + + # Override Rack's POST method to support indifferent access. + # + # source://actionpack//lib/action_dispatch/http/request.rb#440 + def request_parameters; end + + # source://actionpack//lib/action_dispatch/http/request.rb#477 + def request_parameters=(params); end + + # source://actionpack//lib/action_dispatch/http/request.rb#442 + def request_parameters_list; end + + # source://actionpack//lib/action_dispatch/http/request.rb#493 + def reset_csrf_token; end + + # source://actionpack//lib/action_dispatch/http/request.rb#386 + def reset_session; end + + # source://actionpack//lib/action_dispatch/http/request.rb#169 + def route=(route); end + + # Returns the URI pattern of the matched route for the request, using the same + # format as `bin/rails routes`: + # + # request.route_uri_pattern # => "/:controller(/:action(/:id))(.:format)" + # + # source://actionpack//lib/action_dispatch/http/request.rb#159 + def route_uri_pattern; end + + # source://actionpack//lib/action_dispatch/http/request.rb#173 + def routes; end + + # source://actionpack//lib/action_dispatch/http/request.rb#177 + def routes=(routes); end + + # Early Hints is an HTTP/2 status code that indicates hints to help a client + # start making preparations for processing the final response. + # + # If the env contains `rack.early_hints` then the server accepts HTTP2 push for + # link headers. + # + # The `send_early_hints` method accepts a hash of links as follows: + # + # send_early_hints("link" => "; rel=preload; as=style,; rel=preload") + # + # If you are using {javascript_include_tag}[rdoc-ref:ActionView::Helpers::AssetTagHelper#javascript_include_tag] + # or {stylesheet_link_tag}[rdoc-ref:ActionView::Helpers::AssetTagHelper#stylesheet_link_tag] + # the Early Hints headers are included by default if supported. + # + # source://actionpack//lib/action_dispatch/http/request.rb#254 + def send_early_hints(links); end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def server_name; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def server_protocol; end + + # Returns the lowercase name of the HTTP server software. + # + # source://actionpack//lib/action_dispatch/http/request.rb#347 + def server_software; end + + # source://actionpack//lib/action_dispatch/http/request.rb#391 + def session=(session); end + + # source://actionpack//lib/action_dispatch/http/request.rb#395 + def session_options=(options); end + + # Returns the unique request id, which is based on either the `X-Request-Id` + # header that can be generated by a firewall, load balancer, or web server, or + # by the RequestId middleware (which sets the `action_dispatch.request_id` + # environment variable). + # + # This unique ID is useful for tracing a request from end-to-end as part of + # logging or debugging. This relies on the Rack variable set by the + # ActionDispatch::RequestId middleware. + # + # source://actionpack//lib/action_dispatch/http/request.rb#344 + def uuid; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def version; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def x_csrf_token; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def x_forwarded_for; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def x_forwarded_host; end + + # source://actionpack//lib/action_dispatch/http/request.rb#49 + def x_request_id; end + + # Returns true if the `X-Requested-With` header contains "XMLHttpRequest" + # (case-insensitive), which may need to be manually added depending on the + # choice of JavaScript libraries and frameworks. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/request.rb#308 + def xhr?; end + + # Returns true if the `X-Requested-With` header contains "XMLHttpRequest" + # (case-insensitive), which may need to be manually added depending on the + # choice of JavaScript libraries and frameworks. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/request.rb#305 + def xml_http_request?; end + + private + + # source://actionpack//lib/action_dispatch/http/request.rb#502 + def check_method(name); end + + # source://actionpack//lib/action_dispatch/http/request.rb#510 + def default_session; end + + # source://actionpack//lib/action_dispatch/http/request.rb#540 + def fallback_request_parameters; end + + # source://actionpack//lib/action_dispatch/http/request.rb#514 + def read_body_stream; end + + # source://actionpack//lib/action_dispatch/http/request.rb#526 + def reset_stream(body_stream); end + + class << self + # source://actionpack//lib/action_dispatch/http/request.rb#59 + def empty; end + + # source://actionpack//lib/action_dispatch/http/request.rb#23 + def ignore_accept_header; end + + # source://actionpack//lib/action_dispatch/http/request.rb#23 + def ignore_accept_header=(val); end + + # source://actionpack//lib/action_dispatch/http/request.rb#24 + def parameter_parsers; end + end +end + +# source://actionpack//lib/action_dispatch/http/request.rb#326 +ActionDispatch::Request::ACTION_DISPATCH_REQUEST_ID = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/request.rb#35 +ActionDispatch::Request::ENV_METHODS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/request.rb#135 +ActionDispatch::Request::HTTP_METHODS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/request.rb#137 +ActionDispatch::Request::HTTP_METHOD_LOOKUP = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/request.rb#33 +ActionDispatch::Request::LOCALHOST = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/http/request.rb#81 +class ActionDispatch::Request::PASS_NOT_FOUND + class << self + # source://actionpack//lib/action_dispatch/http/request.rb#82 + def action(_); end + + # source://actionpack//lib/action_dispatch/http/request.rb#84 + def action_encoding_template(action); end + + # source://actionpack//lib/action_dispatch/http/request.rb#83 + def call(_); end + end +end + +# HTTP methods from [RFC 2518: HTTP Extensions for Distributed Authoring -- WEBDAV](https://www.ietf.org/rfc/rfc2518.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#121 +ActionDispatch::Request::RFC2518 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1](https://www.ietf.org/rfc/rfc2616.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#119 +ActionDispatch::Request::RFC2616 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 3253: Versioning Extensions to WebDAV](https://www.ietf.org/rfc/rfc3253.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#123 +ActionDispatch::Request::RFC3253 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 3648: WebDAV Ordered Collections Protocol](https://www.ietf.org/rfc/rfc3648.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#125 +ActionDispatch::Request::RFC3648 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 3744: WebDAV Access Control Protocol](https://www.ietf.org/rfc/rfc3744.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#127 +ActionDispatch::Request::RFC3744 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 4791: Calendaring Extensions to WebDAV](https://www.ietf.org/rfc/rfc4791.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#131 +ActionDispatch::Request::RFC4791 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 5323: WebDAV SEARCH](https://www.ietf.org/rfc/rfc5323.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#129 +ActionDispatch::Request::RFC5323 = T.let(T.unsafe(nil), Array) + +# HTTP methods from [RFC 5789: PATCH Method for HTTP](https://www.ietf.org/rfc/rfc5789.txt) +# +# source://actionpack//lib/action_dispatch/http/request.rb#133 +ActionDispatch::Request::RFC5789 = T.let(T.unsafe(nil), Array) + +# Session is responsible for lazily loading the session from store. +# +# source://actionpack//lib/action_dispatch/request/session.rb#10 +class ActionDispatch::Request::Session + # @return [Session] a new instance of Session + # + # source://actionpack//lib/action_dispatch/request/session.rb#76 + def initialize(by, req, enabled: T.unsafe(nil)); end + + # Returns value of the key stored in the session or `nil` if the given key is + # not found in the session. + # + # source://actionpack//lib/action_dispatch/request/session.rb#114 + def [](key); end + + # Writes given value to given key of the session. + # + # source://actionpack//lib/action_dispatch/request/session.rb#154 + def []=(key, value); end + + # Clears the session. + # + # source://actionpack//lib/action_dispatch/request/session.rb#161 + def clear; end + + # Deletes given key from the session. + # + # source://actionpack//lib/action_dispatch/request/session.rb#194 + def delete(key); end + + # source://actionpack//lib/action_dispatch/request/session.rb#99 + def destroy; end + + # Returns the nested value specified by the sequence of keys, returning `nil` if + # any intermediate step is `nil`. + # + # source://actionpack//lib/action_dispatch/request/session.rb#127 + def dig(*keys); end + + # source://actionpack//lib/action_dispatch/request/session.rb#245 + def each(&block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/request/session.rb#240 + def empty?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/request/session.rb#91 + def enabled?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/request/session.rb#230 + def exists?; end + + # Returns value of the given key from the session, or raises `KeyError` if can't + # find the given key and no default value is set. Returns default value if + # specified. + # + # session.fetch(:foo) + # # => KeyError: key not found: "foo" + # + # session.fetch(:foo, :bar) + # # => :bar + # + # session.fetch(:foo) do + # :bar + # end + # # => :bar + # + # source://actionpack//lib/action_dispatch/request/session.rb#213 + def fetch(key, default = T.unsafe(nil), &block); end + + # Returns true if the session has the given key or false. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/request/session.rb#134 + def has_key?(key); end + + # source://actionpack//lib/action_dispatch/request/session.rb#87 + def id; end + + # source://actionpack//lib/action_dispatch/request/session.rb#249 + def id_was; end + + # Returns true if the session has the given key or false. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/request/session.rb#139 + def include?(key); end + + # source://actionpack//lib/action_dispatch/request/session.rb#222 + def inspect; end + + # Returns true if the session has the given key or false. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/request/session.rb#138 + def key?(key); end + + # Returns keys of the session as Array. + # + # source://actionpack//lib/action_dispatch/request/session.rb#142 + def keys; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/request/session.rb#236 + def loaded?; end + + # Updates the session with given Hash. + # + # session.to_hash + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2"} + # + # session.update({ "foo" => "bar" }) + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"} + # + # session.to_hash + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"} + # + # source://actionpack//lib/action_dispatch/request/session.rb#191 + def merge!(hash); end + + # source://actionpack//lib/action_dispatch/request/session.rb#95 + def options; end + + # Writes given value to given key of the session. + # + # source://actionpack//lib/action_dispatch/request/session.rb#158 + def store(key, value); end + + # Returns the session as Hash. + # + # source://actionpack//lib/action_dispatch/request/session.rb#171 + def to_h; end + + # Returns the session as Hash. + # + # source://actionpack//lib/action_dispatch/request/session.rb#167 + def to_hash; end + + # Updates the session with given Hash. + # + # session.to_hash + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2"} + # + # session.update({ "foo" => "bar" }) + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"} + # + # session.to_hash + # # => {"session_id"=>"e29b9ea315edf98aad94cc78c34cc9b2", "foo" => "bar"} + # + # source://actionpack//lib/action_dispatch/request/session.rb#183 + def update(hash); end + + # Returns values of the session as Array. + # + # source://actionpack//lib/action_dispatch/request/session.rb#148 + def values; end + + private + + # source://actionpack//lib/action_dispatch/request/session.rb#271 + def load!; end + + # source://actionpack//lib/action_dispatch/request/session.rb#267 + def load_for_delete!; end + + # source://actionpack//lib/action_dispatch/request/session.rb#255 + def load_for_read!; end + + # source://actionpack//lib/action_dispatch/request/session.rb#259 + def load_for_write!; end + + class << self + # Creates a session hash, merging the properties of the previous session if any. + # + # source://actionpack//lib/action_dispatch/request/session.rb#19 + def create(store, req, default_options); end + + # source://actionpack//lib/action_dispatch/request/session.rb#43 + def delete(req); end + + # source://actionpack//lib/action_dispatch/request/session.rb#29 + def disabled(req); end + + # source://actionpack//lib/action_dispatch/request/session.rb#35 + def find(req); end + + # source://actionpack//lib/action_dispatch/request/session.rb#39 + def set(req, session); end + end +end + +# source://actionpack//lib/action_dispatch/request/session.rb#11 +class ActionDispatch::Request::Session::DisabledSessionError < ::StandardError; end + +# source://actionpack//lib/action_dispatch/request/session.rb#12 +ActionDispatch::Request::Session::ENV_SESSION_KEY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/request/session.rb#13 +ActionDispatch::Request::Session::ENV_SESSION_OPTIONS_KEY = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/request/session.rb#47 +class ActionDispatch::Request::Session::Options + # @return [Options] a new instance of Options + # + # source://actionpack//lib/action_dispatch/request/session.rb#56 + def initialize(by, default_options); end + + # source://actionpack//lib/action_dispatch/request/session.rb#61 + def [](key); end + + # source://actionpack//lib/action_dispatch/request/session.rb#71 + def []=(k, v); end + + # source://actionpack//lib/action_dispatch/request/session.rb#65 + def id(req); end + + # source://actionpack//lib/action_dispatch/request/session.rb#72 + def to_hash; end + + # source://actionpack//lib/action_dispatch/request/session.rb#73 + def values_at(*args); end + + class << self + # source://actionpack//lib/action_dispatch/request/session.rb#52 + def find(req); end + + # source://actionpack//lib/action_dispatch/request/session.rb#48 + def set(req, options); end + end +end + +# Singleton object used to determine if an optional param wasn't specified. +# +# source://actionpack//lib/action_dispatch/request/session.rb#16 +ActionDispatch::Request::Session::Unspecified = T.let(T.unsafe(nil), Object) + +# source://actionpack//lib/action_dispatch/http/request.rb#57 +ActionDispatch::Request::TRANSFER_ENCODING = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/request/utils.rb#9 +class ActionDispatch::Request::Utils + # source://actionpack//lib/action_dispatch/request/utils.rb#10 + def perform_deep_munge; end + + # source://actionpack//lib/action_dispatch/request/utils.rb#10 + def perform_deep_munge=(val); end + + class << self + # source://actionpack//lib/action_dispatch/request/utils.rb#31 + def check_param_encoding(params); end + + # source://actionpack//lib/action_dispatch/request/utils.rb#12 + def each_param_value(params, &block); end + + # source://actionpack//lib/action_dispatch/request/utils.rb#23 + def normalize_encode_params(params); end + + # source://actionpack//lib/action_dispatch/request/utils.rb#10 + def perform_deep_munge; end + + # source://actionpack//lib/action_dispatch/request/utils.rb#10 + def perform_deep_munge=(val); end + + # source://actionpack//lib/action_dispatch/request/utils.rb#46 + def set_binary_encoding(request, params, controller, action); end + end +end + +# source://actionpack//lib/action_dispatch/request/utils.rb#85 +class ActionDispatch::Request::Utils::CustomParamEncoder + class << self + # source://actionpack//lib/action_dispatch/request/utils.rb#106 + def action_encoding_template(request, controller, action); end + + # source://actionpack//lib/action_dispatch/request/utils.rb#101 + def encode(request, params, controller, action); end + + # source://actionpack//lib/action_dispatch/request/utils.rb#86 + def encode_for_template(params, encoding_template); end + end +end + +# Remove nils from the params hash. +# +# source://actionpack//lib/action_dispatch/request/utils.rb#77 +class ActionDispatch::Request::Utils::NoNilParamEncoder < ::ActionDispatch::Request::Utils::ParamEncoder + class << self + # source://actionpack//lib/action_dispatch/request/utils.rb#78 + def handle_array(params); end + end +end + +# source://actionpack//lib/action_dispatch/request/utils.rb#50 +class ActionDispatch::Request::Utils::ParamEncoder + class << self + # source://actionpack//lib/action_dispatch/request/utils.rb#71 + def handle_array(params); end + + # Convert nested Hash to HashWithIndifferentAccess. + # + # source://actionpack//lib/action_dispatch/request/utils.rb#52 + def normalize_encode_params(params); end + end +end + +# source://actionpack//lib/action_dispatch/middleware/cookies.rb#12 +module ActionDispatch::RequestCookieMethods + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#50 + def authenticated_encrypted_cookie_salt; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#13 + def cookie_jar; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#30 + def cookie_jar=(jar); end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#78 + def cookies_digest; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#82 + def cookies_rotations; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#74 + def cookies_same_site_protection; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#70 + def cookies_serializer; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#58 + def encrypted_cookie_cipher; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#42 + def encrypted_cookie_salt; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#46 + def encrypted_signed_cookie_salt; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#26 + def have_cookie_jar?; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#34 + def key_generator; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#66 + def secret_key_base; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#62 + def signed_cookie_digest; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#38 + def signed_cookie_salt; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#54 + def use_authenticated_cookie_encryption; end + + # source://actionpack//lib/action_dispatch/middleware/cookies.rb#86 + def use_cookies_with_metadata; end +end + +# source://actionpack//lib/action_dispatch/testing/request_encoder.rb#9 +class ActionDispatch::RequestEncoder + # @return [RequestEncoder] a new instance of RequestEncoder + # + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#21 + def initialize(mime_name, param_encoder, response_parser, content_type); end + + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#34 + def accept_header; end + + # Returns the value of attribute content_type. + # + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#19 + def content_type; end + + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#38 + def encode_params(params); end + + # Returns the value of attribute response_parser. + # + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#19 + def response_parser; end + + class << self + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#47 + def encoder(name); end + + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#42 + def parser(content_type); end + + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#51 + def register_encoder(mime_name, param_encoder: T.unsafe(nil), response_parser: T.unsafe(nil), content_type: T.unsafe(nil)); end + end +end + +# source://actionpack//lib/action_dispatch/testing/request_encoder.rb#10 +class ActionDispatch::RequestEncoder::IdentityEncoder + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#12 + def accept_header; end + + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#11 + def content_type; end + + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#13 + def encode_params(params); end + + # source://actionpack//lib/action_dispatch/testing/request_encoder.rb#14 + def response_parser; end +end + +# # Action Dispatch RequestId +# +# Makes a unique request id available to the `action_dispatch.request_id` env +# variable (which is then accessible through ActionDispatch::Request#request_id +# or the alias ActionDispatch::Request#uuid) and sends the same id to the client +# via the `X-Request-Id` header. +# +# The unique request id is either based on the `X-Request-Id` header in the +# request, which would typically be generated by a firewall, load balancer, or +# the web server, or, if this header is not available, a random uuid. If the +# header is accepted from the outside world, we sanitize it to a max of 255 +# chars and alphanumeric and dashes only. +# +# The unique request id can be used to trace a request end-to-end and would +# typically end up being part of log files from multiple pieces of the stack. +# +# source://actionpack//lib/action_dispatch/middleware/request_id.rb#24 +class ActionDispatch::RequestId + # @return [RequestId] a new instance of RequestId + # + # source://actionpack//lib/action_dispatch/middleware/request_id.rb#25 + def initialize(app, header:); end + + # source://actionpack//lib/action_dispatch/middleware/request_id.rb#31 + def call(env); end + + private + + # source://actionpack//lib/action_dispatch/middleware/request_id.rb#46 + def internal_request_id; end + + # source://actionpack//lib/action_dispatch/middleware/request_id.rb#38 + def make_request_id(request_id); end +end + +# # Action Dispatch Response +# +# Represents an HTTP response generated by a controller action. Use it to +# retrieve the current state of the response, or customize the response. It can +# either represent a real HTTP response (i.e. one that is meant to be sent back +# to the web browser) or a TestResponse (i.e. one that is generated from +# integration tests). +# +# The Response object for the current request is exposed on controllers as +# ActionController::Metal#response. ActionController::Metal also provides a few +# additional methods that delegate to attributes of the Response such as +# ActionController::Metal#headers. +# +# Integration tests will likely also want to inspect responses in more detail. +# Methods such as Integration::RequestHelpers#get and +# Integration::RequestHelpers#post return instances of TestResponse (which +# inherits from Response) for this purpose. +# +# For example, the following demo integration test prints the body of the +# controller response to the console: +# +# class DemoControllerTest < ActionDispatch::IntegrationTest +# def test_print_root_path_to_console +# get('/') +# puts response.body +# end +# end +# +# source://actionpack//lib/action_dispatch/http/response.rb#38 +class ActionDispatch::Response + include ::Rack::Response::Helpers + include ::ActionDispatch::Http::FilterRedirect + include ::ActionDispatch::Http::Cache::Response + include ::MonitorMixin + + # @return [Response] a new instance of Response + # @yield [_self] + # @yieldparam _self [ActionDispatch::Response] the object that the method was called on + # + # source://actionpack//lib/action_dispatch/http/response.rb#197 + def initialize(status = T.unsafe(nil), headers = T.unsafe(nil), body = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/response.rb#89 + def [](*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/http/response.rb#89 + def []=(*_arg0, **_arg1, &_arg2); end + + # Aliasing these off because AD::Http::Cache::Response defines them. + # + # source://actionpack//lib/action_dispatch/http/response.rb#107 + def _cache_control; end + + # source://actionpack//lib/action_dispatch/http/response.rb#108 + def _cache_control=(value); end + + # source://actionpack//lib/action_dispatch/http/response.rb#446 + def abort; end + + # source://actionpack//lib/action_dispatch/http/response.rb#223 + def await_commit; end + + # source://actionpack//lib/action_dispatch/http/response.rb#229 + def await_sent; end + + # Returns the content of the response as a string. This contains the contents of + # any calls to `render`. + # + # source://actionpack//lib/action_dispatch/http/response.rb#369 + def body; end + + # Allows you to manually set or override the response body. + # + # source://actionpack//lib/action_dispatch/http/response.rb#384 + def body=(body); end + + # source://actionpack//lib/action_dispatch/http/response.rb#433 + def body_parts; end + + # The charset of the response. HTML wants to know the encoding of the content + # you're giving them, so we need to send that along. + # + # source://actionpack//lib/action_dispatch/http/response.rb#339 + def charset; end + + # Sets the HTTP character set. In case of `nil` parameter it sets the charset to + # `default_charset`. + # + # response.charset = 'utf-16' # => 'utf-16' + # response.charset = nil # => 'utf-8' + # + # source://actionpack//lib/action_dispatch/http/response.rb#328 + def charset=(charset); end + + # source://actionpack//lib/action_dispatch/http/response.rb#442 + def close; end + + # Returns a string to ensure compatibility with `Net::HTTPResponse`. + # + # source://actionpack//lib/action_dispatch/http/response.rb#350 + def code; end + + # source://actionpack//lib/action_dispatch/http/response.rb#233 + def commit!; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/response.rb#257 + def committed?; end + + # Content type of response. + # + # source://actionpack//lib/action_dispatch/http/response.rb#308 + def content_type; end + + # Sets the HTTP response's content MIME type. For example, in the controller you + # could write this: + # + # response.content_type = "text/html" + # + # This method also accepts a symbol with the extension of the MIME type: + # + # response.content_type = :html + # + # If a character set has been defined for this response (see #charset=) then the + # character set information will also be included in the content type + # information. + # + # source://actionpack//lib/action_dispatch/http/response.rb#289 + def content_type=(content_type); end + + # Returns the response cookies, converted to a Hash of (name => value) pairs + # + # assert_equal 'AuthorOfNewPage', r.cookies['author'] + # + # source://actionpack//lib/action_dispatch/http/response.rb#469 + def cookies; end + + # source://actionpack//lib/action_dispatch/http/response.rb#102 + def default_charset; end + + # source://actionpack//lib/action_dispatch/http/response.rb#102 + def default_charset=(val); end + + # source://actionpack//lib/action_dispatch/http/response.rb#103 + def default_headers; end + + # source://actionpack//lib/action_dispatch/http/response.rb#103 + def default_headers=(val); end + + # source://actionpack//lib/action_dispatch/http/response.rb#221 + def delete_header(key); end + + # source://actionpack//lib/action_dispatch/http/response.rb#91 + def each(&block); end + + # source://actionpack//lib/action_dispatch/http/response.rb#219 + def get_header(key); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/response.rb#218 + def has_header?(key); end + + # The headers for the response. + # + # header["Content-Type"] # => "text/plain" + # header["Content-Type"] = "application/json" + # header["Content-Type"] # => "application/json" + # + # Also aliased as `headers`. + # + # headers["Content-Type"] # => "text/plain" + # headers["Content-Type"] = "application/json" + # headers["Content-Type"] # => "application/json" + # + # Also aliased as `header` for compatibility. + # + # source://actionpack//lib/action_dispatch/http/response.rb#87 + def header; end + + # The headers for the response. + # + # header["Content-Type"] # => "text/plain" + # header["Content-Type"] = "application/json" + # header["Content-Type"] # => "application/json" + # + # Also aliased as `headers`. + # + # headers["Content-Type"] # => "text/plain" + # headers["Content-Type"] = "application/json" + # headers["Content-Type"] # => "application/json" + # + # Also aliased as `header` for compatibility. + # + # source://actionpack//lib/action_dispatch/http/response.rb#85 + def headers; end + + # Media type of response. + # + # source://actionpack//lib/action_dispatch/http/response.rb#313 + def media_type; end + + # Returns the corresponding message for the current HTTP status code: + # + # response.status = 200 + # response.message # => "OK" + # + # response.status = 404 + # response.message # => "Not Found" + # + # source://actionpack//lib/action_dispatch/http/response.rb#362 + def message; end + + # Turns the Response into a Rack-compatible array of the status, headers, and + # body. Allows explicit splatting: + # + # status, headers, body = *response + # + # source://actionpack//lib/action_dispatch/http/response.rb#464 + def prepare!; end + + # The location header we'll be responding with. + # + # source://actionpack//lib/action_dispatch/http/response.rb#440 + def redirect_url; end + + # The request that the response is responding to. + # + # source://actionpack//lib/action_dispatch/http/response.rb#67 + def request; end + + # The request that the response is responding to. + # + # source://actionpack//lib/action_dispatch/http/response.rb#67 + def request=(_arg0); end + + # source://actionpack//lib/action_dispatch/http/response.rb#429 + def reset_body!; end + + # The response code of the request. + # + # source://actionpack//lib/action_dispatch/http/response.rb#345 + def response_code; end + + # Send the file stored at `path` as the response body. + # + # source://actionpack//lib/action_dispatch/http/response.rb#424 + def send_file(path); end + + # source://actionpack//lib/action_dispatch/http/response.rb#241 + def sending!; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/response.rb#256 + def sending?; end + + # source://actionpack//lib/action_dispatch/http/response.rb#317 + def sending_file=(v); end + + # source://actionpack//lib/action_dispatch/http/response.rb#249 + def sent!; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/response.rb#258 + def sent?; end + + # source://actionpack//lib/action_dispatch/http/response.rb#220 + def set_header(key, v); end + + # The HTTP status code. + # + # source://actionpack//lib/action_dispatch/http/response.rb#70 + def status; end + + # Sets the HTTP status code. + # + # source://actionpack//lib/action_dispatch/http/response.rb#273 + def status=(status); end + + # Returns the corresponding message for the current HTTP status code: + # + # response.status = 200 + # response.message # => "OK" + # + # response.status = 404 + # response.message # => "Not Found" + # + # source://actionpack//lib/action_dispatch/http/response.rb#365 + def status_message; end + + # The underlying body, as a streamable object. + # + # source://actionpack//lib/action_dispatch/http/response.rb#195 + def stream; end + + # Turns the Response into a Rack-compatible array of the status, headers, and + # body. Allows explicit splatting: + # + # status, headers, body = *response + # + # source://actionpack//lib/action_dispatch/http/response.rb#460 + def to_a; end + + # source://actionpack//lib/action_dispatch/http/response.rb#379 + def write(string); end + + private + + # source://actionpack//lib/action_dispatch/http/response.rb#535 + def assign_default_content_type_and_charset!; end + + # source://actionpack//lib/action_dispatch/http/response.rb#513 + def before_committed; end + + # source://actionpack//lib/action_dispatch/http/response.rb#521 + def before_sending; end + + # source://actionpack//lib/action_dispatch/http/response.rb#531 + def build_buffer(response, body); end + + # source://actionpack//lib/action_dispatch/http/response.rb#587 + def handle_no_content!; end + + # source://actionpack//lib/action_dispatch/http/response.rb#493 + def parse_content_type(content_type); end + + # Small internal convenience method to get the parsed version of the current + # content type header. + # + # source://actionpack//lib/action_dispatch/http/response.rb#503 + def parsed_content_type_header; end + + # source://actionpack//lib/action_dispatch/http/response.rb#594 + def rack_response(status, headers); end + + # source://actionpack//lib/action_dispatch/http/response.rb#507 + def set_content_type(content_type, charset); end + + class << self + # source://actionpack//lib/action_dispatch/http/response.rb#185 + def create(status = T.unsafe(nil), headers = T.unsafe(nil), body = T.unsafe(nil), default_headers: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/response.rb#102 + def default_charset; end + + # source://actionpack//lib/action_dispatch/http/response.rb#102 + def default_charset=(val); end + + # source://actionpack//lib/action_dispatch/http/response.rb#103 + def default_headers; end + + # source://actionpack//lib/action_dispatch/http/response.rb#103 + def default_headers=(val); end + + # source://actionpack//lib/action_dispatch/http/response.rb#190 + def merge_default_headers(original, default); end + + # source://actionpack//lib/action_dispatch/http/response.rb#51 + def rack_status_code(status); end + end +end + +# source://actionpack//lib/action_dispatch/http/response.rb#114 +class ActionDispatch::Response::Buffer + # @return [Buffer] a new instance of Buffer + # + # source://actionpack//lib/action_dispatch/http/response.rb#115 + def initialize(response, buf); end + + # @raise [IOError] + # + # source://actionpack//lib/action_dispatch/http/response.rb#155 + def <<(string); end + + # source://actionpack//lib/action_dispatch/http/response.rb#167 + def abort; end + + # source://actionpack//lib/action_dispatch/http/response.rb#140 + def body; end + + # source://actionpack//lib/action_dispatch/http/response.rb#170 + def close; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/response.rb#175 + def closed?; end + + # source://actionpack//lib/action_dispatch/http/response.rb#157 + def each(&block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/response.rb#124 + def respond_to?(method, include_private = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/response.rb#132 + def to_ary; end + + # @raise [IOError] + # + # source://actionpack//lib/action_dispatch/http/response.rb#148 + def write(string); end + + private + + # source://actionpack//lib/action_dispatch/http/response.rb#180 + def each_chunk(&block); end +end + +# source://actionpack//lib/action_dispatch/http/response.rb#122 +ActionDispatch::Response::Buffer::BODY_METHODS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/response.rb#98 +ActionDispatch::Response::CONTENT_TYPE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/response.rb#487 +ActionDispatch::Response::CONTENT_TYPE_PARSER = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/http/response.rb#484 +class ActionDispatch::Response::ContentTypeHeader < ::Struct + # Returns the value of attribute charset + # + # @return [Object] the current value of charset + # + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def charset; end + + # Sets the attribute charset + # + # @param value [Object] the value to set the attribute charset to. + # @return [Object] the newly set value + # + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def charset=(_); end + + # Returns the value of attribute mime_type + # + # @return [Object] the current value of mime_type + # + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def mime_type; end + + # Sets the attribute mime_type + # + # @param value [Object] the value to set the attribute mime_type to. + # @return [Object] the newly set value + # + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def mime_type=(_); end + + class << self + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def [](*_arg0); end + + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def inspect; end + + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def keyword_init?; end + + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def members; end + + # source://actionpack//lib/action_dispatch/http/response.rb#484 + def new(*_arg0); end + end +end + +# Avoid having to pass an open file handle as the response body. Rack::Sendfile +# will usually intercept the response and uses the path directly, so there is no +# reason to open the file. +# +# source://actionpack//lib/action_dispatch/http/response.rb#402 +class ActionDispatch::Response::FileBody + # @return [FileBody] a new instance of FileBody + # + # source://actionpack//lib/action_dispatch/http/response.rb#405 + def initialize(path); end + + # source://actionpack//lib/action_dispatch/http/response.rb#409 + def body; end + + # Stream the file's contents if Rack::Sendfile isn't present. + # + # source://actionpack//lib/action_dispatch/http/response.rb#414 + def each; end + + # source://actionpack//lib/action_dispatch/http/response.rb#403 + def to_path; end +end + +# To be deprecated: +# +# source://actionpack//lib/action_dispatch/http/response.rb#64 +ActionDispatch::Response::Header = Rack::Headers + +# source://actionpack//lib/action_dispatch/http/response.rb#42 +ActionDispatch::Response::Headers = Rack::Headers + +# source://actionpack//lib/action_dispatch/http/response.rb#100 +ActionDispatch::Response::NO_CONTENT_CODES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/http/response.rb#485 +ActionDispatch::Response::NullContentTypeHeader = T.let(T.unsafe(nil), ActionDispatch::Response::ContentTypeHeader) + +# source://actionpack//lib/action_dispatch/http/response.rb#543 +class ActionDispatch::Response::RackBody + # @return [RackBody] a new instance of RackBody + # + # source://actionpack//lib/action_dispatch/http/response.rb#544 + def initialize(response); end + + # source://actionpack//lib/action_dispatch/http/response.rb#556 + def body; end + + # source://actionpack//lib/action_dispatch/http/response.rb#578 + def call(*arguments, &block); end + + # source://actionpack//lib/action_dispatch/http/response.rb#550 + def close; end + + # source://actionpack//lib/action_dispatch/http/response.rb#574 + def each(*args, &block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/response.rb#562 + def respond_to?(method, include_private = T.unsafe(nil)); end + + # Returns the value of attribute response. + # + # source://actionpack//lib/action_dispatch/http/response.rb#548 + def response; end + + # source://actionpack//lib/action_dispatch/http/response.rb#570 + def to_ary; end + + # source://actionpack//lib/action_dispatch/http/response.rb#582 + def to_path; end +end + +# source://actionpack//lib/action_dispatch/http/response.rb#560 +ActionDispatch::Response::RackBody::BODY_METHODS = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/response.rb#99 +ActionDispatch::Response::SET_COOKIE = T.let(T.unsafe(nil), String) + +# The routing module provides URL rewriting in native Ruby. It's a way to +# redirect incoming requests to controllers and actions. This replaces +# mod_rewrite rules. Best of all, Rails' Routing works with any web server. +# Routes are defined in `config/routes.rb`. +# +# Think of creating routes as drawing a map for your requests. The map tells +# them where to go based on some predefined pattern: +# +# Rails.application.routes.draw do +# Pattern 1 tells some request to go to one place +# Pattern 2 tell them to go to another +# ... +# end +# +# The following symbols are special: +# +# :controller maps to your controller name +# :action maps to an action with your controllers +# +# Other names simply map to a parameter as in the case of `:id`. +# +# ## Resources +# +# Resource routing allows you to quickly declare all of the common routes for a +# given resourceful controller. Instead of declaring separate routes for your +# `index`, `show`, `new`, `edit`, `create`, `update`, and `destroy` actions, a +# resourceful route declares them in a single line of code: +# +# resources :photos +# +# Sometimes, you have a resource that clients always look up without referencing +# an ID. A common example, /profile always shows the profile of the currently +# logged in user. In this case, you can use a singular resource to map /profile +# (rather than /profile/:id) to the show action. +# +# resource :profile +# +# It's common to have resources that are logically children of other resources: +# +# resources :magazines do +# resources :ads +# end +# +# You may wish to organize groups of controllers under a namespace. Most +# commonly, you might group a number of administrative controllers under an +# `admin` namespace. You would place these controllers under the +# `app/controllers/admin` directory, and you can group them together in your +# router: +# +# namespace "admin" do +# resources :posts, :comments +# end +# +# Alternatively, you can add prefixes to your path without using a separate +# directory by using `scope`. `scope` takes additional options which apply to +# all enclosed routes. +# +# scope path: "/cpanel", as: 'admin' do +# resources :posts, :comments +# end +# +# For more, see Routing::Mapper::Resources#resources, +# Routing::Mapper::Scoping#namespace, and Routing::Mapper::Scoping#scope. +# +# ## Non-resourceful routes +# +# For routes that don't fit the `resources` mold, you can use the HTTP helper +# methods `get`, `post`, `patch`, `put` and `delete`. +# +# get 'post/:id', to: 'posts#show' +# post 'post/:id', to: 'posts#create_comment' +# +# Now, if you POST to `/posts/:id`, it will route to the `create_comment` +# action. A GET on the same URL will route to the `show` action. +# +# If your route needs to respond to more than one HTTP method (or all methods) +# then using the `:via` option on `match` is preferable. +# +# match 'post/:id', to: 'posts#show', via: [:get, :post] +# +# ## Named routes +# +# Routes can be named by passing an `:as` option, allowing for easy reference +# within your source as `name_of_route_url` for the full URL and +# `name_of_route_path` for the URI path. +# +# Example: +# +# # In config/routes.rb +# get '/login', to: 'accounts#login', as: 'login' +# +# # With render, redirect_to, tests, etc. +# redirect_to login_url +# +# Arguments can be passed as well. +# +# redirect_to show_item_path(id: 25) +# +# Use `root` as a shorthand to name a route for the root path "/". +# +# # In config/routes.rb +# root to: 'blogs#index' +# +# # would recognize http://www.example.com/ as +# params = { controller: 'blogs', action: 'index' } +# +# # and provide these named routes +# root_url # => 'http://www.example.com/' +# root_path # => '/' +# +# Note: when using `controller`, the route is simply named after the method you +# call on the block parameter rather than map. +# +# # In config/routes.rb +# controller :blog do +# get 'blog/show' => :list +# get 'blog/delete' => :delete +# get 'blog/edit' => :edit +# end +# +# # provides named routes for show, delete, and edit +# link_to @article.title, blog_show_path(id: @article.id) +# +# ## Pretty URLs +# +# Routes can generate pretty URLs. For example: +# +# get '/articles/:year/:month/:day', to: 'articles#find_by_id', constraints: { +# year: /\d{4}/, +# month: /\d{1,2}/, +# day: /\d{1,2}/ +# } +# +# Using the route above, the URL "http://localhost:3000/articles/2005/11/06" +# maps to +# +# params = {year: '2005', month: '11', day: '06'} +# +# ## Regular Expressions and parameters +# You can specify a regular expression to define a format for a parameter. +# +# controller 'geocode' do +# get 'geocode/:postalcode', to: :show, constraints: { +# postalcode: /\d{5}(-\d{4})?/ +# } +# end +# +# Constraints can include the 'ignorecase' and 'extended syntax' regular +# expression modifiers: +# +# controller 'geocode' do +# get 'geocode/:postalcode', to: :show, constraints: { +# postalcode: /hx\d\d\s\d[a-z]{2}/i +# } +# end +# +# controller 'geocode' do +# get 'geocode/:postalcode', to: :show, constraints: { +# postalcode: /# Postalcode format +# \d{5} #Prefix +# (-\d{4})? #Suffix +# /x +# } +# end +# +# Using the multiline modifier will raise an `ArgumentError`. Encoding regular +# expression modifiers are silently ignored. The match will always use the +# default encoding or ASCII. +# +# ## External redirects +# +# You can redirect any path to another path using the redirect helper in your +# router: +# +# get "/stories", to: redirect("/posts") +# +# ## Unicode character routes +# +# You can specify unicode character routes in your router: +# +# get "こんにちは", to: "welcome#index" +# +# ## Routing to Rack Applications +# +# Instead of a String, like `posts#index`, which corresponds to the index action +# in the PostsController, you can specify any Rack application as the endpoint +# for a matcher: +# +# get "/application.js", to: Sprockets +# +# ## Reloading routes +# +# You can reload routes if you feel you must: +# +# Rails.application.reload_routes! +# +# This will clear all named routes and reload config/routes.rb if the file has +# been modified from last load. To absolutely force reloading, use `reload!`. +# +# ## Testing Routes +# +# The two main methods for testing your routes: +# +# ### `assert_routing` +# +# def test_movie_route_properly_splits +# opts = {controller: "plugin", action: "checkout", id: "2"} +# assert_routing "plugin/checkout/2", opts +# end +# +# `assert_routing` lets you test whether or not the route properly resolves into +# options. +# +# ### `assert_recognizes` +# +# def test_route_has_options +# opts = {controller: "plugin", action: "show", id: "12"} +# assert_recognizes opts, "/plugins/show/12" +# end +# +# Note the subtle difference between the two: `assert_routing` tests that a URL +# fits options while `assert_recognizes` tests that a URL breaks into parameters +# properly. +# +# In tests you can simply pass the URL or named route to `get` or `post`. +# +# def send_to_jail +# get '/jail' +# assert_response :success +# end +# +# def goes_to_login +# get login_url +# #... +# end +# +# ## View a list of all your routes +# +# $ bin/rails routes +# +# Target a specific controller with `-c`, or grep routes using `-g`. Useful in +# conjunction with `--expanded` which displays routes vertically. +# +# source://actionpack//lib/action_dispatch/routing.rb#248 +module ActionDispatch::Routing + extend ::ActiveSupport::Autoload +end + +# source://actionpack//lib/action_dispatch/routing/inspector.rb#158 +module ActionDispatch::Routing::ConsoleFormatter; end + +# source://actionpack//lib/action_dispatch/routing/inspector.rb#159 +class ActionDispatch::Routing::ConsoleFormatter::Base + # @return [Base] a new instance of Base + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#160 + def initialize; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#177 + def footer(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#174 + def header(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#180 + def no_routes(engine, routes, filter); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#164 + def result; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#171 + def section(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#168 + def section_title(title); end +end + +# source://actionpack//lib/action_dispatch/routing/inspector.rb#244 +class ActionDispatch::Routing::ConsoleFormatter::Expanded < ::ActionDispatch::Routing::ConsoleFormatter::Base + # @return [Expanded] a new instance of Expanded + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#245 + def initialize(width: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#258 + def footer(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#254 + def section(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#250 + def section_title(title); end + + private + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#263 + def draw_expanded_section(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#278 + def route_header(index:); end +end + +# source://actionpack//lib/action_dispatch/routing/inspector.rb#204 +class ActionDispatch::Routing::ConsoleFormatter::Sheet < ::ActionDispatch::Routing::ConsoleFormatter::Base + # source://actionpack//lib/action_dispatch/routing/inspector.rb#217 + def footer(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#213 + def header(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#209 + def section(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#205 + def section_title(title); end + + private + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#231 + def draw_header(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#222 + def draw_section(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#237 + def widths(routes); end +end + +# source://actionpack//lib/action_dispatch/routing/inspector.rb#283 +class ActionDispatch::Routing::ConsoleFormatter::Unused < ::ActionDispatch::Routing::ConsoleFormatter::Sheet + # source://actionpack//lib/action_dispatch/routing/inspector.rb#284 + def header(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#292 + def no_routes(engine, routes, filter); end +end + +# source://actionpack//lib/action_dispatch/routing/endpoint.rb#7 +class ActionDispatch::Routing::Endpoint + # source://actionpack//lib/action_dispatch/routing/endpoint.rb#11 + def app; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/endpoint.rb#8 + def dispatcher?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/endpoint.rb#14 + def engine?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/endpoint.rb#10 + def matches?(req); end + + # source://actionpack//lib/action_dispatch/routing/endpoint.rb#12 + def rack_app; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/endpoint.rb#9 + def redirect?; end +end + +# source://actionpack//lib/action_dispatch/routing.rb#260 +ActionDispatch::Routing::HTTP_METHODS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/inspector.rb#305 +class ActionDispatch::Routing::HtmlTableFormatter + # @return [HtmlTableFormatter] a new instance of HtmlTableFormatter + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#306 + def initialize(view); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#323 + def footer(routes); end + + # The header is part of the HTML page, so we don't construct it here. + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#320 + def header(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#326 + def no_routes(*_arg0); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#339 + def result; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#315 + def section(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#311 + def section_title(title); end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#14 +class ActionDispatch::Routing::Mapper + include ::ActionDispatch::Routing::Mapper::Base + include ::ActionDispatch::Routing::Mapper::HttpHelpers + include ::ActionDispatch::Routing::Redirection + include ::ActionDispatch::Routing::Mapper::Scoping + include ::ActionDispatch::Routing::Mapper::Concerns + include ::ActionDispatch::Routing::Mapper::Resources + include ::ActionDispatch::Routing::Mapper::CustomUrls + + # @return [Mapper] a new instance of Mapper + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2530 + def initialize(set); end + + class << self + # source://actionpack//lib/action_dispatch/routing/mapper.rb#27 + def backtrace_cleaner; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#27 + def backtrace_cleaner=(val); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#407 + def normalize_name(name); end + + # Invokes Journey::Router::Utils.normalize_path, then ensures that /(:locale) + # becomes (/:locale). Except for root cases, where the former is the correct + # one. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#392 + def normalize_path(path); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#26 + def route_source_locations; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#26 + def route_source_locations=(val); end + end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#15 +class ActionDispatch::Routing::Mapper::BacktraceCleaner < ::ActiveSupport::BacktraceCleaner + # @return [BacktraceCleaner] a new instance of BacktraceCleaner + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#16 + def initialize; end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#411 +module ActionDispatch::Routing::Mapper::Base + # source://actionpack//lib/action_dispatch/routing/mapper.rb#653 + def default_url_options(options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#650 + def default_url_options=(options); end + + # Query if the following named route was already defined. + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#662 + def has_named_route?(name); end + + # Matches a URL pattern to one or more routes. + # + # You should not use the `match` method in your router without specifying an + # HTTP method. + # + # If you want to expose your action to both GET and POST, use: + # + # # sets :controller, :action, and :id in params + # match ':controller/:action/:id', via: [:get, :post] + # + # Note that `:controller`, `:action`, and `:id` are interpreted as URL query + # parameters and thus available through `params` in an action. + # + # If you want to expose your action to GET, use `get` in the router: + # + # Instead of: + # + # match ":controller/:action/:id" + # + # Do: + # + # get ":controller/:action/:id" + # + # Two of these symbols are special, `:controller` maps to the controller and + # `:action` to the controller's action. A pattern can also map wildcard segments + # (globs) to params: + # + # get 'songs/*category/:title', to: 'songs#show' + # + # # 'songs/rock/classic/stairway-to-heaven' sets + # # params[:category] = 'rock/classic' + # # params[:title] = 'stairway-to-heaven' + # + # To match a wildcard parameter, it must have a name assigned to it. Without a + # variable name to attach the glob parameter to, the route can't be parsed. + # + # When a pattern points to an internal route, the route's `:action` and + # `:controller` should be set in options or hash shorthand. Examples: + # + # match 'photos/:id', to: 'photos#show', via: :get + # match 'photos/:id', controller: 'photos', action: 'show', via: :get + # + # A pattern can also point to a `Rack` endpoint i.e. anything that responds to + # `call`: + # + # match 'photos/:id', to: -> (hash) { [200, {}, ["Coming soon"]] }, via: :get + # match 'photos/:id', to: PhotoRackApp, via: :get + # # Yes, controller actions are just rack endpoints + # match 'photos/:id', to: PhotosController.action(:show), via: :get + # + # Because requesting various HTTP verbs with a single action has security + # implications, you must either specify the actions in the via options or use + # one of the [HttpHelpers](rdoc-ref:HttpHelpers) instead `match` + # + # ### Options + # + # Any options not seen here are passed on as params with the URL. + # + # :controller + # + # :action + # + # :param + # segment used to generate the routes). You can access that segment from + # your controller using `params[<:param>]`. In your router: + # + # resources :users, param: :name + # + # The `users` resource here will have the following routes generated for it: + # + # GET /users(.:format) + # POST /users(.:format) + # GET /users/new(.:format) + # GET /users/:name/edit(.:format) + # GET /users/:name(.:format) + # PATCH/PUT /users/:name(.:format) + # DELETE /users/:name(.:format) + # + # You can override `ActiveRecord::Base#to_param` of a related model to + # construct a URL: + # + # class User < ActiveRecord::Base + # def to_param + # name + # end + # end + # + # user = User.find_by(name: 'Phusion') + # user_path(user) # => "/users/Phusion" + # + # :path + # + # :module + # + # match 'path', to: 'c#a', module: 'sekret', controller: 'posts', via: :get + # # => Sekret::PostsController + # + # See `Scoping#namespace` for its scope equivalent. + # + # :as + # + # :via + # + # match 'path', to: 'c#a', via: :get + # match 'path', to: 'c#a', via: [:get, :post] + # match 'path', to: 'c#a', via: :all + # + # :to + # string representing a controller's action. + # + # match 'path', to: 'controller#action', via: :get + # match 'path', to: -> (env) { [200, {}, ["Success!"]] }, via: :get + # match 'path', to: RackApp, via: :get + # + # :on + # are `:member`, `:collection`, and `:new`. Only use within `resource(s)` + # block. For example: + # + # resource :bar do + # match 'foo', to: 'c#a', on: :member, via: [:get, :post] + # end + # + # Is equivalent to: + # + # resource :bar do + # member do + # match 'foo', to: 'c#a', via: [:get, :post] + # end + # end + # + # :constraints + # responds to `matches?`. In addition, constraints other than path can also + # be specified with any object that responds to `===` (e.g. String, Array, + # Range, etc.). + # + # match 'path/:id', constraints: { id: /[A-Z]\d{5}/ }, via: :get + # + # match 'json_only', constraints: { format: 'json' }, via: :get + # + # class PermitList + # def matches?(request) request.remote_ip == '1.2.3.4' end + # end + # match 'path', to: 'c#a', constraints: PermitList.new, via: :get + # + # See `Scoping#constraints` for more examples with its scope equivalent. + # + # :defaults + # + # # Sets params[:format] to 'jpg' by default + # match 'path', to: 'c#a', defaults: { format: 'jpg' }, via: :get + # + # See `Scoping#defaults` for its scope equivalent. + # + # :anchor + # the pattern matches any request prefixed with the given path. + # + # # Matches any request starting with 'path' + # match 'path', to: 'c#a', anchor: false, via: :get + # + # :format + # disable it by supplying `false`. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#587 + def match(path, options = T.unsafe(nil)); end + + # Mount a Rack-based application to be used within the application. + # + # mount SomeRackApp, at: "some_route" + # + # For options, see `match`, as `mount` uses it internally. + # + # All mounted applications come with routing helpers to access them. These are + # named after the class specified, so for the above example the helper is either + # `some_rack_app_path` or `some_rack_app_url`. To customize this helper's name, + # use the `:as` option: + # + # mount(SomeRackApp, at: "some_route", as: "exciting") + # + # This will generate the `exciting_path` and `exciting_url` helpers which can be + # used to navigate to this mounted app. + # + # @raise [ArgumentError] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#605 + def mount(app = T.unsafe(nil), deprecated_options = T.unsafe(nil), as: T.unsafe(nil), via: T.unsafe(nil), at: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#655 + def with_default_scope(scope, &block); end + + private + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#689 + def app_name(app, rails_app); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#667 + def assign_deprecated_option(deprecated_options, key, method_name); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#676 + def assign_deprecated_options(deprecated_options, options, method_name); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#698 + def define_generate_prefix(app, name); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#685 + def rails_app?(app); end +end + +# Routing Concerns allow you to declare common routes that can be reused inside +# others resources and routes. +# +# concern :commentable do +# resources :comments +# end +# +# concern :image_attachable do +# resources :images, only: :index +# end +# +# These concerns are used in Resources routing: +# +# resources :messages, concerns: [:commentable, :image_attachable] +# +# or in a scope or namespace: +# +# namespace :posts do +# concerns :commentable +# end +# +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2242 +module ActionDispatch::Routing::Mapper::Concerns + # Define a routing concern using a name. + # + # Concerns may be defined inline, using a block, or handled by another object, + # by passing that object as the second parameter. + # + # The concern object, if supplied, should respond to `call`, which will receive + # two parameters: + # + # * The current mapper + # * A hash of options which the concern object may use + # + # Options may also be used by concerns defined in a block by accepting a block + # parameter. So, using a block, you might do something as simple as limit the + # actions available on certain resources, passing standard resource options + # through the concern: + # + # concern :commentable do |options| + # resources :comments, options + # end + # + # resources :posts, concerns: :commentable + # resources :archived_posts do + # # Don't allow comments on archived posts + # concerns :commentable, only: [:index, :show] + # end + # + # Or, using a callable object, you might implement something more specific to + # your application, which would be out of place in your routes file. + # + # # purchasable.rb + # class Purchasable + # def initialize(defaults = {}) + # @defaults = defaults + # end + # + # def call(mapper, options = {}) + # options = @defaults.merge(options) + # mapper.resources :purchases + # mapper.resources :receipts + # mapper.resources :returns if options[:returnable] + # end + # end + # + # # routes.rb + # concern :purchasable, Purchasable.new(returnable: true) + # + # resources :toys, concerns: :purchasable + # resources :electronics, concerns: :purchasable + # resources :pets do + # concerns :purchasable, returnable: false + # end + # + # Any routing helpers can be used inside a concern. If using a callable, they're + # accessible from the Mapper that's passed to `call`. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2297 + def concern(name, callable = T.unsafe(nil), &block); end + + # Use the named concerns + # + # resources :posts do + # concerns :commentable + # end + # + # Concerns also work in any routes helper that you want to use: + # + # namespace :posts do + # concerns :commentable + # end + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2313 + def concerns(*args, **options); end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#29 +class ActionDispatch::Routing::Mapper::Constraints < ::ActionDispatch::Routing::Endpoint + # @return [Constraints] a new instance of Constraints + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#35 + def initialize(app, constraints, strategy); end + + # Returns the value of attribute app. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#30 + def app; end + + # Returns the value of attribute constraints. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#30 + def constraints; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#50 + def dispatcher?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#52 + def matches?(req); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#59 + def serve(req); end + + private + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#66 + def constraint_args(constraint, request); end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#33 +ActionDispatch::Routing::Mapper::Constraints::CALL = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#32 +ActionDispatch::Routing::Mapper::Constraints::SERVE = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2324 +module ActionDispatch::Routing::Mapper::CustomUrls + # Define custom URL helpers that will be added to the application's routes. This + # allows you to override and/or replace the default behavior of routing helpers, + # e.g: + # + # direct :homepage do + # "https://rubyonrails.org" + # end + # + # direct :commentable do |model| + # [ model, anchor: model.dom_id ] + # end + # + # direct :main do + # { controller: "pages", action: "index", subdomain: "www" } + # end + # + # The return value from the block passed to `direct` must be a valid set of + # arguments for `url_for` which will actually build the URL string. This can be + # one of the following: + # + # * A string, which is treated as a generated URL + # * A hash, e.g. `{ controller: "pages", action: "index" }` + # * An array, which is passed to `polymorphic_url` + # * An Active Model instance + # * An Active Model class + # + # + # NOTE: Other URL helpers can be called in the block but be careful not to + # invoke your custom URL helper again otherwise it will result in a stack + # overflow error. + # + # You can also specify default options that will be passed through to your URL + # helper definition, e.g: + # + # direct :browse, page: 1, size: 10 do |options| + # [ :products, options.merge(params.permit(:page, :size).to_h.symbolize_keys) ] + # end + # + # In this instance the `params` object comes from the context in which the block + # is executed, e.g. generating a URL inside a controller action or a view. If + # the block is executed where there isn't a `params` object such as this: + # + # Rails.application.routes.url_helpers.browse_path + # + # then it will raise a `NameError`. Because of this you need to be aware of the + # context in which you will use your custom URL helper when defining it. + # + # NOTE: The `direct` method can't be used inside of a scope block such as + # `namespace` or `scope` and will raise an error if it detects that it is. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2374 + def direct(name, options = T.unsafe(nil), &block); end + + # Define custom polymorphic mappings of models to URLs. This alters the behavior + # of `polymorphic_url` and consequently the behavior of `link_to`, `form_with` + # and `form_for` when passed a model instance, e.g: + # + # resource :basket + # + # resolve "Basket" do + # [:basket] + # end + # + # This will now generate "/basket" when a `Basket` instance is passed to + # `link_to`, `form_with` or `form_for` instead of the standard "/baskets/:id". + # + # NOTE: This custom behavior only applies to simple polymorphic URLs where a + # single model instance is passed and not more complicated forms, e.g: + # + # # config/routes.rb + # resource :profile + # namespace :admin do + # resources :users + # end + # + # resolve("User") { [:profile] } + # + # # app/views/application/_menu.html.erb + # link_to "Profile", @current_user + # link_to "Profile", [:admin, @current_user] + # + # The first `link_to` will generate "/profile" but the second will generate the + # standard polymorphic URL of "/admin/users/1". + # + # You can pass options to a polymorphic mapping - the arity for the block needs + # to be two as the instance is passed as the first argument, e.g: + # + # resolve "Basket", anchor: "items" do |basket, options| + # [:basket, options] + # end + # + # This generates the URL "/basket#items" because when the last item in an array + # passed to `polymorphic_url` is a hash then it's treated as options to the URL + # helper that gets called. + # + # NOTE: The `resolve` method can't be used inside of a scope block such as + # `namespace` or `scope` and will raise an error if it detects that it is. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2426 + def resolve(*args, &block); end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2528 +ActionDispatch::Routing::Mapper::DEFAULT = T.let(T.unsafe(nil), Object) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#733 +module ActionDispatch::Routing::Mapper::HttpHelpers + # Define a route that recognizes HTTP CONNECT (and GET) requests. More + # specifically this recognizes HTTP/1 protocol upgrade requests and HTTP/2 + # CONNECT requests with the protocol pseudo header. For supported arguments, + # see [match](rdoc-ref:Base#match) + # + # connect 'live', to: 'live#index' + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#884 + def connect(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP DELETE. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # delete 'broccoli', to: 'food#broccoli' + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#834 + def delete(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP GET. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # get 'bacon', to: 'food#bacon' + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#738 + def get(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP OPTIONS. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # options 'carrots', to: 'food#carrots' + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#858 + def options(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP PATCH. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # patch 'bacon', to: 'food#bacon' + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#786 + def patch(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP POST. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # post 'bacon', to: 'food#bacon' + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#762 + def post(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # Define a route that only recognizes HTTP PUT. For supported arguments, see + # [match](rdoc-ref:Base#match) + # + # put 'bacon', to: 'food#bacon' + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#810 + def put(*path_or_actions, as: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#83 +class ActionDispatch::Routing::Mapper::Mapping + # @return [Mapping] a new instance of Mapping + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#132 + def initialize(set:, ast:, controller:, default_action:, to:, formatted:, via:, options_constraints:, anchor:, scope_params:, internal:, options:); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#190 + def application; end + + # Returns the value of attribute ast. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def ast; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#194 + def conditions; end + + # Returns the value of attribute default_action. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def default_action; end + + # Returns the value of attribute default_controller. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def default_controller; end + + # Returns the value of attribute defaults. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def defaults; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#183 + def make_route(name, precedence); end + + # Returns the value of attribute path. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def path; end + + # Returns the value of attribute required_defaults. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def required_defaults; end + + # Returns the value of attribute requirements. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def requirements; end + + # Returns the value of attribute scope_options. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def scope_options; end + + # Returns the value of attribute to. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#87 + def to; end + + private + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#329 + def add_controller_module(controller, modyoule); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#290 + def app(blocks); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#348 + def blocks(callable_constraint); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#198 + def build_conditions(current_conditions, request_class); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#302 + def check_controller_and_action(path_params, controller, action); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#317 + def check_part(name, part, path_params, hash); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#355 + def constraints(options, path_params); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#369 + def dispatcher(raise_on_name_error); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#208 + def intern(object); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#286 + def normalize_defaults(options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#254 + def normalize_format(formatted); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#212 + def normalize_options!(options, path_params, modyoule); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#373 + def route_source_location; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#248 + def split_constraints(path_params, constraints); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#341 + def translate_controller(controller); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#270 + def verify_regexp_requirements(requirements, wildcard_options); end + + class << self + # source://actionpack//lib/action_dispatch/routing/mapper.rb#90 + def build(scope, set, ast, controller, default_action, to, via, formatted, options_constraints, anchor, internal, options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#104 + def check_via(via); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#116 + def normalize_path(path, format); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#128 + def optional_format?(path, format); end + end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#84 +ActionDispatch::Routing::Mapper::Mapping::ANCHOR_CHARACTERS_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#181 +ActionDispatch::Routing::Mapper::Mapping::JOINED_SEPARATORS = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#85 +ActionDispatch::Routing::Mapper::Mapping::OPTIONAL_FORMAT_REGEX = T.let(T.unsafe(nil), Regexp) + +# Resource routing allows you to quickly declare all of the common routes for a +# given resourceful controller. Instead of declaring separate routes for your +# `index`, `show`, `new`, `edit`, `create`, `update`, and `destroy` actions, a +# resourceful route declares them in a single line of code: +# +# resources :photos +# +# Sometimes, you have a resource that clients always look up without referencing +# an ID. A common example, /profile always shows the profile of the currently +# logged in user. In this case, you can use a singular resource to map /profile +# (rather than /profile/:id) to the show action. +# +# resource :profile +# +# It's common to have resources that are logically children of other resources: +# +# resources :magazines do +# resources :ads +# end +# +# You may wish to organize groups of controllers under a namespace. Most +# commonly, you might group a number of administrative controllers under an +# `admin` namespace. You would place these controllers under the +# `app/controllers/admin` directory, and you can group them together in your +# router: +# +# namespace "admin" do +# resources :posts, :comments +# end +# +# By default the `:id` parameter doesn't accept dots. If you need to use dots as +# part of the `:id` parameter add a constraint which overrides this restriction, +# e.g: +# +# resources :articles, id: /[^\/]+/ +# +# This allows any character other than a slash as part of your `:id`. +# +# source://actionpack//lib/action_dispatch/routing/mapper.rb#1299 +module ActionDispatch::Routing::Mapper::Resources + # To add a route to the collection: + # + # resources :photos do + # collection do + # get 'search' + # end + # end + # + # This will enable Rails to recognize paths such as `/photos/search` with GET, + # and route to the search action of `PhotosController`. It will also create the + # `search_photos_url` and `search_photos_path` route helpers. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1707 + def collection(&block); end + + # Loads another routes file with the given `name` located inside the + # `config/routes` directory. In that file, you can use the normal routing DSL, + # but *do not* surround it with a `Rails.application.routes.draw` block. + # + # # config/routes.rb + # Rails.application.routes.draw do + # draw :admin # Loads `config/routes/admin.rb` + # draw "third_party/some_gem" # Loads `config/routes/third_party/some_gem.rb` + # end + # + # # config/routes/admin.rb + # namespace :admin do + # resources :accounts + # end + # + # # config/routes/third_party/some_gem.rb + # mount SomeGem::Engine, at: "/some_gem" + # + # **CAUTION:** Use this feature with care. Having multiple routes files can + # negatively impact discoverability and readability. For most applications — + # even those with a few hundred routes — it's easier for developers to have a + # single routes file. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1816 + def draw(name); end + + # Matches a URL pattern to one or more routes. For more information, see + # [match](rdoc-ref:Base#match). + # + # match 'path', to: 'controller#action', via: :post + # match 'otherpath', on: :member, via: :get + # + # @raise [ArgumentError] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1837 + def match(*path_or_actions, as: T.unsafe(nil), via: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), defaults: T.unsafe(nil), constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), internal: T.unsafe(nil), **mapping, &block); end + + # To add a member route, add a member block into the resource block: + # + # resources :photos do + # member do + # get 'preview' + # end + # end + # + # This will recognize `/photos/1/preview` with GET, and route to the preview + # action of `PhotosController`. It will also create the `preview_photo_url` and + # `preview_photo_path` helpers. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1728 + def member(&block); end + + # See ActionDispatch::Routing::Mapper::Scoping#namespace. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1775 + def namespace(name, deprecated_options = T.unsafe(nil), as: T.unsafe(nil), path: T.unsafe(nil), shallow_path: T.unsafe(nil), shallow_prefix: T.unsafe(nil), **options, &block); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1754 + def nested(&block); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1744 + def new(&block); end + + # Sometimes, you have a resource that clients always look up without referencing + # an ID. A common example, /profile always shows the profile of the currently + # logged in user. In this case, you can use a singular resource to map /profile + # (rather than /profile/:id) to the show action: + # + # resource :profile + # + # This creates six different routes in your application, all mapping to the + # `Profiles` controller (note that the controller is named after the plural): + # + # GET /profile/new + # GET /profile + # GET /profile/edit + # PATCH/PUT /profile + # DELETE /profile + # POST /profile + # + # If you want instances of a model to work with this resource via record + # identification (e.g. in `form_with` or `redirect_to`), you will need to call + # [resolve](rdoc-ref:CustomUrls#resolve): + # + # resource :profile + # resolve('Profile') { [:profile] } + # + # # Enables this to work with singular routes: + # form_with(model: @profile) {} + # + # ### Options + # Takes same options as [resources](rdoc-ref:#resources) + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1490 + def resource(*resources, concerns: T.unsafe(nil), **options, &block); end + + # In Rails, a resourceful route provides a mapping between HTTP verbs and URLs + # and controller actions. By convention, each action also maps to particular + # CRUD operations in a database. A single entry in the routing file, such as + # + # resources :photos + # + # creates seven different routes in your application, all mapping to the + # `Photos` controller: + # + # GET /photos + # GET /photos/new + # POST /photos + # GET /photos/:id + # GET /photos/:id/edit + # PATCH/PUT /photos/:id + # DELETE /photos/:id + # + # Resources can also be nested infinitely by using this block syntax: + # + # resources :photos do + # resources :comments + # end + # + # This generates the following comments routes: + # + # GET /photos/:photo_id/comments + # GET /photos/:photo_id/comments/new + # POST /photos/:photo_id/comments + # GET /photos/:photo_id/comments/:id + # GET /photos/:photo_id/comments/:id/edit + # PATCH/PUT /photos/:photo_id/comments/:id + # DELETE /photos/:photo_id/comments/:id + # + # ### Options + # Takes same options as [match](rdoc-ref:Base#match) as well as: + # + # :path_names + # actions. Actions not specified are not changed. + # + # resources :posts, path_names: { new: "brand_new" } + # + # The above example will now change /posts/new to /posts/brand_new. + # + # :path + # + # resources :posts, path: 'postings' + # + # The resource and all segments will now route to /postings instead of + # /posts. + # + # :only + # + # resources :cows, only: :show + # resources :cows, only: [:show, :index] + # + # :except + # + # resources :cows, except: :show + # resources :cows, except: [:show, :index] + # + # :shallow + # resource, generates shallow routes for all nested resources. + # + # resources :posts, shallow: true do + # resources :comments + # end + # + # Is the same as: + # + # resources :posts do + # resources :comments, except: [:show, :edit, :update, :destroy] + # end + # resources :comments, only: [:show, :edit, :update, :destroy] + # + # This allows URLs for resources that otherwise would be deeply nested such + # as a comment on a blog post like `/posts/a-long-permalink/comments/1234` + # to be shortened to just `/comments/1234`. + # + # Set `shallow: false` on a child resource to ignore a parent's shallow + # parameter. + # + # :shallow_path + # + # scope shallow_path: "sekret" do + # resources :posts do + # resources :comments, shallow: true + # end + # end + # + # The `comments` resource here will have the following routes generated for + # it: + # + # post_comments GET /posts/:post_id/comments(.:format) + # post_comments POST /posts/:post_id/comments(.:format) + # new_post_comment GET /posts/:post_id/comments/new(.:format) + # edit_comment GET /sekret/comments/:id/edit(.:format) + # comment GET /sekret/comments/:id(.:format) + # comment PATCH/PUT /sekret/comments/:id(.:format) + # comment DELETE /sekret/comments/:id(.:format) + # + # :shallow_prefix + # + # scope shallow_prefix: "sekret" do + # resources :posts do + # resources :comments, shallow: true + # end + # end + # + # The `comments` resource here will have the following routes generated for + # it: + # + # post_comments GET /posts/:post_id/comments(.:format) + # post_comments POST /posts/:post_id/comments(.:format) + # new_post_comment GET /posts/:post_id/comments/new(.:format) + # edit_sekret_comment GET /comments/:id/edit(.:format) + # sekret_comment GET /comments/:id(.:format) + # sekret_comment PATCH/PUT /comments/:id(.:format) + # sekret_comment DELETE /comments/:id(.:format) + # + # :format + # disable it by supplying `false`. + # + # :param + # + # + # ### Examples + # + # # routes call Admin::PostsController + # resources :posts, module: "admin" + # + # # resource actions are at /admin/posts. + # resources :posts, path: "admin/posts" + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1663 + def resources(*resources, concerns: T.unsafe(nil), **options, &block); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1457 + def resources_path_names(options); end + + # You can specify what Rails should route "/" to with the root method: + # + # root to: 'pages#main' + # + # For options, see `match`, as `root` uses it internally. + # + # You can also pass a string which will expand + # + # root 'pages#main' + # + # You should put the root route at the top of `config/routes.rb`, because this + # means it will be matched first. As this is the most popular route of most + # Rails applications, this is beneficial. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1903 + def root(path, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1783 + def shallow; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1790 + def shallow?; end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1968 + def action_options?(options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2066 + def action_path(name); end + + # @raise [ArgumentError] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2195 + def add_route(action, controller, as, options_action, _path, to, via, formatted, anchor, options_constraints, internal, options_mapping); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2120 + def api_only?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1982 + def applicable_actions_for(method); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1963 + def apply_action_options(method, options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1928 + def apply_common_behavior_for(method, resources, shallow: T.unsafe(nil), **options, &block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2041 + def canonical_action?(action); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2180 + def decomposed_match(path, controller, as, action, _path, to, via, formatted, anchor, options_constraints, internal, options_mapping, on = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2165 + def get_to_from_path(path, to, action); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2131 + def map_match(path_or_action, constraints: T.unsafe(nil), anchor: T.unsafe(nil), format: T.unsafe(nil), path: T.unsafe(nil), as: T.unsafe(nil), via: T.unsafe(nil), to: T.unsafe(nil), controller: T.unsafe(nil), action: T.unsafe(nil), on: T.unsafe(nil), internal: T.unsafe(nil), mapping: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2217 + def match_root_route(options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2082 + def name_for_action(as, action); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2018 + def nested_options; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1999 + def nested_scope?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2037 + def param_constraint; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2033 + def param_constraint?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1924 + def parent_resource; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2056 + def path_for_action(action, path); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2124 + def path_scope(path); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2070 + def prefix_name_for_action(as, action); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1995 + def resource_method_scope?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2010 + def resource_scope(resource, &block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1991 + def resource_scope?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1972 + def scope_action_options(method); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2108 + def set_member_mappings_for_resource; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2027 + def shallow_nesting_depth; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2045 + def shallow_scope; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2176 + def using_match_shorthand?(path); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2003 + def with_scope_level(kind); end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#1304 +ActionDispatch::Routing::Mapper::Resources::CANONICAL_ACTIONS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#1303 +ActionDispatch::Routing::Mapper::Resources::RESOURCE_OPTIONS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#1306 +class ActionDispatch::Routing::Mapper::Resources::Resource + # @return [Resource] a new instance of Resource + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1319 + def initialize(entities, api_only, shallow, only: T.unsafe(nil), except: T.unsafe(nil), **options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1346 + def actions; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1354 + def available_actions; end + + # Checks for uncountable plurals, and appends "_index" if the plural and + # singular form are the same. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1378 + def collection_name; end + + # Returns the value of attribute path. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1386 + def collection_scope; end + + # Returns the value of attribute controller. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1317 + def controller; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1342 + def default_actions; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1374 + def member_name; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1388 + def member_scope; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1362 + def name; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1398 + def nested_param; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1402 + def nested_scope; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1394 + def new_scope(new_path); end + + # Returns the value of attribute param. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1317 + def param; end + + # Returns the value of attribute path. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1317 + def path; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1366 + def plural; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1382 + def resource_scope; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1406 + def shallow?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1392 + def shallow_scope; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1410 + def singleton?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1370 + def singular; end + + private + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1413 + def invalid_only_except_options(valid_actions, only:, except:); end + + class << self + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1308 + def default_actions(api_only); end + end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#1418 +class ActionDispatch::Routing::Mapper::Resources::SingletonResource < ::ActionDispatch::Routing::Mapper::Resources::Resource + # @return [SingletonResource] a new instance of SingletonResource + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1429 + def initialize(entities, api_only, shallow, **options); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1449 + def collection_name; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1436 + def default_actions; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1448 + def member_name; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1451 + def member_scope; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1452 + def nested_scope; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1440 + def plural; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1454 + def singleton?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1444 + def singular; end + + class << self + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1420 + def default_actions(api_only); end + end +end + +# CANONICAL_ACTIONS holds all actions that does not need a prefix or a path +# appended since they fit properly in their scope level. +# +# source://actionpack//lib/action_dispatch/routing/mapper.rb#1302 +ActionDispatch::Routing::Mapper::Resources::VALID_ON_OPTIONS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2440 +class ActionDispatch::Routing::Mapper::Scope + include ::Enumerable + + # @return [Scope] a new instance of Scope + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2450 + def initialize(hash, parent = T.unsafe(nil), scope_level = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2509 + def [](key); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2476 + def action_name(name_prefix, prefix, collection_name, member_name); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2517 + def each; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2513 + def frame; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2456 + def nested?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2501 + def new(hash); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2505 + def new_level(level); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2460 + def null?; end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2497 + def options; end + + # Returns the value of attribute parent. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2448 + def parent; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2472 + def resource_method_scope?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2493 + def resource_scope?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2468 + def resources?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2464 + def root?; end + + # Returns the value of attribute scope_level. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#2448 + def scope_level; end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2441 +ActionDispatch::Routing::Mapper::Scope::OPTIONS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2446 +ActionDispatch::Routing::Mapper::Scope::RESOURCE_METHOD_SCOPES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2445 +ActionDispatch::Routing::Mapper::Scope::RESOURCE_SCOPES = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#2525 +ActionDispatch::Routing::Mapper::Scope::ROOT = T.let(T.unsafe(nil), ActionDispatch::Routing::Mapper::Scope) + +# You may wish to organize groups of controllers under a namespace. Most +# commonly, you might group a number of administrative controllers under an +# `admin` namespace. You would place these controllers under the +# `app/controllers/admin` directory, and you can group them together in your +# router: +# +# namespace "admin" do +# resources :posts, :comments +# end +# +# This will create a number of routes for each of the posts and comments +# controller. For `Admin::PostsController`, Rails will create: +# +# GET /admin/posts +# GET /admin/posts/new +# POST /admin/posts +# GET /admin/posts/1 +# GET /admin/posts/1/edit +# PATCH/PUT /admin/posts/1 +# DELETE /admin/posts/1 +# +# If you want to route /posts (without the prefix /admin) to +# `Admin::PostsController`, you could use +# +# scope module: "admin" do +# resources :posts +# end +# +# or, for a single case +# +# resources :posts, module: "admin" +# +# If you want to route /admin/posts to `PostsController` (without the `Admin::` +# module prefix), you could use +# +# scope "/admin" do +# resources :posts +# end +# +# or, for a single case +# +# resources :posts, path: "/admin/posts" +# +# In each of these cases, the named routes remain the same as if you did not use +# scope. In the last case, the following paths map to `PostsController`: +# +# GET /admin/posts +# GET /admin/posts/new +# POST /admin/posts +# GET /admin/posts/1 +# GET /admin/posts/1/edit +# PATCH/PUT /admin/posts/1 +# DELETE /admin/posts/1 +# +# source://actionpack//lib/action_dispatch/routing/mapper.rb#958 +module ActionDispatch::Routing::Mapper::Scoping + # ### Parameter Restriction + # Allows you to constrain the nested routes based on a set of rules. For + # instance, in order to change the routes to allow for a dot character in the + # `id` parameter: + # + # constraints(id: /\d+\.\d+/) do + # resources :posts + # end + # + # Now routes such as `/posts/1` will no longer be valid, but `/posts/1.1` will + # be. The `id` parameter must match the constraint passed in for this example. + # + # You may use this to also restrict other parameters: + # + # resources :posts do + # constraints(post_id: /\d+\.\d+/) do + # resources :comments + # end + # end + # + # ### Restricting based on IP + # + # Routes can also be constrained to an IP or a certain range of IP addresses: + # + # constraints(ip: /192\.168\.\d+\.\d+/) do + # resources :posts + # end + # + # Any user connecting from the 192.168.* range will be able to see this + # resource, where as any user connecting outside of this range will be told + # there is no such route. + # + # ### Dynamic request matching + # + # Requests to routes can be constrained based on specific criteria: + # + # constraints(-> (req) { /iPhone/.match?(req.env["HTTP_USER_AGENT"]) }) do + # resources :iphones + # end + # + # You are able to move this logic out into a class if it is too complex for + # routes. This class must have a `matches?` method defined on it which either + # returns `true` if the user should be given access to that route, or `false` if + # the user should not. + # + # class Iphone + # def self.matches?(request) + # /iPhone/.match?(request.env["HTTP_USER_AGENT"]) + # end + # end + # + # An expected place for this code would be `lib/constraints`. + # + # This class is then used like this: + # + # constraints(Iphone) do + # resources :iphones + # end + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1176 + def constraints(constraints = T.unsafe(nil), &block); end + + # Scopes routes to a specific controller + # + # controller "food" do + # match "bacon", action: :bacon, via: :get + # end + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1052 + def controller(controller); end + + # Allows you to set default parameters for a route, such as this: + # + # defaults id: 'home' do + # match 'scoped_pages/(:id)', to: 'pages#show' + # end + # + # Using this, the `:id` parameter here will default to 'home'. + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1187 + def defaults(defaults = T.unsafe(nil)); end + + # Scopes routes to a specific namespace. For example: + # + # namespace :admin do + # resources :posts + # end + # + # This generates the following routes: + # + # admin_posts GET /admin/posts(.:format) admin/posts#index + # admin_posts POST /admin/posts(.:format) admin/posts#create + # new_admin_post GET /admin/posts/new(.:format) admin/posts#new + # edit_admin_post GET /admin/posts/:id/edit(.:format) admin/posts#edit + # admin_post GET /admin/posts/:id(.:format) admin/posts#show + # admin_post PATCH/PUT /admin/posts/:id(.:format) admin/posts#update + # admin_post DELETE /admin/posts/:id(.:format) admin/posts#destroy + # + # ### Options + # + # The `:path`, `:as`, `:module`, `:shallow_path`, and `:shallow_prefix` options + # all default to the name of the namespace. + # + # For options, see `Base#match`. For `:shallow_path` option, see + # `Resources#resources`. + # + # # accessible through /sekret/posts rather than /admin/posts + # namespace :admin, path: "sekret" do + # resources :posts + # end + # + # # maps to Sekret::PostsController rather than Admin::PostsController + # namespace :admin, module: "sekret" do + # resources :posts + # end + # + # # generates sekret_posts_path rather than admin_posts_path + # namespace :admin, as: "sekret" do + # resources :posts + # end + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1097 + def namespace(name, deprecated_options = T.unsafe(nil), as: T.unsafe(nil), path: T.unsafe(nil), shallow_path: T.unsafe(nil), shallow_prefix: T.unsafe(nil), **options, &block); end + + # Scopes a set of routes to the given default options. + # + # Take the following route definition as an example: + # + # scope path: ":account_id", as: "account" do + # resources :projects + # end + # + # This generates helpers such as `account_projects_path`, just like `resources` + # does. The difference here being that the routes generated are like + # /:account_id/projects, rather than /accounts/:account_id/projects. + # + # ### Options + # + # Takes same options as `Base#match` and `Resources#resources`. + # + # # route /posts (without the prefix /admin) to Admin::PostsController + # scope module: "admin" do + # resources :posts + # end + # + # # prefix the posts resource's requests with '/admin' + # scope path: "/admin" do + # resources :posts + # end + # + # # prefix the routing helper name: sekret_posts_path instead of posts_path + # scope as: "sekret" do + # resources :posts + # end + # + # source://actionpack//lib/action_dispatch/routing/mapper.rb#989 + def scope(*args, only: T.unsafe(nil), except: T.unsafe(nil), **options); end + + private + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1219 + def merge_action_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1203 + def merge_as_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1243 + def merge_blocks_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1235 + def merge_constraints_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1215 + def merge_controller_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1239 + def merge_defaults_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1227 + def merge_format_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1211 + def merge_module_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1249 + def merge_options_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1231 + def merge_path_names_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1195 + def merge_path_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1199 + def merge_shallow_path_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1207 + def merge_shallow_prefix_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1253 + def merge_shallow_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1257 + def merge_to_scope(parent, child); end + + # source://actionpack//lib/action_dispatch/routing/mapper.rb#1223 + def merge_via_scope(parent, child); end +end + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#1045 +ActionDispatch::Routing::Mapper::Scoping::POISON = T.let(T.unsafe(nil), Object) + +# source://actionpack//lib/action_dispatch/routing/mapper.rb#24 +ActionDispatch::Routing::Mapper::URL_OPTIONS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/redirection.rb#116 +class ActionDispatch::Routing::OptionRedirect < ::ActionDispatch::Routing::Redirect + # source://actionpack//lib/action_dispatch/routing/redirection.rb#145 + def inspect; end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#117 + def options; end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#119 + def path(params, request); end +end + +# source://actionpack//lib/action_dispatch/routing/redirection.rb#91 +class ActionDispatch::Routing::PathRedirect < ::ActionDispatch::Routing::Redirect + # source://actionpack//lib/action_dispatch/routing/redirection.rb#106 + def inspect; end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#94 + def path(params, request); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/redirection.rb#111 + def interpolation_required?(string, params); end +end + +# source://actionpack//lib/action_dispatch/routing/redirection.rb#92 +ActionDispatch::Routing::PathRedirect::URL_PARTS = T.let(T.unsafe(nil), Regexp) + +# # Action Dispatch Routing PolymorphicRoutes +# +# Polymorphic URL helpers are methods for smart resolution to a named route call +# when given an Active Record model instance. They are to be used in combination +# with ActionController::Resources. +# +# These methods are useful when you want to generate the correct URL or path to +# a RESTful resource without having to know the exact type of the record in +# question. +# +# Nested resources and/or namespaces are also supported, as illustrated in the +# example: +# +# polymorphic_url([:admin, @article, @comment]) +# +# results in: +# +# admin_article_comment_url(@article, @comment) +# +# ## Usage within the framework +# +# Polymorphic URL helpers are used in a number of places throughout the Rails +# framework: +# +# * `url_for`, so you can use it with a record as the argument, e.g. +# `url_for(@article)`; +# * ActionView::Helpers::FormHelper uses `polymorphic_path`, so you can write +# `form_with(model: @article)` without having to specify `:url` parameter for the +# form action; +# * `redirect_to` (which, in fact, uses `url_for`) so you can write +# `redirect_to(post)` in your controllers; +# * ActionView::Helpers::AtomFeedHelper, so you don't have to explicitly +# specify URLs for feed entries. +# +# +# ## Prefixed polymorphic helpers +# +# In addition to `polymorphic_url` and `polymorphic_path` methods, a number of +# prefixed helpers are available as a shorthand to `action: "..."` in options. +# Those are: +# +# * `edit_polymorphic_url`, `edit_polymorphic_path` +# * `new_polymorphic_url`, `new_polymorphic_path` +# +# +# Example usage: +# +# edit_polymorphic_path(@post) # => "/posts/1/edit" +# polymorphic_path(@post, format: :pdf) # => "/posts/1.pdf" +# +# ## Usage with mounted engines +# +# If you are using a mounted engine and you need to use a polymorphic_url +# pointing at the engine's routes, pass in the engine's route proxy as the first +# argument to the method. For example: +# +# polymorphic_url([blog, @post]) # calls blog.post_path(@post) +# form_with(model: [blog, @post]) # => "/blog/posts/1" +# +# source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#66 +module ActionDispatch::Routing::PolymorphicRoutes + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#156 + def edit_polymorphic_path(record_or_hash, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#156 + def edit_polymorphic_url(record_or_hash, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#156 + def new_polymorphic_path(record_or_hash, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#156 + def new_polymorphic_url(record_or_hash, options = T.unsafe(nil)); end + + # Returns the path component of a URL for the given record. + # + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#133 + def polymorphic_path(record_or_hash_or_array, options = T.unsafe(nil)); end + + # Constructs a call to a named RESTful route for the given record and returns + # the resulting URL string. For example: + # + # # calls post_url(post) + # polymorphic_url(post) # => "http://example.com/posts/1" + # polymorphic_url([blog, post]) # => "http://example.com/blogs/1/posts/1" + # polymorphic_url([:admin, blog, post]) # => "http://example.com/admin/blogs/1/posts/1" + # polymorphic_url([user, :blog, post]) # => "http://example.com/users/1/blog/posts/1" + # polymorphic_url(Comment) # => "http://example.com/comments" + # + # #### Options + # + # * `:action` - Specifies the action prefix for the named route: `:new` or + # `:edit`. Default is no prefix. + # * `:routing_type` - Allowed values are `:path` or `:url`. Default is `:url`. + # + # + # Also includes all the options from `url_for`. These include such things as + # `:anchor` or `:trailing_slash`. Example usage is given below: + # + # polymorphic_url([blog, post], anchor: 'my_anchor') + # # => "http://example.com/blogs/1/posts/1#my_anchor" + # polymorphic_url([blog, post], anchor: 'my_anchor', script_name: "/my_app") + # # => "http://example.com/my_app/blogs/1/posts/1#my_anchor" + # + # For all of these options, see the documentation for + # [url_for](rdoc-ref:ActionDispatch::Routing::UrlFor). + # + # #### Functionality + # + # # an Article record + # polymorphic_url(record) # same as article_url(record) + # + # # a Comment record + # polymorphic_url(record) # same as comment_url(record) + # + # # it recognizes new records and maps to the collection + # record = Comment.new + # polymorphic_url(record) # same as comments_url() + # + # # the class of a record will also map to the collection + # polymorphic_url(Comment) # same as comments_url() + # + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#110 + def polymorphic_url(record_or_hash_or_array, options = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#177 + def polymorphic_mapping(record); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#173 + def polymorphic_path_for_action(action, record_or_hash, options); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#169 + def polymorphic_url_for_action(action, record_or_hash, options); end +end + +# source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#185 +class ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder + # @return [HelperMethodBuilder] a new instance of HelperMethodBuilder + # + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#248 + def initialize(key_strategy, prefix, suffix); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#262 + def handle_class(klass); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#266 + def handle_class_call(target, klass); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#293 + def handle_list(list); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#270 + def handle_model(record); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#284 + def handle_model_call(target, record); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#254 + def handle_string(record); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#258 + def handle_string_call(target, str); end + + # Returns the value of attribute prefix. + # + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#246 + def prefix; end + + # Returns the value of attribute suffix. + # + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#246 + def suffix; end + + private + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#347 + def get_method_for_class(klass); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#352 + def get_method_for_string(str); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#339 + def polymorphic_mapping(target, record); end + + class << self + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#196 + def build(action, type); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#188 + def get(action, type); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#194 + def path; end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#210 + def plural(prefix, suffix); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#214 + def polymorphic_method(recipient, record_or_hash_or_array, action, type, options); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#206 + def singular(prefix, suffix); end + + # source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#193 + def url; end + end +end + +# source://actionpack//lib/action_dispatch/routing/polymorphic_routes.rb#186 +ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder::CACHE = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/routing/redirection.rb#12 +class ActionDispatch::Routing::Redirect < ::ActionDispatch::Routing::Endpoint + # @return [Redirect] a new instance of Redirect + # + # source://actionpack//lib/action_dispatch/routing/redirection.rb#15 + def initialize(status, block, source_location); end + + # Returns the value of attribute block. + # + # source://actionpack//lib/action_dispatch/routing/redirection.rb#13 + def block; end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#37 + def build_response(req); end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#23 + def call(env); end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#69 + def inspect; end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#65 + def path(params, request); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/redirection.rb#21 + def redirect?; end + + # Returns the value of attribute status. + # + # source://actionpack//lib/action_dispatch/routing/redirection.rb#13 + def status; end + + private + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#78 + def escape(params); end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#82 + def escape_fragment(params); end + + # source://actionpack//lib/action_dispatch/routing/redirection.rb#86 + def escape_path(params); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/redirection.rb#74 + def relative_path?(path); end +end + +# source://actionpack//lib/action_dispatch/routing/redirection.rb#150 +module ActionDispatch::Routing::Redirection + # Redirect any path to another path: + # + # get "/stories" => redirect("/posts") + # + # This will redirect the user, while ignoring certain parts of the request, + # including query string, etc. `/stories`, `/stories?foo=bar`, etc all redirect + # to `/posts`. + # + # The redirect will use a `301 Moved Permanently` status code by default. This + # can be overridden with the `:status` option: + # + # get "/stories" => redirect("/posts", status: 307) + # + # You can also use interpolation in the supplied redirect argument: + # + # get 'docs/:article', to: redirect('/wiki/%{article}') + # + # Note that if you return a path without a leading slash then the URL is + # prefixed with the current SCRIPT_NAME environment variable. This is typically + # '/' but may be different in a mounted engine or where the application is + # deployed to a subdirectory of a website. + # + # Alternatively you can use one of the other syntaxes: + # + # The block version of redirect allows for the easy encapsulation of any logic + # associated with the redirect in question. Either the params and request are + # supplied as arguments, or just params, depending of how many arguments your + # block accepts. A string is required as a return value. + # + # get 'jokes/:number', to: redirect { |params, request| + # path = (params[:number].to_i.even? ? "wheres-the-beef" : "i-love-lamp") + # "http://#{request.host_with_port}/#{path}" + # } + # + # Note that the `do end` syntax for the redirect block wouldn't work, as Ruby + # would pass the block to `get` instead of `redirect`. Use `{ ... }` instead. + # + # The options version of redirect allows you to supply only the parts of the URL + # which need to change, it also supports interpolation of the path similar to + # the first example. + # + # get 'stores/:name', to: redirect(subdomain: 'stores', path: '/%{name}') + # get 'stores/:name(*all)', to: redirect(subdomain: 'stores', path: '/%{name}%{all}') + # get '/stories', to: redirect(path: '/posts') + # + # This will redirect the user, while changing only the specified parts of the + # request, for example the `path` option in the last example. `/stories`, + # `/stories?foo=bar`, redirect to `/posts` and `/posts?foo=bar` respectively. + # + # Finally, an object which responds to call can be supplied to redirect, + # allowing you to reuse common redirect routes. The call method must accept two + # arguments, params and request, and return a string. + # + # get 'accounts/:name' => redirect(SubdomainRedirector.new('api')) + # + # @raise [ArgumentError] + # + # source://actionpack//lib/action_dispatch/routing/redirection.rb#206 + def redirect(*args, &block); end +end + +# The RouteSet contains a collection of Route instances, representing the routes +# typically defined in `config/routes.rb`. +# +# source://actionpack//lib/action_dispatch/routing/route_set.rb#17 +class ActionDispatch::Routing::RouteSet + # @return [RouteSet] a new instance of RouteSet + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#386 + def initialize(config = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#674 + def add_polymorphic_mapping(klass, options, &block); end + + # @raise [ArgumentError] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#643 + def add_route(mapping, name); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#678 + def add_url_helper(name, options, &block); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#417 + def api_only?; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#464 + def append(&block); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#903 + def call(env); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#488 + def clear!; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#438 + def default_env; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#421 + def default_scope; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#425 + def default_scope=(new_default_scope); end + + # Returns the value of attribute default_url_options. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#354 + def default_url_options; end + + # Sets the attribute default_url_options + # + # @param value the value to set the attribute default_url_options to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#354 + def default_url_options=(_arg0); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#509 + def define_mounted_helper(name, script_namer = T.unsafe(nil)); end + + # Returns the value of attribute disable_clear_and_finalize. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#353 + def disable_clear_and_finalize; end + + # Sets the attribute disable_clear_and_finalize + # + # @param value the value to set the attribute disable_clear_and_finalize to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#353 + def disable_clear_and_finalize=(_arg0); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#457 + def draw(&block); end + + # Returns the value of attribute draw_paths. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#354 + def draw_paths; end + + # Sets the attribute draw_paths + # + # @param value the value to set the attribute draw_paths to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#354 + def draw_paths=(_arg0); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#406 + def eager_load!; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#639 + def empty?; end + + # Returns the value of attribute env_key. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#355 + def env_key; end + + # Generate the path indicated by the arguments, and return an array of the keys + # that were not used to generate it. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#818 + def extra_keys(options, recall = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#482 + def finalize!; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#846 + def find_script_name(options); end + + # Returns the value of attribute formatter. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def formatter; end + + # Sets the attribute formatter + # + # @param value the value to set the attribute formatter to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def formatter=(_arg0); end + + # Returns a Route matching the given requirements, or `nil` if none are found. + # + # This is intended for use by tools such as Language Servers. + # + # Given the routes are defined as: + # + # resources :posts + # + # Then the following will return the Route for the `show` action: + # + # Rails.application.routes.from_requirements(controller: "posts", action: "show") + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#29 + def from_requirements(requirements); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#822 + def generate_extras(options, recall = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#536 + def generate_url_helpers(supports_path); end + + # Since the router holds references to many parts of the system like engines, + # controllers and the application itself, inspecting the route set can actually + # be really slow, therefore we default alias inspect to to_s. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#37 + def inspect; end + + # Contains all the mounted helpers across different engines and the `main_app` + # helper for the application. You can include this in your classes if you want + # to access routes for other engines. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#505 + def mounted_helpers; end + + # Returns the value of attribute named_routes. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def named_routes; end + + # Sets the attribute named_routes + # + # @param value the value to set the attribute named_routes to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def named_routes=(_arg0); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#842 + def optimize_routes_generation?; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#850 + def path_for(options, route_name = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # Returns the value of attribute polymorphic_mappings. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#355 + def polymorphic_mappings; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#468 + def prepend(&block); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#909 + def recognize_path(path, environment = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#924 + def recognize_path_with_request(req, path, extras, raise_on_missing: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#413 + def relative_url_root; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#429 + def request_class; end + + # Returns the value of attribute resources_path_names. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#353 + def resources_path_names; end + + # Sets the attribute resources_path_names + # + # @param value the value to set the attribute resources_path_names to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#353 + def resources_path_names=(_arg0); end + + # Returns the value of attribute router. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def router; end + + # Sets the attribute router + # + # @param value the value to set the attribute router to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def router=(_arg0); end + + # Returns the value of attribute set. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#357 + def routes; end + + # Returns the value of attribute set. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def set; end + + # Sets the attribute set + # + # @param value the value to set the attribute set to. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#352 + def set=(_arg0); end + + # The `options` argument must be a hash whose keys are **symbols**. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#855 + def url_for(options, route_name = T.unsafe(nil), url_strategy = T.unsafe(nil), method_name = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#528 + def url_helpers(supports_path = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#472 + def eval_block(block); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#833 + def generate(route_name, options, recall = T.unsafe(nil), method_name = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#433 + def make_request(env); end + + class << self + # source://actionpack//lib/action_dispatch/routing/route_set.rb#359 + def default_resources_path_names; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#363 + def new_with_config(config); end + end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#382 +class ActionDispatch::Routing::RouteSet::Config < ::Struct + # Returns the value of attribute api_only + # + # @return [Object] the current value of api_only + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def api_only; end + + # Sets the attribute api_only + # + # @param value [Object] the value to set the attribute api_only to. + # @return [Object] the newly set value + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def api_only=(_); end + + # Returns the value of attribute default_scope + # + # @return [Object] the current value of default_scope + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def default_scope; end + + # Sets the attribute default_scope + # + # @param value [Object] the value to set the attribute default_scope to. + # @return [Object] the newly set value + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def default_scope=(_); end + + # Returns the value of attribute relative_url_root + # + # @return [Object] the current value of relative_url_root + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def relative_url_root; end + + # Sets the attribute relative_url_root + # + # @param value [Object] the value to set the attribute relative_url_root to. + # @return [Object] the newly set value + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def relative_url_root=(_); end + + class << self + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def [](*_arg0); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def inspect; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def keyword_init?; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def members; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#382 + def new(*_arg0); end + end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#682 +class ActionDispatch::Routing::RouteSet::CustomUrlHelper + # @return [CustomUrlHelper] a new instance of CustomUrlHelper + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#685 + def initialize(name, defaults, &block); end + + # Returns the value of attribute block. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#683 + def block; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#691 + def call(t, args, only_path = T.unsafe(nil)); end + + # Returns the value of attribute defaults. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#683 + def defaults; end + + # Returns the value of attribute name. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#683 + def name; end + + private + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#703 + def eval_block(t, args, options); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#707 + def merge_defaults(options); end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#384 +ActionDispatch::Routing::RouteSet::DEFAULT_CONFIG = T.let(T.unsafe(nil), ActionDispatch::Routing::RouteSet::Config) + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#39 +class ActionDispatch::Routing::RouteSet::Dispatcher < ::ActionDispatch::Routing::Endpoint + # @return [Dispatcher] a new instance of Dispatcher + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#40 + def initialize(raise_on_name_error); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#44 + def dispatcher?; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#46 + def serve(req); end + + private + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#60 + def controller(req); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#64 + def dispatch(controller, action, req, res); end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#712 +class ActionDispatch::Routing::RouteSet::Generator + # @return [Generator] a new instance of Generator + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#715 + def initialize(named_route, options, recall, set); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#727 + def controller; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#731 + def current_controller; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#801 + def different_controller?; end + + # Generates a path from routes, returns a RouteWithParams or MissingRoute. + # MissingRoute will raise ActionController::UrlGenerationError. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#797 + def generate; end + + # Returns the value of attribute named_route. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#713 + def named_route; end + + # Remove leading slashes from controllers + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#785 + def normalize_controller!; end + + # This pulls :controller, :action, and :id out of the recall. The recall key is + # only used if there is no key in the options or if the key in the options is + # identical. If any of :controller, :action or :id is not found, don't pull any + # more keys from the recall. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#767 + def normalize_controller_action_id!; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#743 + def normalize_options!; end + + # Returns the value of attribute options. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#713 + def options; end + + # Returns the value of attribute recall. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#713 + def recall; end + + # Returns the value of attribute set. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#713 + def set; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#735 + def use_recall_for(key); end + + # if the current controller is "foo/bar/baz" and controller: "baz/bat" is + # specified, the controller becomes "foo/baz/bat" + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#775 + def use_relative_controller!; end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#807 + def named_route_exists?; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#811 + def segment_keys; end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#497 +module ActionDispatch::Routing::RouteSet::MountedHelpers + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Routing::UrlFor + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end + +# A NamedRouteCollection instance is a collection of named routes, and also +# maintains an anonymous module that can be used to install helpers for the +# named routes. +# +# source://actionpack//lib/action_dispatch/routing/route_set.rb#82 +class ActionDispatch::Routing::RouteSet::NamedRouteCollection + include ::Enumerable + + # @return [NamedRouteCollection] a new instance of NamedRouteCollection + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#87 + def initialize; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#147 + def [](name); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#146 + def []=(name, route); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#118 + def add(name, route); end + + # Given a `name`, defines name_path and name_url helpers. Used by 'direct', + # 'resolve', and 'polymorphic' route helpers. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#165 + def add_url_helper(name, defaults, &block); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#148 + def clear; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#104 + def clear!; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#150 + def each(&block); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#137 + def get(name); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#100 + def helper_names; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#141 + def key?(name); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#159 + def length; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#155 + def names; end + + # Returns the value of attribute path_helpers_module. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#84 + def path_helpers_module; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#95 + def route_defined?(name); end + + # Returns the value of attribute url_helpers_module. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#84 + def url_helpers_module; end + + private + + # Create a URL helper allowing ordered parameters to be associated with + # corresponding dynamic segments, so you can do: + # + # foo_url(bar, baz, bang) + # + # Instead of: + # + # foo_url(bar: bar, baz: baz, bang: bang) + # + # Also allow options hash, so you can do: + # + # foo_url(bar, baz, bang, sort_by: 'baz') + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#333 + def define_url_helper(mod, name, helper, url_strategy); end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#84 + def routes; end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#188 +class ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper + # @return [UrlHelper] a new instance of UrlHelper + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#271 + def initialize(route, options, route_name); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#278 + def call(t, method_name, args, inner_options, url_strategy); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#290 + def handle_positional_args(controller_options, inner_options, args, result, path_params); end + + # Returns the value of attribute route_name. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#201 + def route_name; end + + class << self + # source://actionpack//lib/action_dispatch/routing/route_set.rb#189 + def create(route, options, route_name); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#197 + def optimize_helper?(route); end + end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#203 +class ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper::OptimizedUrlHelper < ::ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper + # @return [OptimizedUrlHelper] a new instance of OptimizedUrlHelper + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#206 + def initialize(route, options, route_name); end + + # Returns the value of attribute arg_size. + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#204 + def arg_size; end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#212 + def call(t, method_name, args, inner_options, url_strategy); end + + private + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#243 + def optimize_routes_generation?(t); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#235 + def optimized_helper(args); end + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#247 + def parameterize_args(args); end + + # @raise [ActionController::UrlGenerationError] + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#258 + def raise_generation_error(args); end +end + +# strategy for building URLs to send to the client +# +# source://actionpack//lib/action_dispatch/routing/route_set.rb#349 +ActionDispatch::Routing::RouteSet::PATH = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#838 +ActionDispatch::Routing::RouteSet::RESERVED_OPTIONS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#69 +class ActionDispatch::Routing::RouteSet::StaticDispatcher < ::ActionDispatch::Routing::RouteSet::Dispatcher + # @return [StaticDispatcher] a new instance of StaticDispatcher + # + # source://actionpack//lib/action_dispatch/routing/route_set.rb#70 + def initialize(controller_class); end + + private + + # source://actionpack//lib/action_dispatch/routing/route_set.rb#76 + def controller(_); end +end + +# source://actionpack//lib/action_dispatch/routing/route_set.rb#350 +ActionDispatch::Routing::RouteSet::UNKNOWN = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_dispatch/routing/inspector.rb#10 +class ActionDispatch::Routing::RouteWrapper < ::SimpleDelegator + # source://actionpack//lib/action_dispatch/routing/inspector.rb#56 + def action; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#28 + def constraints; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#52 + def controller; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#17 + def endpoint; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#64 + def engine?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#60 + def internal?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#11 + def matches_filter?(filter, value); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#40 + def name; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#36 + def path; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#32 + def rack_app; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#44 + def reqs; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#68 + def to_h; end +end + +# This class is just used for displaying route information when someone +# executes `bin/rails routes` or looks at the RoutingError page. People should +# not use this class. +# +# source://actionpack//lib/action_dispatch/routing/inspector.rb#81 +class ActionDispatch::Routing::RoutesInspector + # @return [RoutesInspector] a new instance of RoutesInspector + # + # source://actionpack//lib/action_dispatch/routing/inspector.rb#82 + def initialize(routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#87 + def format(formatter, filter = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#147 + def filter_routes(routes, filter); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#98 + def format_routes(formatter, filter, engine_name, routes); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#115 + def load_engines_routes; end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#128 + def normalize_filter(filter); end + + # source://actionpack//lib/action_dispatch/routing/inspector.rb#111 + def wrap_routes(routes); end +end + +# source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#9 +class ActionDispatch::Routing::RoutesProxy + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + + # @return [RoutesProxy] a new instance of RoutesProxy + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#15 + def initialize(routes, scope, helpers, script_namer = T.unsafe(nil)); end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#13 + def _routes; end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def default_url_options; end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def default_url_options=(_arg0); end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def default_url_options?; end + + # Returns the value of attribute routes. + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#12 + def routes; end + + # Sets the attribute routes + # + # @param value the value to set the attribute routes to. + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#12 + def routes=(_arg0); end + + # Returns the value of attribute scope. + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#12 + def scope; end + + # Sets the attribute scope + # + # @param value the value to set the attribute scope to. + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#12 + def scope=(_arg0); end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#21 + def url_options; end + + private + + # Keeps the part of the script name provided by the global context via + # [ENV]("SCRIPT_NAME"), which `mount` doesn't know about since it depends on the + # specific request, but use our script name resolver for the mount point + # dependent part. + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#55 + def merge_script_names(previous_script_name, new_script_name); end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#32 + def method_missing(method, *args); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#28 + def respond_to_missing?(method, _); end + + class << self + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def default_url_options; end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def default_url_options=(value); end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def default_url_options?; end + + private + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def __class_attr_default_url_options; end + + # source://actionpack//lib/action_dispatch/routing/routes_proxy.rb#10 + def __class_attr_default_url_options=(new_value); end + end +end + +# source://actionpack//lib/action_dispatch/routing.rb#259 +ActionDispatch::Routing::SEPARATORS = T.let(T.unsafe(nil), Array) + +# # Action Dispatch Routing UrlFor +# +# In `config/routes.rb` you define URL-to-controller mappings, but the reverse +# is also possible: a URL can be generated from one of your routing definitions. +# URL generation functionality is centralized in this module. +# +# See ActionDispatch::Routing for general information about routing and +# `config/routes.rb`. +# +# **Tip:** If you need to generate URLs from your models or some other place, +# then ActionDispatch::Routing::UrlFor is what you're looking for. Read on for +# an introduction. In general, this module should not be included on its own, as +# it is usually included by `url_helpers` (as in +# `Rails.application.routes.url_helpers`). +# +# ## URL generation from parameters +# +# As you may know, some functions, such as `ActionController::Base#url_for` and +# ActionView::Helpers::UrlHelper#link_to, can generate URLs given a set of +# parameters. For example, you've probably had the chance to write code like +# this in one of your views: +# +# <%= link_to('Click here', controller: 'users', +# action: 'new', message: 'Welcome!') %> +# # => Click here +# +# `link_to`, and all other functions that require URL generation functionality, +# actually use ActionDispatch::Routing::UrlFor under the hood. And in +# particular, they use the ActionDispatch::Routing::UrlFor#url_for method. One +# can generate the same path as the above example by using the following code: +# +# include ActionDispatch::Routing::UrlFor +# url_for(controller: 'users', +# action: 'new', +# message: 'Welcome!', +# only_path: true) +# # => "/users/new?message=Welcome%21" +# +# Notice the `only_path: true` part. This is because UrlFor has no information +# about the website hostname that your Rails app is serving. So if you want to +# include the hostname as well, then you must also pass the `:host` argument: +# +# include UrlFor +# url_for(controller: 'users', +# action: 'new', +# message: 'Welcome!', +# host: 'www.example.com') +# # => "http://www.example.com/users/new?message=Welcome%21" +# +# By default, all controllers and views have access to a special version of +# `url_for`, that already knows what the current hostname is. So if you use +# `url_for` in your controllers or your views, then you don't need to explicitly +# pass the `:host` argument. +# +# For convenience, mailers also include ActionDispatch::Routing::UrlFor. So +# within mailers, you can use url_for. However, mailers cannot access incoming +# web requests in order to derive hostname information, so you have to provide +# the `:host` option or set the default host using `default_url_options`. For +# more information on url_for in mailers see the ActionMailer::Base +# documentation. +# +# ## URL generation for named routes +# +# UrlFor also allows one to access methods that have been auto-generated from +# named routes. For example, suppose that you have a 'users' resource in your +# `config/routes.rb`: +# +# resources :users +# +# This generates, among other things, the method `users_path`. By default, this +# method is accessible from your controllers, views, and mailers. If you need to +# access this auto-generated method from other places (such as a model), then +# you can do that by including `Rails.application.routes.url_helpers` in your +# class: +# +# class User < ActiveRecord::Base +# include Rails.application.routes.url_helpers +# +# def base_uri +# user_path(self) +# end +# end +# +# User.find(1).base_uri # => "/users/1" +# +# source://actionpack//lib/action_dispatch/routing/url_for.rb#92 +module ActionDispatch::Routing::UrlFor + include ::ActionDispatch::Routing::PolymorphicRoutes + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + # source://actionpack//lib/action_dispatch/routing/url_for.rb#111 + def initialize(*_arg0, **_arg1, &_arg2); end + + # source://actionpack//lib/action_dispatch/routing/url_for.rb#182 + def full_url_for(options = T.unsafe(nil)); end + + # Allows calling direct or regular named route. + # + # resources :buckets + # + # direct :recordable do |recording| + # route_for(:bucket, recording.bucket) + # end + # + # direct :threadable do |threadable| + # route_for(:recordable, threadable.parent) + # end + # + # This maintains the context of the original caller on whether to return a path + # or full URL, e.g: + # + # threadable_path(threadable) # => "/buckets/1" + # threadable_url(threadable) # => "http://example.com/buckets/1" + # + # source://actionpack//lib/action_dispatch/routing/url_for.rb#222 + def route_for(name, *args); end + + # Generate a URL based on the options provided, `default_url_options`, and the + # routes defined in `config/routes.rb`. The following options are supported: + # + # * `:only_path` - If true, the relative URL is returned. Defaults to `false`. + # * `:protocol` - The protocol to connect to. Defaults to `"http"`. + # * `:host` - Specifies the host the link should be targeted at. If + # `:only_path` is false, this option must be provided either explicitly, or + # via `default_url_options`. + # * `:subdomain` - Specifies the subdomain of the link, using the `tld_length` + # to split the subdomain from the host. If false, removes all subdomains + # from the host part of the link. + # * `:domain` - Specifies the domain of the link, using the `tld_length` to + # split the domain from the host. + # * `:tld_length` - Number of labels the TLD id composed of, only used if + # `:subdomain` or `:domain` are supplied. Defaults to + # `ActionDispatch::Http::URL.tld_length`, which in turn defaults to 1. + # * `:port` - Optionally specify the port to connect to. + # * `:anchor` - An anchor name to be appended to the path. + # * `:params` - The query parameters to be appended to the path. + # * `:path_params` - The query parameters that will only be used for the named + # dynamic segments of path. If unused, they will be discarded. + # * `:trailing_slash` - If true, adds a trailing slash, as in + # `"/archive/2009/"`. + # * `:script_name` - Specifies application path relative to domain root. If + # provided, prepends application path. + # + # + # Any other key (`:controller`, `:action`, etc.) given to `url_for` is forwarded + # to the Routes module. + # + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', port: '8080' + # # => 'http://somehost.org:8080/tasks/testing' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', anchor: 'ok', only_path: true + # # => '/tasks/testing#ok' + # url_for controller: 'tasks', action: 'testing', trailing_slash: true + # # => 'http://somehost.org/tasks/testing/' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', number: '33' + # # => 'http://somehost.org/tasks/testing?number=33' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', script_name: "/myapp" + # # => 'http://somehost.org/myapp/tasks/testing' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', script_name: "/myapp", only_path: true + # # => '/myapp/tasks/testing' + # + # Missing routes keys may be filled in from the current request's parameters + # (e.g. `:controller`, `:action`, `:id`, and any other parameters that are + # placed in the path). Given that the current action has been reached through + # `GET /users/1`: + # + # url_for(only_path: true) # => '/users/1' + # url_for(only_path: true, action: 'edit') # => '/users/1/edit' + # url_for(only_path: true, action: 'edit', id: 2) # => '/users/2/edit' + # + # Notice that no `:id` parameter was provided to the first `url_for` call and + # the helper used the one from the route's path. Any path parameter implicitly + # used by `url_for` can always be overwritten like shown on the last `url_for` + # calls. + # + # source://actionpack//lib/action_dispatch/routing/url_for.rb#178 + def url_for(options = T.unsafe(nil)); end + + # Hook overridden in controller to add request information with + # `default_url_options`. Application logic should not go into url_options. + # + # source://actionpack//lib/action_dispatch/routing/url_for.rb#118 + def url_options; end + + protected + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/routing/url_for.rb#227 + def optimize_routes_generation?; end + + private + + # source://actionpack//lib/action_dispatch/routing/url_for.rb#239 + def _routes_context; end + + # source://actionpack//lib/action_dispatch/routing/url_for.rb#232 + def _with_routes(routes); end + + module GeneratedClassMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end + + module GeneratedInstanceMethods + def default_url_options; end + def default_url_options=(value); end + def default_url_options?; end + end +end + +# # Action Dispatch SSL +# +# This middleware is added to the stack when `config.force_ssl = true`, and is +# passed the options set in `config.ssl_options`. It does three jobs to enforce +# secure HTTP requests: +# +# 1. **TLS redirect**: Permanently redirects `http://` requests to `https://` +# with the same URL host, path, etc. Enabled by default. Set +# `config.ssl_options` to modify the destination URL: +# +# config.ssl_options = { redirect: { host: "secure.widgets.com", port: 8080 }` +# +# Or set `redirect: false` to disable redirection. +# +# Requests can opt-out of redirection with `exclude`: +# +# config.ssl_options = { redirect: { exclude: -> request { request.path == "/up" } } } +# +# Cookies will not be flagged as secure for excluded requests. +# +# When proxying through a load balancer that terminates SSL, the forwarded +# request will appear as though it's HTTP instead of HTTPS to the application. +# This makes redirects and cookie security target HTTP instead of HTTPS. +# To make the server assume that the proxy already terminated SSL, and +# that the request really is HTTPS, set `config.assume_ssl` to `true`: +# +# config.assume_ssl = true +# +# 2. **Secure cookies**: Sets the `secure` flag on cookies to tell browsers +# they must not be sent along with `http://` requests. Enabled by default. +# Set `config.ssl_options` with `secure_cookies: false` to disable this +# feature. +# +# 3. **HTTP Strict Transport Security (HSTS)**: Tells the browser to remember +# this site as TLS-only and automatically redirect non-TLS requests. Enabled +# by default. Configure `config.ssl_options` with `hsts: false` to disable. +# +# Set `config.ssl_options` with `hsts: { ... }` to configure HSTS: +# +# * `expires`: How long, in seconds, these settings will stick. The +# minimum required to qualify for browser preload lists is 1 year. +# Defaults to 2 years (recommended). +# +# * `subdomains`: Set to `true` to tell the browser to apply these +# settings to all subdomains. This protects your cookies from +# interception by a vulnerable site on a subdomain. Defaults to `true`. +# +# * `preload`: Advertise that this site may be included in browsers' +# preloaded HSTS lists. HSTS protects your site on every visit *except +# the first visit* since it hasn't seen your HSTS header yet. To close +# this gap, browser vendors include a baked-in list of HSTS-enabled +# sites. Go to https://hstspreload.org to submit your site for +# inclusion. Defaults to `false`. +# +# +# To turn off HSTS, omitting the header is not enough. Browsers will +# remember the original HSTS directive until it expires. Instead, use the +# header to tell browsers to expire HSTS immediately. Setting `hsts: false` +# is a shortcut for `hsts: { expires: 0 }`. +# +# source://actionpack//lib/action_dispatch/middleware/ssl.rb#66 +class ActionDispatch::SSL + # @return [SSL] a new instance of SSL + # + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#76 + def initialize(app, redirect: T.unsafe(nil), hsts: T.unsafe(nil), secure_cookies: T.unsafe(nil), ssl_default_redirect_status: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#88 + def call(env); end + + private + + # https://tools.ietf.org/html/rfc6797#section-6.1 + # + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#122 + def build_hsts_header(hsts); end + + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#129 + def flag_cookies_as_secure!(headers); end + + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#170 + def https_location_for(request); end + + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#107 + def normalize_hsts_options(options); end + + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#153 + def redirect_to_https(request); end + + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#160 + def redirection_status(request); end + + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#103 + def set_hsts_header!(headers); end + + class << self + # source://actionpack//lib/action_dispatch/middleware/ssl.rb#72 + def default_hsts_options; end + end +end + +# :stopdoc: Default to 2 years as recommended on hstspreload.org. +# +# source://actionpack//lib/action_dispatch/middleware/ssl.rb#68 +ActionDispatch::SSL::HSTS_EXPIRES_IN = T.let(T.unsafe(nil), Integer) + +# source://actionpack//lib/action_dispatch/middleware/ssl.rb#70 +ActionDispatch::SSL::PERMANENT_REDIRECT_REQUEST_METHODS = T.let(T.unsafe(nil), Array) + +# source://actionpack//lib/action_dispatch/middleware/server_timing.rb#8 +class ActionDispatch::ServerTiming + # @return [ServerTiming] a new instance of ServerTiming + # + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#52 + def initialize(app); end + + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#58 + def call(env); end + + class << self + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#48 + def unsubscribe; end + end +end + +# source://actionpack//lib/action_dispatch/middleware/server_timing.rb#9 +class ActionDispatch::ServerTiming::Subscriber + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # @return [Subscriber] a new instance of Subscriber + # + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#13 + def initialize; end + + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#17 + def call(event); end + + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#23 + def collect_events; end + + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#32 + def ensure_subscribed; end + + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#40 + def unsubscribe; end + + class << self + private + + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#10 + def allocate; end + + # source://actionpack//lib/action_dispatch/middleware/server_timing.rb#10 + def new(*_arg0); end + end +end + +# source://actionpack//lib/action_dispatch/middleware/server_timing.rb#11 +ActionDispatch::ServerTiming::Subscriber::KEY = T.let(T.unsafe(nil), Symbol) + +# source://actionpack//lib/action_dispatch.rb#106 +module ActionDispatch::Session + class << self + # source://actionpack//lib/action_dispatch.rb#113 + def resolve_store(session_store); end + end +end + +# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#97 +class ActionDispatch::Session::AbstractSecureStore < ::Rack::Session::Abstract::PersistedSecure + include ::ActionDispatch::Session::Compatibility + include ::ActionDispatch::Session::StaleSessionCheck + include ::ActionDispatch::Session::SessionObject + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#102 + def generate_sid; end + + private + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#107 + def set_cookie(request, response, cookie); end +end + +# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#86 +class ActionDispatch::Session::AbstractStore < ::Rack::Session::Abstract::Persisted + include ::ActionDispatch::Session::Compatibility + include ::ActionDispatch::Session::StaleSessionCheck + include ::ActionDispatch::Session::SessionObject + + private + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#92 + def set_cookie(request, response, cookie); end +end + +# # Action Dispatch Session CacheStore +# +# A session store that uses an ActiveSupport::Cache::Store to store the +# sessions. This store is most useful if you don't store critical data in your +# sessions and you don't need them to live for extended periods of time. +# +# #### Options +# * `cache` - The cache to use. If it is not specified, `Rails.cache` +# will be used. +# * `expire_after` - The length of time a session will be stored before +# automatically expiring. By default, the `:expires_in` option of the cache +# is used. +# * `check_collisions` - Check if newly generated session ids aren't already in use. +# If for some reason 128 bits of randomness aren't considered secure enough to avoid +# collisions, this option can be enabled to ensure newly generated ids aren't in use. +# By default, it is set to `false` to avoid additional cache write operations. +# +# source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#26 +class ActionDispatch::Session::CacheStore < ::ActionDispatch::Session::AbstractSecureStore + # @return [CacheStore] a new instance of CacheStore + # + # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#27 + def initialize(app, options = T.unsafe(nil)); end + + # Remove a session from the cache. + # + # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#54 + def delete_session(env, sid, options); end + + # Get a session from the cache. + # + # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#35 + def find_session(env, sid); end + + # Set a session in the cache. + # + # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#43 + def write_session(env, sid, session, options); end + + private + + # Turn the session id into a cache key. + # + # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#62 + def cache_key(id); end + + # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#70 + def generate_sid; end + + # source://actionpack//lib/action_dispatch/middleware/session/cache_store.rb#66 + def get_session_with_fallback(sid); end +end + +# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#22 +module ActionDispatch::Session::Compatibility + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#23 + def initialize(app, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#28 + def generate_sid; end + + private + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#35 + def initialize_sid; end + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#40 + def make_request(env); end +end + +# # Action Dispatch Session CookieStore +# +# This cookie-based session store is the Rails default. It is dramatically +# faster than the alternatives. +# +# Sessions typically contain at most a user ID and flash message; both fit +# within the 4096 bytes cookie size limit. A `CookieOverflow` exception is +# raised if you attempt to store more than 4096 bytes of data. +# +# The cookie jar used for storage is automatically configured to be the best +# possible option given your application's configuration. +# +# Your cookies will be encrypted using your application's `secret_key_base`. +# This goes a step further than signed cookies in that encrypted cookies cannot +# be altered or read by users. This is the default starting in Rails 4. +# +# Configure your session store in an initializer: +# +# Rails.application.config.session_store :cookie_store, key: '_your_app_session' +# +# In the development and test environments your application's `secret_key_base` +# is generated by Rails and stored in a temporary file in +# `tmp/local_secret.txt`. In all other environments, it is stored encrypted in +# the `config/credentials.yml.enc` file. +# +# If your application was not updated to Rails 5.2 defaults, the +# `secret_key_base` will be found in the old `config/secrets.yml` file. +# +# Note that changing your `secret_key_base` will invalidate all existing +# session. Additionally, you should take care to make sure you are not relying +# on the ability to decode signed cookies generated by your app in external +# applications or JavaScript before changing it. +# +# Because CookieStore extends `Rack::Session::Abstract::Persisted`, many of the +# options described there can be used to customize the session cookie that is +# generated. For example: +# +# Rails.application.config.session_store :cookie_store, expire_after: 14.days +# +# would set the session cookie to expire automatically 14 days after creation. +# Other useful options include `:key`, `:secure`, `:httponly`, and `:same_site`. +# +# source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#52 +class ActionDispatch::Session::CookieStore < ::ActionDispatch::Session::AbstractSecureStore + # @return [CookieStore] a new instance of CookieStore + # + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#64 + def initialize(app, options = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#70 + def delete_session(req, session_id, options); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#77 + def load_session(req); end + + private + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#124 + def cookie_jar(request); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#86 + def extract_session_id(req); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#120 + def get_cookie(req); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#105 + def persistent_session_id!(data, sid = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#116 + def set_cookie(request, session_id, cookie); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#93 + def unpacked_cookie_data(req); end + + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#111 + def write_session(req, sid, session_data, options); end +end + +# source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#62 +ActionDispatch::Session::CookieStore::DEFAULT_SAME_SITE = T.let(T.unsafe(nil), Proc) + +# source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#53 +class ActionDispatch::Session::CookieStore::SessionId + # @return [SessionId] a new instance of SessionId + # + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#56 + def initialize(session_id, cookie_value = T.unsafe(nil)); end + + # Returns the value of attribute cookie_value. + # + # source://actionpack//lib/action_dispatch/middleware/session/cookie_store.rb#54 + def cookie_value; end +end + +# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#71 +module ActionDispatch::Session::SessionObject + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#72 + def commit_session(req, res); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#81 + def loaded_session?(session); end + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#77 + def prepare_session(req); end +end + +# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#13 +class ActionDispatch::Session::SessionRestoreError < ::StandardError + # @return [SessionRestoreError] a new instance of SessionRestoreError + # + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#14 + def initialize; end +end + +# source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#45 +module ActionDispatch::Session::StaleSessionCheck + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#50 + def extract_session_id(env); end + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#46 + def load_session(env); end + + # source://actionpack//lib/action_dispatch/middleware/session/abstract_store.rb#54 + def stale_session_check!; end +end + +# # Action Dispatch ShowExceptions +# +# This middleware rescues any exception returned by the application and calls an +# exceptions app that will wrap it in a format for the end user. +# +# The exceptions app should be passed as a parameter on initialization of +# `ShowExceptions`. Every time there is an exception, `ShowExceptions` will +# store the exception in `env["action_dispatch.exception"]`, rewrite the +# `PATH_INFO` to the exception status code, and call the Rack app. +# +# In Rails applications, the exceptions app can be configured with +# `config.exceptions_app`, which defaults to ActionDispatch::PublicExceptions. +# +# If the application returns a response with the `X-Cascade` header set to +# `"pass"`, this middleware will send an empty response as a result with the +# correct status code. If any exception happens inside the exceptions app, this +# middleware catches the exceptions and returns a failsafe response. +# +# source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#25 +class ActionDispatch::ShowExceptions + # @return [ShowExceptions] a new instance of ShowExceptions + # + # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#26 + def initialize(app, exceptions_app); end + + # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#31 + def call(env); end + + private + + # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#67 + def fallback_to_html_format_if_invalid_mime_type(request); end + + # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#83 + def pass_response(status); end + + # source://actionpack//lib/action_dispatch/middleware/show_exceptions.rb#48 + def render_exception(request, wrapper); end +end + +# # Action Dispatch Static +# +# This middleware serves static files from disk, if available. If no file is +# found, it hands off to the main app. +# +# In Rails apps, this middleware is configured to serve assets from the +# `public/` directory. +# +# Only GET and HEAD requests are served. POST and other HTTP methods are handed +# off to the main app. +# +# Only files in the root directory are served; path traversal is denied. +# +# source://actionpack//lib/action_dispatch/middleware/static.rb#20 +class ActionDispatch::Static + # @return [Static] a new instance of Static + # + # source://actionpack//lib/action_dispatch/middleware/static.rb#21 + def initialize(app, path, index: T.unsafe(nil), headers: T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/middleware/static.rb#26 + def call(env); end +end + +# source://actionpack//lib/action_dispatch/structured_event_subscriber.rb#4 +class ActionDispatch::StructuredEventSubscriber < ::ActiveSupport::StructuredEventSubscriber + # source://actionpack//lib/action_dispatch/structured_event_subscriber.rb#5 + def redirect(event); end +end + +# source://actionpack//lib/action_dispatch/testing/test_helpers/page_dump_helper.rb#4 +module ActionDispatch::TestHelpers; end + +# source://actionpack//lib/action_dispatch/testing/test_helpers/page_dump_helper.rb#5 +module ActionDispatch::TestHelpers::PageDumpHelper + # Saves the content of response body to a file and tries to open it in your browser. + # Launchy must be present in your Gemfile for the page to open automatically. + # + # source://actionpack//lib/action_dispatch/testing/test_helpers/page_dump_helper.rb#10 + def save_and_open_page(path = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_dispatch/testing/test_helpers/page_dump_helper.rb#30 + def html_dump_default_path; end + + # source://actionpack//lib/action_dispatch/testing/test_helpers/page_dump_helper.rb#23 + def open_file(path); end + + # @raise [InvalidResponse] + # + # source://actionpack//lib/action_dispatch/testing/test_helpers/page_dump_helper.rb#15 + def save_page(path = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/testing/test_helpers/page_dump_helper.rb#6 +class ActionDispatch::TestHelpers::PageDumpHelper::InvalidResponse < ::StandardError; end + +# source://actionpack//lib/action_dispatch/testing/test_process.rb#9 +module ActionDispatch::TestProcess + include ::ActionDispatch::TestProcess::FixtureFile + + # @raise [NoMethodError] + # + # source://actionpack//lib/action_dispatch/testing/test_process.rb#34 + def assigns(key = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/testing/test_process.rb#48 + def cookies; end + + # source://actionpack//lib/action_dispatch/testing/test_process.rb#44 + def flash; end + + # source://actionpack//lib/action_dispatch/testing/test_process.rb#52 + def redirect_to_url; end + + # source://actionpack//lib/action_dispatch/testing/test_process.rb#40 + def session; end +end + +# source://actionpack//lib/action_dispatch/testing/test_process.rb#10 +module ActionDispatch::TestProcess::FixtureFile + # Shortcut for + # `Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.file_fixture_path, path), type)`: + # + # post :change_avatar, params: { avatar: file_fixture_upload('david.png', 'image/png') } + # + # Default fixture files location is `test/fixtures/files`. + # + # To upload binary files on Windows, pass `:binary` as the last parameter. This + # will not affect other platforms: + # + # post :change_avatar, params: { avatar: file_fixture_upload('david.png', 'image/png', :binary) } + # + # source://actionpack//lib/action_dispatch/testing/test_process.rb#22 + def file_fixture_upload(path, mime_type = T.unsafe(nil), binary = T.unsafe(nil)); end + + # Shortcut for + # `Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.file_fixture_path, path), type)`: + # + # post :change_avatar, params: { avatar: file_fixture_upload('david.png', 'image/png') } + # + # Default fixture files location is `test/fixtures/files`. + # + # To upload binary files on Windows, pass `:binary` as the last parameter. This + # will not affect other platforms: + # + # post :change_avatar, params: { avatar: file_fixture_upload('david.png', 'image/png', :binary) } + # + # source://actionpack//lib/action_dispatch/testing/test_process.rb#29 + def fixture_file_upload(path, mime_type = T.unsafe(nil), binary = T.unsafe(nil)); end +end + +# source://actionpack//lib/action_dispatch/testing/test_request.rb#9 +class ActionDispatch::TestRequest < ::ActionDispatch::Request + # source://actionpack//lib/action_dispatch/testing/test_request.rb#68 + def accept=(mime_types); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#48 + def action=(action_name); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#32 + def host=(host); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#52 + def if_modified_since=(last_modified); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#56 + def if_none_match=(etag); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#44 + def path=(path); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#36 + def port=(number); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#60 + def remote_addr=(addr); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#28 + def request_method=(method); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#40 + def request_uri=(uri); end + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#64 + def user_agent=(user_agent); end + + class << self + # Create a new test request with default `env` values. + # + # source://actionpack//lib/action_dispatch/testing/test_request.rb#17 + def create(env = T.unsafe(nil)); end + + private + + # source://actionpack//lib/action_dispatch/testing/test_request.rb#23 + def default_env; end + end +end + +# source://actionpack//lib/action_dispatch/testing/test_request.rb#10 +ActionDispatch::TestRequest::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) + +# Integration test methods such as Integration::RequestHelpers#get and +# Integration::RequestHelpers#post return objects of class TestResponse, which +# represent the HTTP response results of the requested controller actions. +# +# See Response for more information on controller response objects. +# +# source://actionpack//lib/action_dispatch/testing/test_response.rb#13 +class ActionDispatch::TestResponse < ::ActionDispatch::Response + # Returns a parsed body depending on the response MIME type. When a parser + # corresponding to the MIME type is not found, it returns the raw body. + # + # #### Examples + # get "/posts" + # response.content_type # => "text/html; charset=utf-8" + # response.parsed_body.class # => Nokogiri::HTML5::Document + # response.parsed_body.to_html # => "\n\n..." + # + # assert_pattern { response.parsed_body.at("main") => { content: "Hello, world" } } + # + # response.parsed_body.at("main") => {name:, content:} + # assert_equal "main", name + # assert_equal "Some main content", content + # + # get "/posts.json" + # response.content_type # => "application/json; charset=utf-8" + # response.parsed_body.class # => Array + # response.parsed_body # => [{"id"=>42, "title"=>"Title"},... + # + # assert_pattern { response.parsed_body => [{ id: 42 }] } + # + # get "/posts/42.json" + # response.content_type # => "application/json; charset=utf-8" + # response.parsed_body.class # => ActiveSupport::HashWithIndifferentAccess + # response.parsed_body # => {"id"=>42, "title"=>"Title"} + # + # assert_pattern { response.parsed_body => [{ title: /title/i }] } + # + # response.parsed_body => {id:, title:} + # assert_equal 42, id + # assert_equal "Title", title + # + # source://actionpack//lib/action_dispatch/testing/test_response.rb#50 + def parsed_body; end + + # source://actionpack//lib/action_dispatch/testing/test_response.rb#54 + def response_parser; end + + class << self + # source://actionpack//lib/action_dispatch/testing/test_response.rb#14 + def from_response(response); end + end +end + +# :markup: markdown +# +# source://actionpack//lib/action_pack/gem_version.rb#5 +module ActionPack + class << self + # Returns the currently loaded version of Action Pack as a `Gem::Version`. + # + # source://actionpack//lib/action_pack/gem_version.rb#7 + def gem_version; end + + # Returns the currently loaded version of Action Pack as a `Gem::Version`. + # + # source://actionpack//lib/action_pack/version.rb#9 + def version; end + end +end + +# source://actionpack//lib/action_pack/gem_version.rb#11 +module ActionPack::VERSION; end + +# source://actionpack//lib/action_pack/gem_version.rb#12 +ActionPack::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://actionpack//lib/action_pack/gem_version.rb#13 +ActionPack::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# source://actionpack//lib/action_pack/gem_version.rb#15 +ActionPack::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# source://actionpack//lib/action_pack/gem_version.rb#17 +ActionPack::VERSION::STRING = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_pack/gem_version.rb#14 +ActionPack::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +module ActionView::RoutingUrlFor + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor +end + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#7 +module Mime + class << self + # source://actionpack//lib/action_dispatch/http/mime_type.rb#51 + def [](type); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#64 + def fetch(type, &block); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#56 + def symbols; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#60 + def valid_symbols?(symbols); end + end +end + +# ALL isn't a real MIME type, so we don't register it for lookup with the other +# concrete types. It's a wildcard match that we use for `respond_to` negotiation +# internals. +# +# source://actionpack//lib/action_dispatch/http/mime_type.rb#363 +Mime::ALL = T.let(T.unsafe(nil), Mime::AllType) + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#349 +class Mime::AllType < ::Mime::Type + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # @return [AllType] a new instance of AllType + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#352 + def initialize; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#356 + def all?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#357 + def html?; end + + class << self + private + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#350 + def allocate; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#350 + def new(*_arg0); end + end +end + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#47 +Mime::EXTENSION_LOOKUP = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#48 +Mime::LOOKUP = T.let(T.unsafe(nil), Hash) + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#8 +class Mime::Mimes + include ::Enumerable + + # @return [Mimes] a new instance of Mimes + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#13 + def initialize; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#23 + def <<(type); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#30 + def delete_if; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#19 + def each(&block); end + + # Returns the value of attribute symbols. + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#9 + def symbols; end + + # :nodoc + # + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#41 + def valid_symbols?(symbols); end +end + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#365 +class Mime::NullType + include ::Singleton::SingletonInstanceMethods + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#368 + def nil?; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#376 + def ref; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#372 + def to_s; end + + private + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#383 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#379 + def respond_to_missing?(method, _); end + + class << self + private + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#366 + def allocate; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#366 + def new(*_arg0); end + end +end + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#46 +Mime::SET = T.let(T.unsafe(nil), Mime::Mimes) + +# Encapsulates the notion of a MIME type. Can be used at render time, for +# example, with: +# +# class PostsController < ActionController::Base +# def show +# @post = Post.find(params[:id]) +# +# respond_to do |format| +# format.html +# format.ics { render body: @post.to_ics, mime_type: Mime::Type.lookup("text/calendar") } +# format.xml { render xml: @post } +# end +# end +# end +# +# source://actionpack//lib/action_dispatch/http/mime_type.rb#84 +class Mime::Type + # @return [Type] a new instance of Type + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#264 + def initialize(string, symbol = T.unsafe(nil), synonyms = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#297 + def ==(mime_type); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#289 + def ===(list); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#311 + def =~(mime_type); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#327 + def all?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#304 + def eql?(other); end + + # Returns the value of attribute hash. + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#255 + def hash; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#323 + def html?; end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#317 + def match?(mime_type); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#285 + def ref; end + + # Returns the value of attribute symbol. + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#85 + def symbol; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#273 + def to_s; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#277 + def to_str; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#281 + def to_sym; end + + protected + + # Returns the value of attribute string. + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#330 + def string; end + + # Returns the value of attribute synonyms. + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#330 + def synonyms; end + + private + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#336 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#344 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#334 + def to_a; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#333 + def to_ary; end + + class << self + # source://actionpack//lib/action_dispatch/http/mime_type.rb#167 + def lookup(string); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#175 + def lookup_by_extension(extension); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#200 + def parse(accept_header); end + + # For an input of `'text'`, returns `[Mime[:json], Mime[:xml], Mime[:ics], + # Mime[:html], Mime[:css], Mime[:csv], Mime[:js], Mime[:yaml], Mime[:text]]`. + # + # For an input of `'application'`, returns `[Mime[:html], Mime[:js], Mime[:xml], + # Mime[:yaml], Mime[:atom], Mime[:json], Mime[:rss], Mime[:url_encoded_form]]`. + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#236 + def parse_data_with_trailing_star(type); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#227 + def parse_trailing_star(accept_header); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#186 + def register(string, symbol, mime_type_synonyms = T.unsafe(nil), extension_synonyms = T.unsafe(nil), skip_lookup = T.unsafe(nil)); end + + # Registers an alias that's not used on MIME type lookup, but can be referenced + # directly. Especially useful for rendering different HTML versions depending on + # the user agent, like an iPhone. + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#182 + def register_alias(string, symbol, extension_synonyms = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#163 + def register_callback(&block); end + + # This method is opposite of register method. + # + # To unregister a MIME type: + # + # Mime::Type.unregister(:mobile) + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#245 + def unregister(symbol); end + end +end + +# A simple helper class used in parsing the accept header. +# +# source://actionpack//lib/action_dispatch/http/mime_type.rb#90 +class Mime::Type::AcceptItem + # @return [AcceptItem] a new instance of AcceptItem + # + # source://actionpack//lib/action_dispatch/http/mime_type.rb#94 + def initialize(index, name, q = T.unsafe(nil)); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#101 + def <=>(item); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#91 + def index; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#91 + def index=(_arg0); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#91 + def name; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#91 + def name=(_arg0); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#91 + def q; end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#91 + def q=(_arg0); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#92 + def to_s; end +end + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#108 +class Mime::Type::AcceptList + class << self + # source://actionpack//lib/action_dispatch/http/mime_type.rb#151 + def find_item_by_name(array, name); end + + # source://actionpack//lib/action_dispatch/http/mime_type.rb#109 + def sort!(list); end + end +end + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#262 +class Mime::Type::InvalidMimeType < ::StandardError; end + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#257 +Mime::Type::MIME_NAME = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#259 +Mime::Type::MIME_PARAMETER = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#258 +Mime::Type::MIME_PARAMETER_VALUE = T.let(T.unsafe(nil), String) + +# source://actionpack//lib/action_dispatch/http/mime_type.rb#260 +Mime::Type::MIME_REGEXP = T.let(T.unsafe(nil), Regexp) + +# source://actionpack//lib/action_dispatch.rb#35 +module Rack; end diff --git a/sorbet/rbi/gems/actiontext@7.0.4.rbi b/sorbet/rbi/gems/actiontext@7.0.4.rbi deleted file mode 100644 index df0e20b..0000000 --- a/sorbet/rbi/gems/actiontext@7.0.4.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `actiontext` gem. -# Please instead update this file by running `bin/tapioca gem actiontext`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/actionview@7.0.4.rbi b/sorbet/rbi/gems/actionview@8.1.2.rbi similarity index 73% rename from sorbet/rbi/gems/actionview@7.0.4.rbi rename to sorbet/rbi/gems/actionview@8.1.2.rbi index 29374e9..9c70c65 100644 --- a/sorbet/rbi/gems/actionview@7.0.4.rbi +++ b/sorbet/rbi/gems/actionview@8.1.2.rbi @@ -4,20 +4,41 @@ # This is an autogenerated file for types exported from the `actionview` gem. # Please instead update this file by running `bin/tapioca gem actionview`. + +class ActionController::Base < ::ActionController::Metal + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionController::Head + include ::AbstractController::Caching::ConfigMethods + include ::ActionController::BasicImplicitRender + extend ::AbstractController::Helpers::Resolution + extend ::ActionController::Renderers::DeprecatedEscapeJsonResponses +end + +# :include: ../README.rdoc +# # source://actionview//lib/action_view/gem_version.rb#3 module ActionView extend ::ActiveSupport::Autoload class << self - # source://actionview//lib/action_view.rb#90 + # source://actionview//lib/action_view/deprecator.rb#4 + def deprecator; end + + # source://actionview//lib/action_view.rb#97 def eager_load!; end - # Returns the currently loaded version of Action View as a Gem::Version. + # Returns the currently loaded version of Action View as a +Gem::Version+. # # source://actionview//lib/action_view/gem_version.rb#5 def gem_version; end - # Returns the currently loaded version of Action View as a Gem::Version. + # source://actionview//lib/action_view.rb#94 + def render_tracker; end + + # source://actionview//lib/action_view.rb#94 + def render_tracker=(_arg0); end + + # Returns the currently loaded version of Action View as a +Gem::Version+. # # source://actionview//lib/action_view/version.rb#7 def version; end @@ -48,10 +69,10 @@ class ActionView::AbstractRenderer def initialize(lookup_context); end # source://actionview//lib/action_view/renderer/abstract_renderer.rb#22 - def any_templates?(*_arg0, &_arg1); end + def any_templates?(*_arg0, **_arg1, &_arg2); end # source://actionview//lib/action_view/renderer/abstract_renderer.rb#22 - def formats(*_arg0, &_arg1); end + def formats(*_arg0, **_arg1, &_arg2); end # @raise [NotImplementedError] # @@ -59,7 +80,7 @@ class ActionView::AbstractRenderer def render; end # source://actionview//lib/action_view/renderer/abstract_renderer.rb#22 - def template_exists?(*_arg0, &_arg1); end + def template_exists?(*_arg0, **_arg1, &_arg2); end private @@ -189,10 +210,10 @@ ActionView::AbstractRenderer::RenderedTemplate::EMPTY_SPACER = T.let(T.unsafe(ni # = Action View Errors # -# source://actionview//lib/action_view/template/error.rb#7 +# source://actionview//lib/action_view/template/error.rb#8 class ActionView::ActionViewError < ::StandardError; end -# = Action View Base +# = Action View \Base # # Action View templates can be written in several ways. # If the template file has a .erb extension, then it uses the erubi[https://rubygems.org/gems/erubi] @@ -226,9 +247,9 @@ class ActionView::ActionViewError < ::StandardError; end # Using sub templates allows you to sidestep tedious replication and extract common display structures in shared templates. The # classic example is the use of a header and footer (even though the Action Pack-way would be to use Layouts): # -# <%= render "shared/header" %> +# <%= render "application/header" %> # Something really specific and terrific -# <%= render "shared/footer" %> +# <%= render "application/footer" %> # # As you see, we use the output embeddings for the render methods. The render call itself will just return a string holding the # result of the rendering. The output embedding writes it to the current template. @@ -237,7 +258,7 @@ class ActionView::ActionViewError < ::StandardError; end # variables defined using the regular embedding tags. Like this: # # <% @page_title = "A Wonderful Hello" %> -# <%= render "shared/header" %> +# <%= render "application/header" %> # # Now the header can pick up on the @page_title variable and use it for outputting a title tag: # @@ -247,9 +268,9 @@ class ActionView::ActionViewError < ::StandardError; end # # You can pass local variables to sub templates by using a hash with the variable names as keys and the objects as values: # -# <%= render "shared/header", { headline: "Welcome", person: person } %> +# <%= render "application/header", { headline: "Welcome", person: person } %> # -# These can now be accessed in shared/header with: +# These can now be accessed in application/header with: # # Headline: <%= headline %> # First name: <%= person.first_name %> @@ -262,10 +283,27 @@ class ActionView::ActionViewError < ::StandardError; end # This is useful in cases where you aren't sure if the local variable has been assigned. Alternatively, you could also use # defined? headline to first check if the variable has been assigned before using it. # +# By default, templates will accept any locals as keyword arguments. To restrict what locals a template accepts, add a locals: magic comment: +# +# <%# locals: (headline:) %> +# +# Headline: <%= headline %> +# +# In cases where the local variables are optional, declare the keyword argument with a default value: +# +# <%# locals: (headline: nil) %> +# +# <% unless headline.nil? %> +# Headline: <%= headline %> +# <% end %> +# +# Read more about strict locals in {Action View Overview}[https://guides.rubyonrails.org/action_view_overview.html#strict-locals] +# in the guides. +# # === Template caching # -# By default, Rails will compile each template to a method in order to render it. When you alter a template, -# Rails will check the file's modification time and recompile it in development mode. +# By default, \Rails will compile each template to a method in order to render it. When you alter a template, +# \Rails will check the file's modification time and recompile it in development mode. # # == Builder # @@ -318,24 +356,27 @@ class ActionView::ActionViewError < ::StandardError; end # end # end # -# For more information on Builder please consult the {source -# code}[https://github.com/jimweirich/builder]. +# For more information on Builder please consult the {source code}[https://github.com/rails/builder]. # -# source://actionview//lib/action_view/base.rb#141 +# source://actionview//lib/action_view/base.rb#158 class ActionView::Base include ::ActionView::Context + include ::ERB::Escape include ::ERB::Util - include ::ActionView::Helpers::CaptureHelper - include ::ActionView::Helpers::OutputSafetyHelper - include ::ActionView::Helpers::TagHelper - include ::ActionView::Helpers::UrlHelper + include ::ActiveSupport::CoreExt::ERBUtil + include ::ActiveSupport::CoreExt::ERBUtilPrivate include ::ActiveSupport::Benchmarkable include ::ActionView::Helpers::ActiveModelHelper include ::ActionView::Helpers::AssetUrlHelper - include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper include ::ActionView::Helpers::AssetTagHelper include ::ActionView::Helpers::AtomFeedHelper include ::ActionView::Helpers::CacheHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper include ::ActionView::Helpers::ControllerHelper include ::ActionView::Helpers::CspHelper include ::ActionView::Helpers::CsrfHelper @@ -359,270 +400,297 @@ class ActionView::Base # # @return [Base] a new instance of Base # - # source://actionview//lib/action_view/base.rb#227 + # source://actionview//lib/action_view/base.rb#249 def initialize(lookup_context, assigns, controller); end - # source://actionview//lib/action_view/base.rb#165 + # source://actionview//lib/action_view/base.rb#182 def _routes; end - # source://actionview//lib/action_view/base.rb#165 + # source://actionview//lib/action_view/base.rb#182 def _routes=(_arg0); end - # source://actionview//lib/action_view/base.rb#165 + # source://actionview//lib/action_view/base.rb#182 def _routes?; end - # source://actionview//lib/action_view/base.rb#240 - def _run(method, template, locals, buffer, add_to_stack: T.unsafe(nil), &block); end + # source://actionview//lib/action_view/base.rb#264 + def _run(method, template, locals, buffer, add_to_stack: T.unsafe(nil), has_strict_locals: T.unsafe(nil), &block); end - # source://actionview//lib/action_view/base.rb#163 + # source://actionview//lib/action_view/base.rb#180 def annotate_rendered_view_with_filenames; end - # source://actionview//lib/action_view/base.rb#163 + # source://actionview//lib/action_view/base.rb#180 def annotate_rendered_view_with_filenames=(val); end - # source://actionview//lib/action_view/base.rb#207 + # source://actionview//lib/action_view/base.rb#228 def assign(new_assigns); end - # source://activesupport/7.0.4/lib/active_support/core_ext/module/attr_internal.rb#33 + # source://actionview//lib/action_view/base.rb#224 def assigns; end - # source://activesupport/7.0.4/lib/active_support/core_ext/module/attr_internal.rb#33 + # source://actionview//lib/action_view/base.rb#224 def assigns=(_arg0); end - # source://actionview//lib/action_view/base.rb#160 + # source://actionview//lib/action_view/base.rb#177 def automatically_disable_submit_tag; end - # source://actionview//lib/action_view/base.rb#160 + # source://actionview//lib/action_view/base.rb#177 def automatically_disable_submit_tag=(val); end # @raise [NotImplementedError] # - # source://actionview//lib/action_view/base.rb#249 + # source://actionview//lib/action_view/base.rb#287 def compiled_method_container; end - # source://activesupport/7.0.4/lib/active_support/core_ext/module/attr_internal.rb#33 + # source://actionview//lib/action_view/base.rb#224 def config; end - # source://activesupport/7.0.4/lib/active_support/core_ext/module/attr_internal.rb#33 + # source://actionview//lib/action_view/base.rb#224 def config=(_arg0); end - # source://actionview//lib/action_view/helpers/translation_helper.rb#18 + # source://actionview//lib/action_view/base.rb#159 def debug_missing_translation; end - # source://actionview//lib/action_view/helpers/translation_helper.rb#18 + # source://actionview//lib/action_view/base.rb#159 def debug_missing_translation=(val); end - # source://actionview//lib/action_view/base.rb#157 + # source://actionview//lib/action_view/base.rb#174 def default_formats; end - # source://actionview//lib/action_view/base.rb#157 + # source://actionview//lib/action_view/base.rb#174 def default_formats=(val); end - # source://actionview//lib/action_view/base.rb#145 + # source://actionview//lib/action_view/base.rb#162 def field_error_proc; end - # source://actionview//lib/action_view/base.rb#145 + # source://actionview//lib/action_view/base.rb#162 def field_error_proc=(val); end - # source://actionview//lib/action_view/base.rb#205 - def formats(*_arg0, &_arg1); end + # source://actionview//lib/action_view/base.rb#226 + def formats(*_arg0, **_arg1, &_arg2); end - # source://actionview//lib/action_view/base.rb#205 + # source://actionview//lib/action_view/base.rb#226 def formats=(arg); end - # source://actionview//lib/action_view/base.rb#257 + # source://actionview//lib/action_view/base.rb#295 def in_rendering_context(options); end - # source://actionview//lib/action_view/base.rb#205 - def locale(*_arg0, &_arg1); end + # source://actionview//lib/action_view/base.rb#226 + def locale(*_arg0, **_arg1, &_arg2); end - # source://actionview//lib/action_view/base.rb#205 + # source://actionview//lib/action_view/base.rb#226 def locale=(arg); end - # source://actionview//lib/action_view/base.rb#166 + # source://actionview//lib/action_view/base.rb#183 def logger; end - # source://actionview//lib/action_view/base.rb#166 + # source://actionview//lib/action_view/base.rb#183 def logger=(_arg0); end - # source://actionview//lib/action_view/base.rb#166 + # source://actionview//lib/action_view/base.rb#183 def logger?; end # Returns the value of attribute lookup_context. # - # source://actionview//lib/action_view/base.rb#202 + # source://actionview//lib/action_view/base.rb#223 def lookup_context; end - # source://actionview//lib/action_view/base.rb#154 + # source://actionview//lib/action_view/base.rb#171 def prefix_partial_path_with_controller_namespace; end - # source://actionview//lib/action_view/base.rb#154 + # source://actionview//lib/action_view/base.rb#171 def prefix_partial_path_with_controller_namespace=(_arg0); end - # source://actionview//lib/action_view/base.rb#154 + # source://actionview//lib/action_view/base.rb#171 def prefix_partial_path_with_controller_namespace?; end - # source://actionview//lib/action_view/base.rb#149 + # source://actionview//lib/action_view/base.rb#187 + def remove_hidden_field_autocomplete; end + + # source://actionview//lib/action_view/base.rb#187 + def remove_hidden_field_autocomplete=(val); end + + # source://actionview//lib/action_view/base.rb#166 def streaming_completion_on_exception; end - # source://actionview//lib/action_view/base.rb#149 + # source://actionview//lib/action_view/base.rb#166 def streaming_completion_on_exception=(val); end - # source://actionview//lib/action_view/base.rb#205 - def view_paths(*_arg0, &_arg1); end + # source://actionview//lib/action_view/base.rb#226 + def view_paths(*_arg0, **_arg1, &_arg2); end - # source://actionview//lib/action_view/base.rb#205 + # source://actionview//lib/action_view/base.rb#226 def view_paths=(arg); end # Returns the value of attribute view_renderer. # - # source://actionview//lib/action_view/base.rb#202 + # source://actionview//lib/action_view/base.rb#223 def view_renderer; end class << self - # source://actionview//lib/action_view/base.rb#165 + # source://actionview//lib/action_view/base.rb#182 def _routes; end - # source://actionview//lib/action_view/base.rb#165 + # source://actionview//lib/action_view/base.rb#182 def _routes=(value); end - # source://actionview//lib/action_view/base.rb#165 + # source://actionview//lib/action_view/base.rb#182 def _routes?; end - # source://actionview//lib/action_view/base.rb#163 + # source://actionview//lib/action_view/base.rb#180 def annotate_rendered_view_with_filenames; end - # source://actionview//lib/action_view/base.rb#163 + # source://actionview//lib/action_view/base.rb#180 def annotate_rendered_view_with_filenames=(val); end - # source://actionview//lib/action_view/base.rb#160 + # source://actionview//lib/action_view/base.rb#177 def automatically_disable_submit_tag; end - # source://actionview//lib/action_view/base.rb#160 + # source://actionview//lib/action_view/base.rb#177 def automatically_disable_submit_tag=(val); end - # source://actionview//lib/action_view/base.rb#171 + # source://actionview//lib/action_view/base.rb#192 def cache_template_loading; end - # source://actionview//lib/action_view/base.rb#175 + # source://actionview//lib/action_view/base.rb#196 def cache_template_loading=(value); end # @return [Boolean] # - # source://actionview//lib/action_view/base.rb#197 + # source://actionview//lib/action_view/base.rb#218 def changed?(other); end - # source://actionview//lib/action_view/helpers/translation_helper.rb#18 + # source://actionview//lib/action_view/base.rb#159 def debug_missing_translation; end - # source://actionview//lib/action_view/helpers/translation_helper.rb#18 + # source://actionview//lib/action_view/base.rb#159 def debug_missing_translation=(val); end - # source://actionview//lib/action_view/helpers/form_helper.rb#2729 + # source://actionview//lib/action_view/base.rb#314 def default_form_builder; end - # source://actionview//lib/action_view/helpers/form_helper.rb#2729 + # source://actionview//lib/action_view/base.rb#314 def default_form_builder=(val); end - # source://actionview//lib/action_view/base.rb#157 + # source://actionview//lib/action_view/base.rb#174 def default_formats; end - # source://actionview//lib/action_view/base.rb#157 + # source://actionview//lib/action_view/base.rb#174 def default_formats=(val); end # :stopdoc: # - # source://actionview//lib/action_view/base.rb#213 + # source://actionview//lib/action_view/base.rb#235 def empty; end - # source://actionview//lib/action_view/base.rb#169 + # source://actionview//lib/action_view/base.rb#190 def erb_trim_mode=(arg); end - # source://actionview//lib/action_view/base.rb#145 + # source://actionview//lib/action_view/base.rb#162 def field_error_proc; end - # source://actionview//lib/action_view/base.rb#145 + # source://actionview//lib/action_view/base.rb#162 def field_error_proc=(val); end - # source://actionview//lib/action_view/base.rb#166 + # source://actionview//lib/action_view/base.rb#183 def logger; end - # source://actionview//lib/action_view/base.rb#166 + # source://actionview//lib/action_view/base.rb#183 def logger=(value); end - # source://actionview//lib/action_view/base.rb#166 + # source://actionview//lib/action_view/base.rb#183 def logger?; end - # source://actionview//lib/action_view/base.rb#154 + # source://actionview//lib/action_view/base.rb#171 def prefix_partial_path_with_controller_namespace; end - # source://actionview//lib/action_view/base.rb#154 + # source://actionview//lib/action_view/base.rb#171 def prefix_partial_path_with_controller_namespace=(value); end - # source://actionview//lib/action_view/base.rb#154 + # source://actionview//lib/action_view/base.rb#171 def prefix_partial_path_with_controller_namespace?; end - # source://actionview//lib/action_view/base.rb#149 + # source://actionview//lib/action_view/base.rb#187 + def remove_hidden_field_autocomplete; end + + # source://actionview//lib/action_view/base.rb#187 + def remove_hidden_field_autocomplete=(val); end + + # source://actionview//lib/action_view/base.rb#166 def streaming_completion_on_exception; end - # source://actionview//lib/action_view/base.rb#149 + # source://actionview//lib/action_view/base.rb#166 def streaming_completion_on_exception=(val); end - # source://actionview//lib/action_view/base.rb#221 + # source://actionview//lib/action_view/base.rb#243 def with_context(context, assigns = T.unsafe(nil), controller = T.unsafe(nil)); end - # source://actionview//lib/action_view/base.rb#183 + # source://actionview//lib/action_view/base.rb#204 def with_empty_template_cache; end - # source://actionview//lib/action_view/base.rb#217 + # source://actionview//lib/action_view/base.rb#239 def with_view_paths(view_paths, assigns = T.unsafe(nil), controller = T.unsafe(nil)); end # @return [Boolean] # - # source://actionview//lib/action_view/base.rb#179 + # source://actionview//lib/action_view/base.rb#200 def xss_safe?; end - end -end -# source://actionview//lib/action_view/cache_expiry.rb#4 -class ActionView::CacheExpiry; end + private -# source://actionview//lib/action_view/cache_expiry.rb#5 -class ActionView::CacheExpiry::Executor - # @return [Executor] a new instance of Executor - # - # source://actionview//lib/action_view/cache_expiry.rb#6 - def initialize(watcher:); end + # source://actionview//lib/action_view/base.rb#182 + def __class_attr__routes; end - # source://actionview//lib/action_view/cache_expiry.rb#20 - def complete(_); end + # source://actionview//lib/action_view/base.rb#182 + def __class_attr__routes=(new_value); end - # source://actionview//lib/action_view/cache_expiry.rb#13 - def run; end + # source://actionview//lib/action_view/base.rb#183 + def __class_attr_logger; end - private + # source://actionview//lib/action_view/base.rb#183 + def __class_attr_logger=(new_value); end - # source://actionview//lib/action_view/cache_expiry.rb#25 - def clear_cache; end + # source://actionview//lib/action_view/base.rb#171 + def __class_attr_prefix_partial_path_with_controller_namespace; end + + # source://actionview//lib/action_view/base.rb#171 + def __class_attr_prefix_partial_path_with_controller_namespace=(new_value); end + end end -# source://actionview//lib/action_view/cache_expiry.rb#32 -class ActionView::CacheExpiry::ViewModificationWatcher - # @return [ViewModificationWatcher] a new instance of ViewModificationWatcher +# source://actionview//lib/action_view/cache_expiry.rb#4 +module ActionView::CacheExpiry; end + +# source://actionview//lib/action_view/cache_expiry.rb#5 +class ActionView::CacheExpiry::ViewReloader + # @return [ViewReloader] a new instance of ViewReloader # - # source://actionview//lib/action_view/cache_expiry.rb#33 + # source://actionview//lib/action_view/cache_expiry.rb#6 def initialize(watcher:, &block); end - # source://actionview//lib/action_view/cache_expiry.rb#41 - def execute_if_updated; end + # source://actionview//lib/action_view/cache_expiry.rb#21 + def execute; end + + # @return [Boolean] + # + # source://actionview//lib/action_view/cache_expiry.rb#16 + def updated?; end private - # source://actionview//lib/action_view/cache_expiry.rb#61 + # source://actionview//lib/action_view/cache_expiry.rb#64 def all_view_paths; end - # source://actionview//lib/action_view/cache_expiry.rb#57 + # source://actionview//lib/action_view/cache_expiry.rb#37 + def build_watcher; end + + # source://actionview//lib/action_view/cache_expiry.rb#60 def dirs_to_watch; end + + # source://actionview//lib/action_view/cache_expiry.rb#55 + def rebuild_watcher; end + + # source://actionview//lib/action_view/cache_expiry.rb#33 + def reload!; end end # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#6 @@ -642,7 +710,7 @@ module ActionView::CollectionCaching # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#58 def collection_by_cache_keys(view, template, collection); end - # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#70 + # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#71 def expanded_cache_key(key, view, template, digest_path); end # `order_by` is an enumerable object containing keys of the cache, @@ -661,7 +729,7 @@ module ActionView::CollectionCaching # If the partial is not already cached it will also be # written back to the underlying cache store. # - # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#90 + # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#91 def fetch_or_cache_partial(cached_partials, template, order_by:); end # @return [Boolean] @@ -674,21 +742,21 @@ end class ActionView::CollectionRenderer < ::ActionView::PartialRenderer include ::ActionView::AbstractRenderer::ObjectRendering - # source://actionview//lib/action_view/renderer/collection_renderer.rb#122 + # source://actionview//lib/action_view/renderer/collection_renderer.rb#130 def render_collection_derive_partial(collection, context, block); end - # source://actionview//lib/action_view/renderer/collection_renderer.rb#104 + # source://actionview//lib/action_view/renderer/collection_renderer.rb#112 def render_collection_with_partial(collection, partial, context, block); end private - # source://actionview//lib/action_view/renderer/collection_renderer.rb#174 + # source://actionview//lib/action_view/renderer/collection_renderer.rb#182 def collection_with_template(view, template, layout, collection); end - # source://actionview//lib/action_view/renderer/collection_renderer.rb#145 + # source://actionview//lib/action_view/renderer/collection_renderer.rb#153 def render_collection(collection, view, path, template, layout, block); end - # source://actionview//lib/action_view/renderer/collection_renderer.rb#140 + # source://actionview//lib/action_view/renderer/collection_renderer.rb#148 def retrieve_variable(path); end end @@ -707,46 +775,52 @@ class ActionView::CollectionRenderer::CollectionIterator # source://actionview//lib/action_view/renderer/collection_renderer.rb#51 def length; end + # source://actionview//lib/action_view/renderer/collection_renderer.rb#55 + def preload!; end + # source://actionview//lib/action_view/renderer/collection_renderer.rb#47 def size; end end -# source://actionview//lib/action_view/renderer/collection_renderer.rb#92 +# source://actionview//lib/action_view/renderer/collection_renderer.rb#100 class ActionView::CollectionRenderer::MixedCollectionIterator < ::ActionView::CollectionRenderer::CollectionIterator # @return [MixedCollectionIterator] a new instance of MixedCollectionIterator # - # source://actionview//lib/action_view/renderer/collection_renderer.rb#93 + # source://actionview//lib/action_view/renderer/collection_renderer.rb#101 def initialize(collection, paths); end - # source://actionview//lib/action_view/renderer/collection_renderer.rb#98 + # source://actionview//lib/action_view/renderer/collection_renderer.rb#106 def each_with_info; end end -# source://actionview//lib/action_view/renderer/collection_renderer.rb#74 +# source://actionview//lib/action_view/renderer/collection_renderer.rb#78 class ActionView::CollectionRenderer::PreloadCollectionIterator < ::ActionView::CollectionRenderer::SameCollectionIterator # @return [PreloadCollectionIterator] a new instance of PreloadCollectionIterator # - # source://actionview//lib/action_view/renderer/collection_renderer.rb#75 + # source://actionview//lib/action_view/renderer/collection_renderer.rb#79 def initialize(collection, path, variables, relation); end - # source://actionview//lib/action_view/renderer/collection_renderer.rb#85 + # source://actionview//lib/action_view/renderer/collection_renderer.rb#89 def each_with_info; end - # source://actionview//lib/action_view/renderer/collection_renderer.rb#81 + # source://actionview//lib/action_view/renderer/collection_renderer.rb#85 def from_collection(collection); end + + # source://actionview//lib/action_view/renderer/collection_renderer.rb#95 + def preload!; end end -# source://actionview//lib/action_view/renderer/collection_renderer.rb#56 +# source://actionview//lib/action_view/renderer/collection_renderer.rb#60 class ActionView::CollectionRenderer::SameCollectionIterator < ::ActionView::CollectionRenderer::CollectionIterator # @return [SameCollectionIterator] a new instance of SameCollectionIterator # - # source://actionview//lib/action_view/renderer/collection_renderer.rb#57 + # source://actionview//lib/action_view/renderer/collection_renderer.rb#61 def initialize(collection, path, variables); end - # source://actionview//lib/action_view/renderer/collection_renderer.rb#67 + # source://actionview//lib/action_view/renderer/collection_renderer.rb#71 def each_with_info; end - # source://actionview//lib/action_view/renderer/collection_renderer.rb#63 + # source://actionview//lib/action_view/renderer/collection_renderer.rb#67 def from_collection(collection); end end @@ -805,13 +879,13 @@ class ActionView::DependencyTracker extend ::ActiveSupport::Autoload class << self - # source://actionview//lib/action_view/dependency_tracker.rb#16 + # source://actionview//lib/action_view/dependency_tracker.rb#17 def find_dependencies(name, template, view_paths = T.unsafe(nil)); end - # source://actionview//lib/action_view/dependency_tracker.rb#23 + # source://actionview//lib/action_view/dependency_tracker.rb#24 def register_tracker(extension, tracker); end - # source://actionview//lib/action_view/dependency_tracker.rb#34 + # source://actionview//lib/action_view/dependency_tracker.rb#35 def remove_tracker(handler); end end end @@ -840,7 +914,7 @@ class ActionView::DependencyTracker::ERBTracker # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#88 def directory; end - # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#145 + # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#158 def explicit_dependencies; end # Returns the value of attribute name. @@ -851,9 +925,6 @@ class ActionView::DependencyTracker::ERBTracker # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#92 def render_dependencies; end - # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#133 - def resolve_directories(wildcard_dependencies); end - # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#84 def source; end @@ -920,55 +991,83 @@ ActionView::DependencyTracker::ERBTracker::STRING = T.let(T.unsafe(nil), Regexp) # source://actionview//lib/action_view/dependency_tracker/erb_tracker.rb#16 ActionView::DependencyTracker::ERBTracker::VARIABLE_OR_METHOD_CHAIN = T.let(T.unsafe(nil), Regexp) -# source://actionview//lib/action_view/dependency_tracker/ripper_tracker.rb#5 -class ActionView::DependencyTracker::RipperTracker - # @return [RipperTracker] a new instance of RipperTracker +# source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#5 +class ActionView::DependencyTracker::RubyTracker + # @return [RubyTracker] a new instance of RubyTracker # - # source://actionview//lib/action_view/dependency_tracker/ripper_tracker.rb#20 - def initialize(name, template, view_paths = T.unsafe(nil)); end + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#20 + def initialize(name, template, view_paths = T.unsafe(nil), parser_class: T.unsafe(nil)); end - # source://actionview//lib/action_view/dependency_tracker/ripper_tracker.rb#12 + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#12 def dependencies; end private - # source://actionview//lib/action_view/dependency_tracker/ripper_tracker.rb#38 + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#38 def explicit_dependencies; end # Returns the value of attribute name. # - # source://actionview//lib/action_view/dependency_tracker/ripper_tracker.rb#25 + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#26 def name; end - # source://actionview//lib/action_view/dependency_tracker/ripper_tracker.rb#27 + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#28 def render_dependencies; end - # source://actionview//lib/action_view/dependency_tracker/ripper_tracker.rb#46 - def resolve_directories(wildcard_dependencies); end - # Returns the value of attribute template. # - # source://actionview//lib/action_view/dependency_tracker/ripper_tracker.rb#25 + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#26 def template; end # Returns the value of attribute view_paths. # - # source://actionview//lib/action_view/dependency_tracker/ripper_tracker.rb#25 + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#26 def view_paths; end class << self - # source://actionview//lib/action_view/dependency_tracker/ripper_tracker.rb#8 + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#8 def call(name, template, view_paths = T.unsafe(nil)); end # @return [Boolean] # - # source://actionview//lib/action_view/dependency_tracker/ripper_tracker.rb#16 + # source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#16 def supports_view_paths?; end end end -# source://actionview//lib/action_view/dependency_tracker/ripper_tracker.rb#6 -ActionView::DependencyTracker::RipperTracker::EXPLICIT_DEPENDENCY = T.let(T.unsafe(nil), Regexp) +# source://actionview//lib/action_view/dependency_tracker/ruby_tracker.rb#6 +ActionView::DependencyTracker::RubyTracker::EXPLICIT_DEPENDENCY = T.let(T.unsafe(nil), Regexp) + +# source://actionview//lib/action_view/dependency_tracker/wildcard_resolver.rb#5 +class ActionView::DependencyTracker::WildcardResolver + # @return [WildcardResolver] a new instance of WildcardResolver + # + # source://actionview//lib/action_view/dependency_tracker/wildcard_resolver.rb#6 + def initialize(view_paths, dependencies); end + + # source://actionview//lib/action_view/dependency_tracker/wildcard_resolver.rb#13 + def resolve; end + + private + + # Returns the value of attribute explicit_dependencies. + # + # source://actionview//lib/action_view/dependency_tracker/wildcard_resolver.rb#20 + def explicit_dependencies; end + + # source://actionview//lib/action_view/dependency_tracker/wildcard_resolver.rb#22 + def resolved_wildcard_dependencies; end + + # Returns the value of attribute view_paths. + # + # source://actionview//lib/action_view/dependency_tracker/wildcard_resolver.rb#20 + def view_paths; end + + # Returns the value of attribute wildcard_dependencies. + # + # source://actionview//lib/action_view/dependency_tracker/wildcard_resolver.rb#20 + def wildcard_dependencies; end +end # source://actionview//lib/action_view/digestor.rb#6 class ActionView::Digestor @@ -977,7 +1076,7 @@ class ActionView::Digestor # # * name - Template name # * format - Template format - # * finder - An instance of ActionView::LookupContext + # * +finder+ - An instance of ActionView::LookupContext # * dependencies - An array of dependent views # # source://actionview//lib/action_view/digestor.rb#16 @@ -998,15 +1097,15 @@ class ActionView::Digestor end end -# source://actionview//lib/action_view/digestor.rb#121 +# source://actionview//lib/action_view/digestor.rb#125 class ActionView::Digestor::Injected < ::ActionView::Digestor::Node - # source://actionview//lib/action_view/digestor.rb#122 + # source://actionview//lib/action_view/digestor.rb#126 def digest(finder, _ = T.unsafe(nil)); end end -# source://actionview//lib/action_view/digestor.rb#117 +# source://actionview//lib/action_view/digestor.rb#121 class ActionView::Digestor::Missing < ::ActionView::Digestor::Node - # source://actionview//lib/action_view/digestor.rb#118 + # source://actionview//lib/action_view/digestor.rb#122 def digest(finder, _ = T.unsafe(nil)); end end @@ -1044,7 +1143,7 @@ class ActionView::Digestor::Node def template; end # source://actionview//lib/action_view/digestor.rb#110 - def to_dep_map; end + def to_dep_map(seen = T.unsafe(nil)); end class << self # source://actionview//lib/action_view/digestor.rb#81 @@ -1052,94 +1151,93 @@ class ActionView::Digestor::Node end end -# source://actionview//lib/action_view/digestor.rb#125 +# source://actionview//lib/action_view/digestor.rb#129 class ActionView::Digestor::NullLogger class << self - # source://actionview//lib/action_view/digestor.rb#126 + # source://actionview//lib/action_view/digestor.rb#130 def debug(_); end - # source://actionview//lib/action_view/digestor.rb#127 + # source://actionview//lib/action_view/digestor.rb#131 def error(_); end end end -# source://actionview//lib/action_view/digestor.rb#115 +# source://actionview//lib/action_view/digestor.rb#119 class ActionView::Digestor::Partial < ::ActionView::Digestor::Node; end -# source://actionview//lib/action_view.rb#33 +# source://actionview//lib/action_view.rb#35 ActionView::ENCODING_FLAG = T.let(T.unsafe(nil), String) -# source://actionview//lib/action_view/template/error.rb#10 +# source://actionview//lib/action_view/template/error.rb#11 class ActionView::EncodingError < ::StandardError; end # A resolver that loads files from the filesystem. # -# source://actionview//lib/action_view/template/resolver.rb#87 +# source://actionview//lib/action_view/template/resolver.rb#90 class ActionView::FileSystemResolver < ::ActionView::Resolver # @raise [ArgumentError] # @return [FileSystemResolver] a new instance of FileSystemResolver # - # source://actionview//lib/action_view/template/resolver.rb#90 + # source://actionview//lib/action_view/template/resolver.rb#93 def initialize(path); end # @return [Boolean] # - # source://actionview//lib/action_view/template/resolver.rb#109 + # source://actionview//lib/action_view/template/resolver.rb#115 def ==(resolver); end - # source://actionview//lib/action_view/template/resolver.rb#114 + # source://actionview//lib/action_view/template/resolver.rb#117 def all_template_paths; end - # source://actionview//lib/action_view/template/resolver.rb#98 + # source://actionview//lib/action_view/template/resolver.rb#126 + def built_templates; end + + # source://actionview//lib/action_view/template/resolver.rb#101 def clear_cache; end # @return [Boolean] # - # source://actionview//lib/action_view/template/resolver.rb#109 + # source://actionview//lib/action_view/template/resolver.rb#112 def eql?(resolver); end # Returns the value of attribute path. # - # source://actionview//lib/action_view/template/resolver.rb#88 + # source://actionview//lib/action_view/template/resolver.rb#91 def path; end - # source://actionview//lib/action_view/template/resolver.rb#104 + # source://actionview//lib/action_view/template/resolver.rb#110 def to_path; end - # source://actionview//lib/action_view/template/resolver.rb#104 + # source://actionview//lib/action_view/template/resolver.rb#107 def to_s; end private - # source://actionview//lib/action_view/template/resolver.rb#124 + # source://actionview//lib/action_view/template/resolver.rb#131 def _find_all(name, prefix, partial, details, key, locals); end - # source://actionview//lib/action_view/template/resolver.rb#143 + # source://actionview//lib/action_view/template/resolver.rb#150 def build_unbound_template(template); end - # source://actionview//lib/action_view/template/resolver.rb#201 + # source://actionview//lib/action_view/template/resolver.rb#208 def escape_entry(entry); end - # source://actionview//lib/action_view/template/resolver.rb#173 + # source://actionview//lib/action_view/template/resolver.rb#180 def filter_and_sort_by_details(templates, requested_details); end - # source://actionview//lib/action_view/template/resolver.rb#139 + # source://actionview//lib/action_view/template/resolver.rb#146 def source_for_template(template); end # Safe glob within @path # - # source://actionview//lib/action_view/template/resolver.rb#188 + # source://actionview//lib/action_view/template/resolver.rb#195 def template_glob(glob); end - # source://actionview//lib/action_view/template/resolver.rb#156 + # source://actionview//lib/action_view/template/resolver.rb#163 def unbound_templates_from_path(path); end end -# = Action View Debug Helper -# -# Provides a set of methods for making it easier to debug Rails objects. -# -# source://actionview//lib/action_view/helpers/capture_helper.rb#7 +# source://actionview//lib/action_view/helpers/capture_helper.rb#6 module ActionView::Helpers include ::ActiveSupport::Benchmarkable include ::ActionView::Helpers::ActiveModelHelper @@ -1151,6 +1249,7 @@ module ActionView::Helpers include ::ActionView::Helpers::AssetTagHelper include ::ActionView::Helpers::AtomFeedHelper include ::ActionView::Helpers::CacheHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper include ::ActionView::Helpers::ControllerHelper include ::ActionView::Helpers::CspHelper include ::ActionView::Helpers::CsrfHelper @@ -1174,14 +1273,16 @@ module ActionView::Helpers mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods class << self - # source://actionview//lib/action_view/helpers.rb#34 + # source://actionview//lib/action_view/helpers.rb#35 def eager_load!; end end end -# source://actionview//lib/action_view/helpers/active_model_helper.rb#9 +# source://actionview//lib/action_view/helpers/active_model_helper.rb#8 module ActionView::Helpers::ActiveModelHelper; end +# = Active \Model Instance Tag \Helpers +# # source://actionview//lib/action_view/helpers/active_model_helper.rb#12 module ActionView::Helpers::ActiveModelInstanceTag # source://actionview//lib/action_view/helpers/active_model_helper.rb#20 @@ -1217,6 +1318,8 @@ module ActionView::Helpers::ActiveModelInstanceTag def tag_generate_errors?(options); end end +# = Action View Asset Tag \Helpers +# # This module provides methods for generating HTML that links views to assets such # as images, JavaScripts, stylesheets, and feeds. These methods do not verify # the assets exist before linking to them: @@ -1226,24 +1329,24 @@ end # stylesheet_link_tag("application") # # => # -# source://actionview//lib/action_view/helpers/asset_tag_helper.rb#20 +# source://actionview//lib/action_view/helpers/asset_tag_helper.rb#21 module ActionView::Helpers::AssetTagHelper include ::ActionView::Helpers::AssetUrlHelper include ::ActionView::Helpers::CaptureHelper include ::ActionView::Helpers::OutputSafetyHelper include ::ActionView::Helpers::TagHelper - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#27 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#28 def apply_stylesheet_media_default; end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#27 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#28 def apply_stylesheet_media_default=(val); end # Returns an HTML audio tag for the +sources+. If +sources+ is a string, # a single audio tag will be returned. If +sources+ is an array, an audio # tag with nested source tags for each source will be returned. The - # +sources+ can be full paths or files that exist in your public audios - # directory. + # +sources+ can be full paths, files that exist in your public audios + # directory, or Active Storage attachments. # # When the last parameter is a hash you can add HTML attributes using that # parameter. @@ -1257,7 +1360,12 @@ module ActionView::Helpers::AssetTagHelper # audio_tag("sound.wav", "sound.mid") # # => # - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#486 + # Active Storage blobs (audios that are uploaded by the users of your app): + # + # audio_tag(user.name_pronunciation_audio) + # # => + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#612 def audio_tag(*sources); end # Returns a link tag that browsers and feed readers can use to auto-detect @@ -1288,9 +1396,21 @@ module ActionView::Helpers::AssetTagHelper # auto_discovery_link_tag(:rss, "http://www.example.com/feed.rss", {title: "Example RSS"}) # # => # - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#235 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#279 def auto_discovery_link_tag(type = T.unsafe(nil), url_options = T.unsafe(nil), tag_options = T.unsafe(nil)); end + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#29 + def auto_include_nonce_for_scripts; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#29 + def auto_include_nonce_for_scripts=(val); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#30 + def auto_include_nonce_for_styles; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#30 + def auto_include_nonce_for_styles=(val); end + # Returns a link tag for a favicon managed by the asset pipeline. # # If a page has no link like the one generated by this helper, browsers @@ -1319,19 +1439,19 @@ module ActionView::Helpers::AssetTagHelper # favicon_link_tag 'mb-icon.png', rel: 'apple-touch-icon', type: 'image/png' # # => # - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#276 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#320 def favicon_link_tag(source = T.unsafe(nil), options = T.unsafe(nil)); end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#25 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#26 def image_decoding; end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#25 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#26 def image_decoding=(val); end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#24 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#25 def image_loading; end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#24 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#25 def image_loading=(val); end # Returns an HTML image tag for the +source+. The +source+ can be a full @@ -1342,8 +1462,8 @@ module ActionView::Helpers::AssetTagHelper # You can add HTML attributes using the +options+. The +options+ supports # additional keys for convenience and conformance: # - # * :size - Supplied as "{Width}x{Height}" or "{Number}", so "30x45" becomes - # width="30" and height="45", and "50" becomes width="50" and height="50". + # * :size - Supplied as "#{width}x#{height}" or "#{number}", so "30x45" becomes + # width="30" height="45", and "50" becomes width="50" height="50". # :size will be ignored if the value is not in the correct format. # * :srcset - If supplied as a hash or array of [source, descriptor] # pairs, each image path will be expanded before the list is formatted as a string. @@ -1380,7 +1500,7 @@ module ActionView::Helpers::AssetTagHelper # image_tag(user.avatar.variant(resize_to_limit: [100, 100]), size: '100') # # => # - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#394 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#449 def image_tag(source, options = T.unsafe(nil)); end # Returns an HTML script tag for each of the +sources+ provided. @@ -1398,13 +1518,14 @@ module ActionView::Helpers::AssetTagHelper # When the Asset Pipeline is enabled, you can pass the name of your manifest as # source, and include other JavaScript or CoffeeScript files inside the manifest. # - # If the server supports Early Hints header links for these assets will be - # automatically pushed. + # If the server supports HTTP Early Hints, and the +defer+ option is not + # enabled, \Rails will push a 103 Early Hints response that links + # to the assets. # # ==== Options # # When the last parameter is a hash you can add HTML attributes using that - # parameter. The following options are supported: + # parameter. This includes but is not limited to the following options: # # * :extname - Append an extension to the generated URL unless the extension # already exists. This only applies for relative URLs. @@ -1416,6 +1537,22 @@ module ActionView::Helpers::AssetTagHelper # when it is set to true. # * :nonce - When set to true, adds an automatic nonce value if # you have Content Security Policy enabled. + # * :async - When set to +true+, adds the +async+ HTML + # attribute, allowing the script to be fetched in parallel to be parsed + # and evaluated as soon as possible. + # * :defer - When set to +true+, adds the +defer+ HTML + # attribute, which indicates to the browser that the script is meant to + # be executed after the document has been parsed. Additionally, prevents + # sending the Preload Links header. + # * :nopush - Specify if the use of server push is not desired + # for the script. Defaults to +true+. + # + # Any other specified options will be treated as HTML attributes for the + # +script+ tag. + # + # For more information regarding how the :async and :defer + # options affect the # - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#89 + # javascript_include_tag "http://www.example.com/xmlhr.js", async: true + # # => + # + # javascript_include_tag "http://www.example.com/xmlhr.js", defer: true + # # => + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#115 def javascript_include_tag(*sources); end + # Returns an HTML picture tag for the +sources+. If +sources+ is a string, + # a single picture tag will be returned. If +sources+ is an array, a picture + # tag with nested source tags for each source will be returned. The + # +sources+ can be full paths, files that exist in your public images + # directory, or Active Storage attachments. Since the picture tag requires + # an img tag, the last element you provide will be used for the img tag. + # For complete control over the picture tag, a block can be passed, which + # will populate the contents of the tag accordingly. + # + # ==== Options + # + # When the last parameter is a hash you can add HTML attributes using that + # parameter. Apart from all the HTML supported options, the following are supported: + # + # * :image - Hash of options that are passed directly to the +image_tag+ helper. + # + # ==== Examples + # + # picture_tag("picture.webp") + # # => + # picture_tag("gold.png", :image => { :size => "20" }) + # # => + # picture_tag("gold.png", :image => { :size => "45x70" }) + # # => + # picture_tag("picture.webp", "picture.png") + # # => + # picture_tag("picture.webp", "picture.png", :image => { alt: "Image" }) + # # => Image + # picture_tag(["picture.webp", "picture.png"], :image => { alt: "Image" }) + # # => Image + # picture_tag(:class => "my-class") { tag(:source, :srcset => image_path("picture.webp")) + image_tag("picture.png", :alt => "Image") } + # # => Image + # picture_tag { tag(:source, :srcset => image_path("picture-small.webp"), :media => "(min-width: 600px)") + tag(:source, :srcset => image_path("picture-big.webp")) + image_tag("picture.png", :alt => "Image") } + # # => Image + # + # Active Storage blobs (images that are uploaded by the users of your app): + # + # picture_tag(user.profile_picture) + # # => + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#510 + def picture_tag(*sources, &block); end + # Returns a link tag that browsers can use to preload the +source+. # The +source+ can be the path of a resource managed by asset pipeline, # a full path, or an URI. @@ -1482,13 +1668,13 @@ module ActionView::Helpers::AssetTagHelper # preload_link_tag("/media/audio.ogg", nopush: true) # # => # - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#319 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#363 def preload_link_tag(source, options = T.unsafe(nil)); end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#26 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#27 def preload_links_header; end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#26 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#27 def preload_links_header=(val); end # Returns a stylesheet link tag for the sources specified as arguments. @@ -1499,8 +1685,8 @@ module ActionView::Helpers::AssetTagHelper # set extname: false in the options. # You can modify the link attributes by passing a hash as the last argument. # - # If the server supports Early Hints header links for these assets will be - # automatically pushed. + # If the server supports HTTP Early Hints, \Rails will push a 103 Early + # Hints response that links to the assets. # # ==== Options # @@ -1512,6 +1698,10 @@ module ActionView::Helpers::AssetTagHelper # that path. # * :skip_pipeline - This option is used to bypass the asset pipeline # when it is set to true. + # * :nonce - When set to true, adds an automatic nonce value if + # you have Content Security Policy enabled. + # * :nopush - Specify if the use of server push is not desired + # for the stylesheet. Defaults to +true+. # # ==== Examples # @@ -1537,14 +1727,17 @@ module ActionView::Helpers::AssetTagHelper # # => # # # - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#170 + # stylesheet_link_tag "style", nonce: true + # # => + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#207 def stylesheet_link_tag(*sources); end # Returns an HTML video tag for the +sources+. If +sources+ is a string, # a single video tag will be returned. If +sources+ is an array, a video # tag with nested source tags for each source will be returned. The - # +sources+ can be full paths or files that exist in your public videos - # directory. + # +sources+ can be full paths, files that exist in your public videos + # directory, or Active Storage attachments. # # ==== Options # @@ -1553,8 +1746,8 @@ module ActionView::Helpers::AssetTagHelper # # * :poster - Set an image (like a screenshot) to be shown # before the video loads. The path is calculated like the +src+ of +image_tag+. - # * :size - Supplied as "{Width}x{Height}" or "{Number}", so "30x45" becomes - # width="30" and height="45", and "50" becomes width="50" and height="50". + # * :size - Supplied as "#{width}x#{height}" or "#{number}", so "30x45" becomes + # width="30" height="45", and "50" becomes width="50" height="50". # :size will be ignored if the value is not in the correct format. # * :poster_skip_pipeline will bypass the asset pipeline when using # the :poster option instead using an asset in the public folder. @@ -1584,63 +1777,83 @@ module ActionView::Helpers::AssetTagHelper # video_tag(["trailer.ogg", "trailer.flv"], size: "160x120") # # => # - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#459 + # Active Storage blobs (videos that are uploaded by the users of your app): + # + # video_tag(user.intro_video) + # # => + # + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#580 def video_tag(*sources); end private - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#527 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#653 def check_for_image_tag_errors(options); end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#518 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#644 def extract_dimensions(size); end # @yield [options] # - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#491 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#617 def multiple_sources_tag_builder(type, sources); end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#508 - def resolve_image_source(source, skip_pipeline); end + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#634 + def resolve_asset_source(asset_type, source, skip_pipeline); end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#533 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#659 def resolve_link_as(extname, mime_type); end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#544 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#673 def send_preload_links_header(preload_links, max_header_size: T.unsafe(nil)); end class << self - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#27 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#28 def apply_stylesheet_media_default; end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#27 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#28 def apply_stylesheet_media_default=(val); end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#25 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#29 + def auto_include_nonce_for_scripts; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#29 + def auto_include_nonce_for_scripts=(val); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#30 + def auto_include_nonce_for_styles; end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#30 + def auto_include_nonce_for_styles=(val); end + + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#26 def image_decoding; end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#25 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#26 def image_decoding=(val); end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#24 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#25 def image_loading; end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#24 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#25 def image_loading=(val); end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#26 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#27 def preload_links_header; end - # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#26 + # source://actionview//lib/action_view/helpers/asset_tag_helper.rb#27 def preload_links_header=(val); end end end -# Some HTTP client and proxies have a 8kiB header limit +# Some HTTP client and proxies have a 4kiB header limit, but more importantly +# including preload links has diminishing returns so it's best to not go overboard # -# source://actionview//lib/action_view/helpers/asset_tag_helper.rb#543 +# source://actionview//lib/action_view/helpers/asset_tag_helper.rb#671 ActionView::Helpers::AssetTagHelper::MAX_HEADER_SIZE = T.let(T.unsafe(nil), Integer) +# = Action View Asset URL \Helpers +# # This module provides methods for generating asset paths and # URLs. # @@ -1652,8 +1865,8 @@ ActionView::Helpers::AssetTagHelper::MAX_HEADER_SIZE = T.let(T.unsafe(nil), Inte # # === Using asset hosts # -# By default, Rails links to these assets on the current host in the public -# folder, but you can direct Rails to link to assets from a dedicated asset +# By default, \Rails links to these assets on the current host in the public +# folder, but you can direct \Rails to link to assets from a dedicated asset # server by setting ActionController::Base.asset_host in the application # configuration, typically in config/environments/production.rb. # For example, you'd define assets.example.com to be your asset @@ -1753,7 +1966,7 @@ ActionView::Helpers::AssetTagHelper::MAX_HEADER_SIZE = T.let(T.unsafe(nil), Inte # "http://asset%d.example.com", "https://asset1.example.com" # ) # -# source://actionview//lib/action_view/helpers/asset_url_helper.rb#120 +# source://actionview//lib/action_view/helpers/asset_url_helper.rb#121 module ActionView::Helpers::AssetUrlHelper # This is the entry point for all assets. # When using an asset pipeline gem (e.g. propshaft or sprockets-rails), the @@ -1821,7 +2034,7 @@ module ActionView::Helpers::AssetUrlHelper # # @raise [ArgumentError] # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#186 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#187 def asset_path(source, options = T.unsafe(nil)); end # Computes the full URL to an asset in the public directory. This @@ -1834,7 +2047,7 @@ module ActionView::Helpers::AssetUrlHelper # asset_url "application.js" # => http://example.com/assets/application.js # asset_url "application.js", host: "http://cdn.example.com" # => http://cdn.example.com/assets/application.js # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#230 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#231 def asset_url(source, options = T.unsafe(nil)); end # Computes the path to an audio asset in the public audios directory. @@ -1847,7 +2060,7 @@ module ActionView::Helpers::AssetUrlHelper # audio_path("/sounds/horse.wav") # => /sounds/horse.wav # audio_path("http://www.example.com/sounds/horse.wav") # => http://www.example.com/sounds/horse.wav # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#429 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#430 def audio_path(source, options = T.unsafe(nil)); end # Computes the full URL to an audio asset in the public audios directory. @@ -1857,13 +2070,13 @@ module ActionView::Helpers::AssetUrlHelper # # audio_url "horse.wav", host: "http://stage.example.com" # => http://stage.example.com/audios/horse.wav # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#441 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#442 def audio_url(source, options = T.unsafe(nil)); end # Compute extname to append to asset path. Returns +nil+ if # nothing should be added. # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#242 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#243 def compute_asset_extname(source, options = T.unsafe(nil)); end # Pick an asset host for this source. Returns +nil+ if no host is set, @@ -1872,14 +2085,14 @@ module ActionView::Helpers::AssetUrlHelper # or the value returned from invoking call on an object responding to call # (proc or otherwise). # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#276 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#277 def compute_asset_host(source = T.unsafe(nil), options = T.unsafe(nil)); end # Computes asset path to public directory. Plugins and # extensions can override this method to point to custom assets # or generate digested paths or query strings. # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#265 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#266 def compute_asset_path(source, options = T.unsafe(nil)); end # Computes the path to a font asset. @@ -1891,7 +2104,7 @@ module ActionView::Helpers::AssetUrlHelper # font_path("/dir/font.ttf") # => /dir/font.ttf # font_path("http://www.example.com/dir/font.ttf") # => http://www.example.com/dir/font.ttf # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#454 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#455 def font_path(source, options = T.unsafe(nil)); end # Computes the full URL to a font asset. @@ -1901,7 +2114,7 @@ module ActionView::Helpers::AssetUrlHelper # # font_url "font.ttf", host: "http://stage.example.com" # => http://stage.example.com/fonts/font.ttf # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#466 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#467 def font_url(source, options = T.unsafe(nil)); end # Computes the path to an image asset. @@ -1915,10 +2128,10 @@ module ActionView::Helpers::AssetUrlHelper # image_path("http://www.example.com/img/edit.png") # => "http://www.example.com/img/edit.png" # # If you have images as application resources this method may conflict with their named routes. - # The alias +path_to_image+ is provided to avoid that. Rails uses the alias internally, and + # The alias +path_to_image+ is provided to avoid that. \Rails uses the alias internally, and # plugin authors are encouraged to do so. # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#377 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#378 def image_path(source, options = T.unsafe(nil)); end # Computes the full URL to an image asset. @@ -1928,7 +2141,7 @@ module ActionView::Helpers::AssetUrlHelper # # image_url "edit.png", host: "http://stage.example.com" # => http://stage.example.com/assets/edit.png # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#389 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#390 def image_url(source, options = T.unsafe(nil)); end # Computes the path to a JavaScript asset in the public javascripts directory. @@ -1942,7 +2155,7 @@ module ActionView::Helpers::AssetUrlHelper # javascript_path "http://www.example.com/js/xmlhr" # => http://www.example.com/js/xmlhr # javascript_path "http://www.example.com/js/xmlhr.js" # => http://www.example.com/js/xmlhr.js # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#320 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#321 def javascript_path(source, options = T.unsafe(nil)); end # Computes the full URL to a JavaScript asset in the public javascripts directory. @@ -1952,7 +2165,7 @@ module ActionView::Helpers::AssetUrlHelper # # javascript_url "js/xmlhr.js", host: "http://stage.example.com" # => http://stage.example.com/assets/js/xmlhr.js # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#332 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#333 def javascript_url(source, options = T.unsafe(nil)); end # This is the entry point for all assets. @@ -2022,7 +2235,7 @@ module ActionView::Helpers::AssetUrlHelper # # @raise [ArgumentError] # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#186 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#219 def path_to_asset(source, options = T.unsafe(nil)); end # Computes the path to an audio asset in the public audios directory. @@ -2036,7 +2249,7 @@ module ActionView::Helpers::AssetUrlHelper # audio_path("http://www.example.com/sounds/horse.wav") # => http://www.example.com/sounds/horse.wav # aliased to avoid conflicts with an audio_path named route # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#429 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#433 def path_to_audio(source, options = T.unsafe(nil)); end # Computes the path to a font asset. @@ -2049,7 +2262,7 @@ module ActionView::Helpers::AssetUrlHelper # font_path("http://www.example.com/dir/font.ttf") # => http://www.example.com/dir/font.ttf # aliased to avoid conflicts with a font_path named route # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#454 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#458 def path_to_font(source, options = T.unsafe(nil)); end # Computes the path to an image asset. @@ -2063,11 +2276,11 @@ module ActionView::Helpers::AssetUrlHelper # image_path("http://www.example.com/img/edit.png") # => "http://www.example.com/img/edit.png" # # If you have images as application resources this method may conflict with their named routes. - # The alias +path_to_image+ is provided to avoid that. Rails uses the alias internally, and + # The alias +path_to_image+ is provided to avoid that. \Rails uses the alias internally, and # plugin authors are encouraged to do so. # aliased to avoid conflicts with an image_path named route # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#377 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#381 def path_to_image(source, options = T.unsafe(nil)); end # Computes the path to a JavaScript asset in the public javascripts directory. @@ -2082,7 +2295,7 @@ module ActionView::Helpers::AssetUrlHelper # javascript_path "http://www.example.com/js/xmlhr.js" # => http://www.example.com/js/xmlhr.js # aliased to avoid conflicts with a javascript_path named route # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#320 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#324 def path_to_javascript(source, options = T.unsafe(nil)); end # Computes the path to a stylesheet asset in the public stylesheets directory. @@ -2097,7 +2310,7 @@ module ActionView::Helpers::AssetUrlHelper # stylesheet_path "http://www.example.com/css/style.css" # => http://www.example.com/css/style.css # aliased to avoid conflicts with a stylesheet_path named route # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#347 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#351 def path_to_stylesheet(source, options = T.unsafe(nil)); end # Computes the path to a video asset in the public videos directory. @@ -2111,14 +2324,14 @@ module ActionView::Helpers::AssetUrlHelper # video_path("http://www.example.com/vid/hd.avi") # => http://www.example.com/vid/hd.avi # aliased to avoid conflicts with a video_path named route # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#403 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#407 def path_to_video(source, options = T.unsafe(nil)); end # Computes asset path to public directory. Plugins and # extensions can override this method to point to custom assets # or generate digested paths or query strings. # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#265 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#270 def public_compute_asset_path(source, options = T.unsafe(nil)); end # Computes the path to a stylesheet asset in the public stylesheets directory. @@ -2132,7 +2345,7 @@ module ActionView::Helpers::AssetUrlHelper # stylesheet_path "http://www.example.com/css/style" # => http://www.example.com/css/style # stylesheet_path "http://www.example.com/css/style.css" # => http://www.example.com/css/style.css # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#347 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#348 def stylesheet_path(source, options = T.unsafe(nil)); end # Computes the full URL to a stylesheet asset in the public stylesheets directory. @@ -2142,7 +2355,7 @@ module ActionView::Helpers::AssetUrlHelper # # stylesheet_url "css/style.css", host: "http://stage.example.com" # => http://stage.example.com/assets/css/style.css # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#359 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#360 def stylesheet_url(source, options = T.unsafe(nil)); end # Computes the full URL to an asset in the public directory. This @@ -2156,7 +2369,7 @@ module ActionView::Helpers::AssetUrlHelper # asset_url "application.js", host: "http://cdn.example.com" # => http://cdn.example.com/assets/application.js # aliased to avoid conflicts with an asset_url named route # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#230 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#234 def url_to_asset(source, options = T.unsafe(nil)); end # Computes the full URL to an audio asset in the public audios directory. @@ -2167,7 +2380,7 @@ module ActionView::Helpers::AssetUrlHelper # audio_url "horse.wav", host: "http://stage.example.com" # => http://stage.example.com/audios/horse.wav # aliased to avoid conflicts with an audio_url named route # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#441 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#445 def url_to_audio(source, options = T.unsafe(nil)); end # Computes the full URL to a font asset. @@ -2178,7 +2391,7 @@ module ActionView::Helpers::AssetUrlHelper # font_url "font.ttf", host: "http://stage.example.com" # => http://stage.example.com/fonts/font.ttf # aliased to avoid conflicts with a font_url named route # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#466 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#470 def url_to_font(source, options = T.unsafe(nil)); end # Computes the full URL to an image asset. @@ -2189,7 +2402,7 @@ module ActionView::Helpers::AssetUrlHelper # image_url "edit.png", host: "http://stage.example.com" # => http://stage.example.com/assets/edit.png # aliased to avoid conflicts with an image_url named route # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#389 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#393 def url_to_image(source, options = T.unsafe(nil)); end # Computes the full URL to a JavaScript asset in the public javascripts directory. @@ -2200,7 +2413,7 @@ module ActionView::Helpers::AssetUrlHelper # javascript_url "js/xmlhr.js", host: "http://stage.example.com" # => http://stage.example.com/assets/js/xmlhr.js # aliased to avoid conflicts with a javascript_url named route # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#332 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#336 def url_to_javascript(source, options = T.unsafe(nil)); end # Computes the full URL to a stylesheet asset in the public stylesheets directory. @@ -2211,7 +2424,7 @@ module ActionView::Helpers::AssetUrlHelper # stylesheet_url "css/style.css", host: "http://stage.example.com" # => http://stage.example.com/assets/css/style.css # aliased to avoid conflicts with a stylesheet_url named route # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#359 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#363 def url_to_stylesheet(source, options = T.unsafe(nil)); end # Computes the full URL to a video asset in the public videos directory. @@ -2222,7 +2435,7 @@ module ActionView::Helpers::AssetUrlHelper # video_url "hd.avi", host: "http://stage.example.com" # => http://stage.example.com/videos/hd.avi # aliased to avoid conflicts with a video_url named route # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#415 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#419 def url_to_video(source, options = T.unsafe(nil)); end # Computes the path to a video asset in the public videos directory. @@ -2235,7 +2448,7 @@ module ActionView::Helpers::AssetUrlHelper # video_path("/trailers/hd.avi") # => /trailers/hd.avi # video_path("http://www.example.com/vid/hd.avi") # => http://www.example.com/vid/hd.avi # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#403 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#404 def video_path(source, options = T.unsafe(nil)); end # Computes the full URL to a video asset in the public videos directory. @@ -2245,22 +2458,24 @@ module ActionView::Helpers::AssetUrlHelper # # video_url "hd.avi", host: "http://stage.example.com" # => http://stage.example.com/videos/hd.avi # - # source://actionview//lib/action_view/helpers/asset_url_helper.rb#415 + # source://actionview//lib/action_view/helpers/asset_url_helper.rb#416 def video_url(source, options = T.unsafe(nil)); end end -# source://actionview//lib/action_view/helpers/asset_url_helper.rb#235 +# source://actionview//lib/action_view/helpers/asset_url_helper.rb#236 ActionView::Helpers::AssetUrlHelper::ASSET_EXTENSIONS = T.let(T.unsafe(nil), Hash) # Maps asset types to public directory. # -# source://actionview//lib/action_view/helpers/asset_url_helper.rb#253 +# source://actionview//lib/action_view/helpers/asset_url_helper.rb#254 ActionView::Helpers::AssetUrlHelper::ASSET_PUBLIC_DIRECTORIES = T.let(T.unsafe(nil), Hash) -# source://actionview//lib/action_view/helpers/asset_url_helper.rb#121 +# source://actionview//lib/action_view/helpers/asset_url_helper.rb#122 ActionView::Helpers::AssetUrlHelper::URI_REGEXP = T.let(T.unsafe(nil), Regexp) -# source://actionview//lib/action_view/helpers/atom_feed_helper.rb#8 +# = Action View Atom Feed \Helpers +# +# source://actionview//lib/action_view/helpers/atom_feed_helper.rb#6 module ActionView::Helpers::AtomFeedHelper # Adds easy defaults to writing Atom feeds with the Builder template engine (this does not work on ERB or any other # template languages). @@ -2338,9 +2553,9 @@ module ActionView::Helpers::AtomFeedHelper # end # # The Atom spec defines five elements (content rights title subtitle - # summary) which may directly contain xhtml content if type: 'xhtml' + # summary) which may directly contain XHTML content if type: 'xhtml' # is specified as an attribute. If so, this helper will take care of - # the enclosing div and xhtml namespace declaration. Example usage: + # the enclosing div and XHTML namespace declaration. Example usage: # # entry.summary type: 'xhtml' do |xhtml| # xhtml.p pluralize(order.line_items.count, "line item") @@ -2352,24 +2567,24 @@ module ActionView::Helpers::AtomFeedHelper # atom_feed yields an +AtomFeedBuilder+ instance. Nested elements yield # an +AtomBuilder+ instance. # - # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#98 + # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#96 def atom_feed(options = T.unsafe(nil), &block); end end -# source://actionview//lib/action_view/helpers/atom_feed_helper.rb#129 +# source://actionview//lib/action_view/helpers/atom_feed_helper.rb#127 class ActionView::Helpers::AtomFeedHelper::AtomBuilder # @return [AtomBuilder] a new instance of AtomBuilder # - # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#132 + # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#130 def initialize(xml); end private - # Delegate to xml builder, first wrapping the element in an xhtml + # Delegate to XML Builder, first wrapping the element in an XHTML # namespaced div element if the method and arguments indicate # that an xhtml_block? is desired. # - # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#140 + # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#138 def method_missing(method, *arguments, &block); end # True if the method name matches one of the five elements defined @@ -2378,23 +2593,23 @@ class ActionView::Helpers::AtomFeedHelper::AtomBuilder # # @return [Boolean] # - # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#155 + # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#153 def xhtml_block?(method, arguments); end end -# source://actionview//lib/action_view/helpers/atom_feed_helper.rb#130 +# source://actionview//lib/action_view/helpers/atom_feed_helper.rb#128 ActionView::Helpers::AtomFeedHelper::AtomBuilder::XHTML_TAG_NAMES = T.let(T.unsafe(nil), Set) -# source://actionview//lib/action_view/helpers/atom_feed_helper.rb#163 +# source://actionview//lib/action_view/helpers/atom_feed_helper.rb#161 class ActionView::Helpers::AtomFeedHelper::AtomFeedBuilder < ::ActionView::Helpers::AtomFeedHelper::AtomBuilder # @return [AtomFeedBuilder] a new instance of AtomFeedBuilder # - # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#164 + # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#162 def initialize(xml, view, feed_options = T.unsafe(nil)); end # Creates an entry tag for a specific record and prefills the id using class and id. # - # Options: + # ==== Options # # * :published: Time first published. Defaults to the created_at attribute on the record if one such exists. # * :updated: Time of update. Defaults to the updated_at attribute on the record if one such exists. @@ -2402,15 +2617,17 @@ class ActionView::Helpers::AtomFeedHelper::AtomFeedBuilder < ::ActionView::Helpe # * :id: The ID for this entry. Defaults to "tag:#{@view.request.host},#{@feed_options[:schema_date]}:#{record.class}/#{record.id}" # * :type: The TYPE for this entry. Defaults to "text/html". # - # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#182 + # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#180 def entry(record, options = T.unsafe(nil)); end # Accepts a Date or Time object and inserts it in the proper format. If +nil+ is passed, current time in UTC is used. # - # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#169 + # source://actionview//lib/action_view/helpers/atom_feed_helper.rb#167 def updated(date_or_time = T.unsafe(nil)); end end +# = Action View Cache \Helpers +# # source://actionview//lib/action_view/helpers/cache_helper.rb#6 module ActionView::Helpers::CacheHelper # This helper exposes a method for caching fragments of a view @@ -2483,11 +2700,11 @@ module ActionView::Helpers::CacheHelper # render 'comments/comments' # render('comments/comments') # - # render "header" translates to render("comments/header") + # render "header" # translates to render("comments/header") # - # render(@topic) translates to render("topics/topic") - # render(topics) translates to render("topics/topic") - # render(message.topics) translates to render("topics/topic") + # render(@topic) # translates to render("topics/topic") + # render(topics) # translates to render("topics/topic") + # render(message.topics) # translates to render("topics/topic") # # It's not possible to derive all render calls like that, though. # Here are a few examples of things that can't be derived: @@ -2500,6 +2717,14 @@ module ActionView::Helpers::CacheHelper # render partial: 'attachments/attachment', collection: group_of_attachments # render partial: 'documents/document', collection: @project.documents.where(published: true).order('created_at') # + # One last type of dependency can be determined implicitly: + # + # render "maintenance_tasks/runs/info/#{run.status}" + # + # Because the value passed to render ends in interpolation, Action View + # will mark all partials within the "maintenance_tasks/runs/info" folder as + # dependencies. + # # === Explicit dependencies # # Sometimes you'll have template dependencies that can't be derived at all. This is typically @@ -2573,7 +2798,7 @@ module ActionView::Helpers::CacheHelper # This will include both records as part of the cache key and updating either of them will # expire the cache. # - # source://actionview//lib/action_view/helpers/cache_helper.rb#168 + # source://actionview//lib/action_view/helpers/cache_helper.rb#176 def cache(name = T.unsafe(nil), options = T.unsafe(nil), &block); end # This helper returns the name of a cache key for a given fragment cache @@ -2582,7 +2807,7 @@ module ActionView::Helpers::CacheHelper # cannot be manually expired unless you know the exact key which is the # case when using memcached. # - # source://actionview//lib/action_view/helpers/cache_helper.rb#240 + # source://actionview//lib/action_view/helpers/cache_helper.rb#248 def cache_fragment_name(name = T.unsafe(nil), skip_digest: T.unsafe(nil), digest_path: T.unsafe(nil)); end # Cache fragments of a view if +condition+ is true @@ -2592,7 +2817,7 @@ module ActionView::Helpers::CacheHelper # <%= render project.topics %> # <% end %> # - # source://actionview//lib/action_view/helpers/cache_helper.rb#215 + # source://actionview//lib/action_view/helpers/cache_helper.rb#223 def cache_if(condition, name = T.unsafe(nil), options = T.unsafe(nil), &block); end # Cache fragments of a view unless +condition+ is true @@ -2602,7 +2827,7 @@ module ActionView::Helpers::CacheHelper # <%= render project.topics %> # <% end %> # - # source://actionview//lib/action_view/helpers/cache_helper.rb#231 + # source://actionview//lib/action_view/helpers/cache_helper.rb#239 def cache_unless(condition, name = T.unsafe(nil), options = T.unsafe(nil), &block); end # Returns whether the current view fragment is within a +cache+ block. @@ -2615,13 +2840,13 @@ module ActionView::Helpers::CacheHelper # # @return [Boolean] # - # source://actionview//lib/action_view/helpers/cache_helper.rb#188 + # source://actionview//lib/action_view/helpers/cache_helper.rb#196 def caching?; end - # source://actionview//lib/action_view/helpers/cache_helper.rb#248 + # source://actionview//lib/action_view/helpers/cache_helper.rb#256 def digest_path_from_template(template); end - # Raises +UncacheableFragmentError+ when called from within a +cache+ block. + # Raises UncacheableFragmentError when called from within a +cache+ block. # # Useful to denote helper methods that can't participate in fragment caching: # @@ -2630,59 +2855,64 @@ module ActionView::Helpers::CacheHelper # "#{project.name} - #{Time.now}" # end # - # # Which will then raise if used within a +cache+ block: + # # Which will then raise if used within a `cache` block: # <% cache project do %> # <%= project_name_with_time(project) %> # <% end %> # # @raise [UncacheableFragmentError] # - # source://actionview//lib/action_view/helpers/cache_helper.rb#205 + # source://actionview//lib/action_view/helpers/cache_helper.rb#213 def uncacheable!; end private - # source://actionview//lib/action_view/helpers/cache_helper.rb#270 + # source://actionview//lib/action_view/helpers/cache_helper.rb#278 def fragment_for(name = T.unsafe(nil), options = T.unsafe(nil), &block); end - # source://actionview//lib/action_view/helpers/cache_helper.rb#259 + # source://actionview//lib/action_view/helpers/cache_helper.rb#267 def fragment_name_with_digest(name, digest_path); end - # source://actionview//lib/action_view/helpers/cache_helper.rb#280 + # source://actionview//lib/action_view/helpers/cache_helper.rb#288 def read_fragment_for(name, options); end - # source://actionview//lib/action_view/helpers/cache_helper.rb#284 - def write_fragment_for(name, options); end + # source://actionview//lib/action_view/helpers/cache_helper.rb#292 + def write_fragment_for(name, options, &block); end end -# source://actionview//lib/action_view/helpers/cache_helper.rb#295 +# source://actionview//lib/action_view/helpers/cache_helper.rb#297 module ActionView::Helpers::CacheHelper::CachingRegistry extend ::ActionView::Helpers::CacheHelper::CachingRegistry # @return [Boolean] # - # source://actionview//lib/action_view/helpers/cache_helper.rb#298 + # source://actionview//lib/action_view/helpers/cache_helper.rb#300 def caching?; end - # source://actionview//lib/action_view/helpers/cache_helper.rb#302 + # source://actionview//lib/action_view/helpers/cache_helper.rb#304 def track_caching; end end # source://actionview//lib/action_view/helpers/cache_helper.rb#7 class ActionView::Helpers::CacheHelper::UncacheableFragmentError < ::StandardError; end -# CaptureHelper exposes methods to let you extract generated markup which +# = Action View Capture \Helpers +# +# \CaptureHelper exposes methods to let you extract generated markup which # can be used in other parts of a template or layout file. # -# It provides a method to capture blocks into variables through capture and -# a way to capture a block of markup for use in a layout through {content_for}[rdoc-ref:ActionView::Helpers::CaptureHelper#content_for]. +# It provides a method to capture blocks into variables through #capture and +# a way to capture a block of markup for use in a layout through #content_for. # -# source://actionview//lib/action_view/helpers/capture_helper.rb#13 +# As well as provides a method when using streaming responses through #provide. +# See ActionController::Streaming for more information. +# +# source://actionview//lib/action_view/helpers/capture_helper.rb#17 module ActionView::Helpers::CaptureHelper - # The capture method extracts part of a template as a String object. + # The capture method extracts part of a template as a string object. # You can then use this object anywhere in your templates, layout, or helpers. # - # The capture method can be used in ERB templates... + # The capture method can be used in \ERB templates... # # <% @greeting = capture do %> # Welcome to my shiny new web page! The date and time is @@ -2708,8 +2938,8 @@ module ActionView::Helpers::CaptureHelper # # @greeting # => "Welcome to my shiny new web page! The date and time is 2018-09-06 11:09:16 -0500" # - # source://actionview//lib/action_view/helpers/capture_helper.rb#43 - def capture(*args); end + # source://actionview//lib/action_view/helpers/capture_helper.rb#47 + def capture(*_arg0, **_arg1, &block); end # Calling content_for stores a block of markup in an identifier for later use. # In order to access this stored content in other templates, helper modules @@ -2784,7 +3014,7 @@ module ActionView::Helpers::CaptureHelper #
  • <%= link_to 'Home', action: 'index' %>
  • # <% end %> # - # And in another place: + # And in another place: # # <% content_for :navigation do %> #
  • <%= link_to 'Login', action: 'login' %>
  • @@ -2800,7 +3030,7 @@ module ActionView::Helpers::CaptureHelper #
  • <%= link_to 'Home', action: 'index' %>
  • # <% end %> # - # <%# Add some other content, or use a different template: %> + # <%# Add some other content, or use a different template: %> # # <% content_for :navigation, flush: true do %> #
  • <%= link_to 'Login', action: 'login' %>
  • @@ -2816,10 +3046,11 @@ module ActionView::Helpers::CaptureHelper # # WARNING: content_for is ignored in caches. So you shouldn't use it for elements that will be fragment cached. # - # source://actionview//lib/action_view/helpers/capture_helper.rb#155 + # source://actionview//lib/action_view/helpers/capture_helper.rb#172 def content_for(name, content = T.unsafe(nil), options = T.unsafe(nil), &block); end # content_for? checks whether any content has been captured yet using content_for. + # # Useful to render parts of your layout differently based on what is in your views. # # <%# This is the layout %> @@ -2836,7 +3067,7 @@ module ActionView::Helpers::CaptureHelper # # @return [Boolean] # - # source://actionview//lib/action_view/helpers/capture_helper.rb#195 + # source://actionview//lib/action_view/helpers/capture_helper.rb#215 def content_for?(name); end # The same as +content_for+ but when used with streaming flushes @@ -2845,72 +3076,166 @@ module ActionView::Helpers::CaptureHelper # template, you should use +content_for+, if not, use +provide+ to tell # the layout to stop looking for more contents. # - # source://actionview//lib/action_view/helpers/capture_helper.rb#175 + # See ActionController::Streaming for more information. + # + # source://actionview//lib/action_view/helpers/capture_helper.rb#194 def provide(name, content = T.unsafe(nil), &block); end # Use an alternate output buffer for the duration of the block. # Defaults to a new empty string. # - # source://actionview//lib/action_view/helpers/capture_helper.rb#201 + # source://actionview//lib/action_view/helpers/capture_helper.rb#221 def with_output_buffer(buf = T.unsafe(nil)); end end +# source://actionview//lib/action_view/helpers/content_exfiltration_prevention_helper.rb#5 +module ActionView::Helpers::ContentExfiltrationPreventionHelper + # source://actionview//lib/action_view/helpers/content_exfiltration_prevention_helper.rb#6 + def prepend_content_exfiltration_prevention; end + + # source://actionview//lib/action_view/helpers/content_exfiltration_prevention_helper.rb#6 + def prepend_content_exfiltration_prevention=(val); end + + # source://actionview//lib/action_view/helpers/content_exfiltration_prevention_helper.rb#61 + def prevent_content_exfiltration(html); end + + class << self + # source://actionview//lib/action_view/helpers/content_exfiltration_prevention_helper.rb#6 + def prepend_content_exfiltration_prevention; end + + # source://actionview//lib/action_view/helpers/content_exfiltration_prevention_helper.rb#6 + def prepend_content_exfiltration_prevention=(val); end + end +end + +# Close any open tags that support CDATA (textarea, xmp) before each form tag. +# This prevents attackers from injecting unclosed tags that could capture +# form contents. +# +# For example, an attacker might inject: +# +#
    or +# the end of the document would be captured by the attacker's +# # - # text_area(:comment, :text, size: "20x30") + # textarea(:comment, :text, size: "20x30") # # => # - # text_area(:application, :notes, cols: 40, rows: 15, class: 'app_input') + # textarea(:application, :notes, cols: 40, rows: 15, class: 'app_input') # # => # - # text_area(:entry, :body, size: "20x20", disabled: 'disabled') + # textarea(:entry, :body, size: "20x20", disabled: 'disabled') # # => # - # source://actionview//lib/action_view/helpers/form_helper.rb#1268 + # source://actionview//lib/action_view/helpers/form_helper.rb#1280 def text_area(object_name, method, options = T.unsafe(nil)); end # Returns an input tag of the "text" type tailored for accessing a specified attribute (identified by +method+) on an object @@ -6320,14 +6871,14 @@ module ActionView::Helpers::FormHelper # shown. # # ==== Examples - # text_field(:post, :title, size: 20) - # # => + # text_field(:article, :title, size: 20) + # # => # - # text_field(:post, :title, class: "create_input") - # # => + # text_field(:article, :title, class: "create_input") + # # => # - # text_field(:post, :title, maxlength: 30, class: "title_input") - # # => + # text_field(:article, :title, maxlength: 30, class: "title_input") + # # => # # text_field(:session, :user, onchange: "if ($('#session_user').val() === 'admin') { alert('Your login cannot be admin!'); }") # # => @@ -6335,9 +6886,37 @@ module ActionView::Helpers::FormHelper # text_field(:snippet, :code, size: 20, class: 'code_input') # # => # - # source://actionview//lib/action_view/helpers/form_helper.rb#1166 + # source://actionview//lib/action_view/helpers/form_helper.rb#1175 def text_field(object_name, method, options = T.unsafe(nil)); end + # Returns a textarea opening and closing tag set tailored for accessing a specified attribute (identified by +method+) + # on an object assigned to the template (identified by +object+). Additional options on the input tag can be passed as a + # hash with +options+. + # + # ==== Examples + # textarea(:article, :body, cols: 20, rows: 40) + # # => + # + # textarea(:comment, :text, size: "20x30") + # # => + # + # textarea(:application, :notes, cols: 40, rows: 15, class: 'app_input') + # # => + # + # textarea(:entry, :body, size: "20x20", disabled: 'disabled') + # # => + # + # source://actionview//lib/action_view/helpers/form_helper.rb#1277 + def textarea(object_name, method, options = T.unsafe(nil)); end + # Returns a text_field of type "time". # # The default value is generated by trying to call +strftime+ with "%T.%L" @@ -6373,7 +6952,7 @@ module ActionView::Helpers::FormHelper # time_field("task", "started_at", value: Time.now, include_seconds: false) # # => # - # source://actionview//lib/action_view/helpers/form_helper.rb#1468 + # source://actionview//lib/action_view/helpers/form_helper.rb#1479 def time_field(object_name, method, options = T.unsafe(nil)); end # Returns a text_field of type "url". @@ -6381,7 +6960,7 @@ module ActionView::Helpers::FormHelper # url_field("user", "homepage") # # => # - # source://actionview//lib/action_view/helpers/form_helper.rb#1542 + # source://actionview//lib/action_view/helpers/form_helper.rb#1559 def url_field(object_name, method, options = T.unsafe(nil)); end # Returns a text_field of type "week". @@ -6397,47 +6976,49 @@ module ActionView::Helpers::FormHelper # week_field("user", "born_on") # # => # - # source://actionview//lib/action_view/helpers/form_helper.rb#1533 + # source://actionview//lib/action_view/helpers/form_helper.rb#1550 def week_field(object_name, method, options = T.unsafe(nil)); end private - # source://actionview//lib/action_view/helpers/form_helper.rb#463 + # source://actionview//lib/action_view/helpers/form_helper.rb#465 def apply_form_for_options!(object, options); end - # source://actionview//lib/action_view/helpers/form_helper.rb#1607 + # source://actionview//lib/action_view/helpers/form_helper.rb#1624 def default_form_builder_class; end - # source://actionview//lib/action_view/helpers/form_helper.rb#1578 + # source://actionview//lib/action_view/helpers/form_helper.rb#1595 def html_options_for_form_with(url_for_options = T.unsafe(nil), model = T.unsafe(nil), html: T.unsafe(nil), local: T.unsafe(nil), skip_enforcing_utf8: T.unsafe(nil), **options); end - # source://actionview//lib/action_view/helpers/form_helper.rb#1593 + # source://actionview//lib/action_view/helpers/form_helper.rb#1610 def instantiate_builder(record_name, record_object, options); end class << self - # source://actionview//lib/action_view/helpers/form_helper.rb#479 + # source://actionview//lib/action_view/helpers/form_helper.rb#481 def form_with_generates_ids; end - # source://actionview//lib/action_view/helpers/form_helper.rb#479 + # source://actionview//lib/action_view/helpers/form_helper.rb#481 def form_with_generates_ids=(val); end - # source://actionview//lib/action_view/helpers/form_helper.rb#477 + # source://actionview//lib/action_view/helpers/form_helper.rb#479 def form_with_generates_remote_forms; end - # source://actionview//lib/action_view/helpers/form_helper.rb#477 + # source://actionview//lib/action_view/helpers/form_helper.rb#479 def form_with_generates_remote_forms=(val); end - # source://actionview//lib/action_view/helpers/form_helper.rb#481 + # source://actionview//lib/action_view/helpers/form_helper.rb#483 def multiple_file_field_include_hidden; end - # source://actionview//lib/action_view/helpers/form_helper.rb#481 + # source://actionview//lib/action_view/helpers/form_helper.rb#483 def multiple_file_field_include_hidden=(val); end end end +# = Action View Form Option \Helpers +# # Provides a number of methods for turning different kinds of containers into a set of option tags. # -# The collection_select, select and time_zone_select methods take an options parameter, a hash: +# The #collection_select, #select and #time_zone_select methods take an options parameter, a hash: # # * :include_blank - set to true or a prompt string if the first option element of the select element is a blank. Useful if there is not a default value required for the select element. # @@ -6479,7 +7060,7 @@ end # # # -# * :index - like the other form helpers, select can accept an :index option to manually set the ID used in the resulting output. Unlike other helpers, select expects this +# * :index - like the other form helpers, #select can accept an :index option to manually set the ID used in the resulting output. Unlike other helpers, #select expects this # option to be in the +html_options+ parameter. # # select("album[]", :genre, %w[ rap rock country ], {}, { index: nil }) @@ -6504,7 +7085,7 @@ end # # # -# When used with the collection_select helper, :disabled can also be a Proc that identifies those options that should be disabled. +# When used with the #collection_select helper, :disabled can also be a Proc that identifies those options that should be disabled. # # collection_select(:post, :category_id, Category.all, :id, :name, { disabled: -> (category) { category.archived? } }) # @@ -6549,7 +7130,7 @@ module ActionView::Helpers::FormOptionsHelper # end # # Sample usage (selecting the associated Author for an instance of Post, @post): - # collection_check_boxes(:post, :author_ids, Author.all, :id, :name_with_initial) + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) # # If @post.author_ids is already [1], this would return: # @@ -6562,8 +7143,8 @@ module ActionView::Helpers::FormOptionsHelper # # It is also possible to customize the way the elements will be shown by # giving a block to the method: - # collection_check_boxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| - # b.label { b.check_box } + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label { b.checkbox } # end # # The argument passed to the block is a special kind of builder for this @@ -6572,17 +7153,17 @@ module ActionView::Helpers::FormOptionsHelper # Using it, you can change the label and check box display order or even # use the label as wrapper, as in the example above. # - # The builder methods label and check_box also accept + # The builder methods label and checkbox also accept # extra HTML options: - # collection_check_boxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| - # b.label(class: "check_box") { b.check_box(class: "check_box") } + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label(class: "checkbox") { b.checkbox(class: "checkbox") } # end # # There are also three special methods available: object, text and # value, which are the current item being rendered, its text and value methods, # respectively. You can use them like this: - # collection_check_boxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| - # b.label(:"data-value" => b.value) { b.check_box + b.text } + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label(:"data-value" => b.value) { b.checkbox + b.text } # end # # ==== Gotcha @@ -6606,69 +7187,153 @@ module ActionView::Helpers::FormOptionsHelper # In the rare case you don't want this hidden field, you can pass the # include_hidden: false option to the helper method. # - # source://actionview//lib/action_view/helpers/form_options_helper.rb#779 + # source://actionview//lib/action_view/helpers/form_options_helper.rb#787 def collection_check_boxes(object, method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end - # Returns radio button tags for the collection of existing return values - # of +method+ for +object+'s class. The value returned from calling - # +method+ on the instance +object+ will be selected. If calling +method+ - # returns +nil+, no selection is made. + # Returns check box tags for the collection of existing return values of + # +method+ for +object+'s class. The value returned from calling +method+ + # on the instance +object+ will be selected. If calling +method+ returns + # +nil+, no selection is made. # # The :value_method and :text_method parameters are # methods to be called on each member of +collection+. The return values - # are used as the +value+ attribute and contents of each radio button tag, + # are used as the +value+ attribute and contents of each check box tag, # respectively. They can also be any object that responds to +call+, such # as a +proc+, that will be called for each member of the +collection+ to # retrieve the value/text. # # Example object structure for use with this method: - # # class Post < ActiveRecord::Base - # belongs_to :author + # has_and_belongs_to_many :authors # end - # # class Author < ActiveRecord::Base - # has_many :posts - # + # has_and_belongs_to_many :posts # def name_with_initial # "#{first_name.first}. #{last_name}" # end # end # # Sample usage (selecting the associated Author for an instance of Post, @post): - # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) # - # If @post.author_id is already 1, this would return: - # - # - # - # - # - # + # If @post.author_ids is already [1], this would return: + # + # + # + # + # + # + # # # It is also possible to customize the way the elements will be shown by # giving a block to the method: - # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| - # b.label { b.radio_button } + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label { b.checkbox } # end # # The argument passed to the block is a special kind of builder for this - # collection, which has the ability to generate the label and radio button + # collection, which has the ability to generate the label and check box # for the current item in the collection, with proper text and value. - # Using it, you can change the label and radio button display order or - # even use the label as wrapper, as in the example above. + # Using it, you can change the label and check box display order or even + # use the label as wrapper, as in the example above. # - # The builder methods label and radio_button also accept + # The builder methods label and checkbox also accept # extra HTML options: - # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| - # b.label(class: "radio_button") { b.radio_button(class: "radio_button") } + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label(class: "checkbox") { b.checkbox(class: "checkbox") } # end # # There are also three special methods available: object, text and # value, which are the current item being rendered, its text and value methods, # respectively. You can use them like this: - # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| - # b.label(:"data-value" => b.value) { b.radio_button + b.text } + # collection_checkboxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label(:"data-value" => b.value) { b.checkbox + b.text } + # end + # + # ==== Gotcha + # + # When no selection is made for a collection of checkboxes most + # web browsers will not send any value. + # + # For example, if we have a +User+ model with +category_ids+ field and we + # have the following code in our update action: + # + # @user.update(params[:user]) + # + # If no +category_ids+ are selected then we can safely assume this field + # will not be updated. + # + # This is possible thanks to a hidden field generated by the helper method + # for every collection of checkboxes. + # This hidden field is given the same field name as the checkboxes with a + # blank value. + # + # In the rare case you don't want this hidden field, you can pass the + # include_hidden: false option to the helper method. + # + # source://actionview//lib/action_view/helpers/form_options_helper.rb#784 + def collection_checkboxes(object, method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Returns radio button tags for the collection of existing return values + # of +method+ for +object+'s class. The value returned from calling + # +method+ on the instance +object+ will be selected. If calling +method+ + # returns +nil+, no selection is made. + # + # The :value_method and :text_method parameters are + # methods to be called on each member of +collection+. The return values + # are used as the +value+ attribute and contents of each radio button tag, + # respectively. They can also be any object that responds to +call+, such + # as a +proc+, that will be called for each member of the +collection+ to + # retrieve the value/text. + # + # Example object structure for use with this method: + # + # class Post < ActiveRecord::Base + # belongs_to :author + # end + # + # class Author < ActiveRecord::Base + # has_many :posts + # + # def name_with_initial + # "#{first_name.first}. #{last_name}" + # end + # end + # + # Sample usage (selecting the associated Author for an instance of Post, @post): + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) + # + # If @post.author_id is already 1, this would return: + # + # + # + # + # + # + # + # It is also possible to customize the way the elements will be shown by + # giving a block to the method: + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| + # b.label { b.radio_button } + # end + # + # The argument passed to the block is a special kind of builder for this + # collection, which has the ability to generate the label and radio button + # for the current item in the collection, with proper text and value. + # Using it, you can change the label and radio button display order or + # even use the label as wrapper, as in the example above. + # + # The builder methods label and radio_button also accept + # extra HTML options: + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| + # b.label(class: "radio_button") { b.radio_button(class: "radio_button") } + # end + # + # There are also three special methods available: object, text and + # value, which are the current item being rendered, its text and value methods, + # respectively. You can use them like this: + # collection_radio_buttons(:post, :author_id, Author.all, :id, :name_with_initial) do |b| + # b.label(:"data-value" => b.value) { b.radio_button + b.text } # end # # ==== Gotcha @@ -6679,7 +7344,7 @@ module ActionView::Helpers::FormOptionsHelper # if a +User+ model has a +category_id+ field and in the form no category is selected, no +category_id+ parameter is sent. So, # any strong parameters idiom like: # - # params.require(:user).permit(...) + # params.expect(user: [...]) # # will raise an error since no {user: ...} will be present. # @@ -6689,7 +7354,7 @@ module ActionView::Helpers::FormOptionsHelper # In case if you don't want the helper to generate this hidden field you can specify # include_hidden: false option. # - # source://actionview//lib/action_view/helpers/form_options_helper.rb#695 + # source://actionview//lib/action_view/helpers/form_options_helper.rb#700 def collection_radio_buttons(object, method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end # Returns tag. # - # source://actionview//lib/action_view/helpers/form_options_helper.rb#531 + # source://actionview//lib/action_view/helpers/form_options_helper.rb#535 def grouped_options_for_select(grouped_options, selected_key = T.unsafe(nil), options = T.unsafe(nil)); end - # Returns a string of tags, like options_from_collection_for_select, but + # Returns a string of tags, like #options_from_collection_for_select, but # groups them by tags based on the object relationships of the arguments. # # Parameters: @@ -7006,7 +7675,7 @@ module ActionView::Helpers::FormOptionsHelper # # Example with @post.person_id => 2: # - # select :post, :person_id, Person.all.collect { |p| [ p.name, p.id ] }, { include_blank: true }) + # select :post, :person_id, Person.all.collect { |p| [ p.name, p.id ] }, { include_blank: true } # # would become: # @@ -7027,7 +7696,7 @@ module ActionView::Helpers::FormOptionsHelper # or selected: nil to leave all options unselected. Similarly, you can specify values to be disabled in the option # tags by specifying the :disabled option. This can either be a single value or an array of values to be disabled. # - # A block can be passed to +select+ to customize how the options tags will be rendered. This + # A block can be passed to #select to customize how the options tags will be rendered. This # is useful when the options tag has complex attributes. # # select(report, :campaign_ids) do @@ -7081,7 +7750,7 @@ module ActionView::Helpers::FormOptionsHelper # NOTE: Only the option tags are returned, you have to wrap this call in # a regular HTML select tag. # - # source://actionview//lib/action_view/helpers/form_options_helper.rb#576 + # source://actionview//lib/action_view/helpers/form_options_helper.rb#580 def time_zone_options_for_select(selected = T.unsafe(nil), priority_zones = T.unsafe(nil), model = T.unsafe(nil)); end # Returns select and option tags for the given object and method, using @@ -7090,7 +7759,7 @@ module ActionView::Helpers::FormOptionsHelper # In addition to the :include_blank option documented above, # this method also supports a :model option, which defaults # to ActiveSupport::TimeZone. This may be used by users to specify a - # different time zone model object. (See +time_zone_options_for_select+ + # different time zone model object. (See #time_zone_options_for_select # for more information.) # # You can also supply an array of ActiveSupport::TimeZone objects @@ -7120,7 +7789,8 @@ module ActionView::Helpers::FormOptionsHelper # Returns a string of option tags for the days of the week. # - # Options: + # ====Options + # # * :index_as_value - Defaults to false, set to true to use the indexes from # I18n.translate("date.day_names") as the values. By default, Sunday is always 0. # * :day_format - The I18n key of the array to use for the weekday options. @@ -7130,49 +7800,52 @@ module ActionView::Helpers::FormOptionsHelper # NOTE: Only the option tags are returned, you have to wrap this call in # a regular HTML select tag. # - # source://actionview//lib/action_view/helpers/form_options_helper.rb#608 + # source://actionview//lib/action_view/helpers/form_options_helper.rb#613 def weekday_options_for_select(selected = T.unsafe(nil), index_as_value: T.unsafe(nil), day_format: T.unsafe(nil), beginning_of_week: T.unsafe(nil)); end # Returns select and option tags for the given object and method, using - # weekday_options_for_select to generate the list of option tags. + # #weekday_options_for_select to generate the list of option tags. # # source://actionview//lib/action_view/helpers/form_options_helper.rb#297 def weekday_select(object, method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end private - # source://actionview//lib/action_view/helpers/form_options_helper.rb#806 + # source://actionview//lib/action_view/helpers/form_options_helper.rb#812 def extract_selected_and_disabled(selected); end - # source://actionview//lib/action_view/helpers/form_options_helper.rb#817 + # source://actionview//lib/action_view/helpers/form_options_helper.rb#823 def extract_values_from_collection(collection, value_method, selected); end - # source://actionview//lib/action_view/helpers/form_options_helper.rb#784 + # source://actionview//lib/action_view/helpers/form_options_helper.rb#790 def option_html_attributes(element); end - # source://actionview//lib/action_view/helpers/form_options_helper.rb#792 + # source://actionview//lib/action_view/helpers/form_options_helper.rb#798 def option_text_and_value(option); end # @return [Boolean] # - # source://actionview//lib/action_view/helpers/form_options_helper.rb#802 + # source://actionview//lib/action_view/helpers/form_options_helper.rb#808 def option_value_selected?(value, selected); end - # source://actionview//lib/action_view/helpers/form_options_helper.rb#831 + # source://actionview//lib/action_view/helpers/form_options_helper.rb#837 def prompt_text(prompt); end - # source://actionview//lib/action_view/helpers/form_options_helper.rb#827 + # source://actionview//lib/action_view/helpers/form_options_helper.rb#833 def value_for_collection(item, value); end end +# = Action View Form Tag \Helpers +# # 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. # # NOTE: The HTML options disabled, readonly, and multiple can all be treated as booleans. So specifying # disabled: true will give disabled="disabled". # -# source://actionview//lib/action_view/helpers/form_tag_helper.rb#17 +# source://actionview//lib/action_view/helpers/form_tag_helper.rb#18 module ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper extend ::ActiveSupport::Concern include ::ActionView::Helpers::UrlHelper include ::ActionView::Helpers::SanitizeHelper @@ -7215,53 +7888,72 @@ module ActionView::Helpers::FormTagHelper # # Ask me! # # # - # ==== Deprecated: Rails UJS attributes + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#571 + def button_tag(content_or_options = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # :call-seq: + # checkbox_tag(name, options = {}) + # checkbox_tag(name, value, options = {}) + # checkbox_tag(name, value, checked, options = {}) + # + # Creates a check box form input tag. + # + # ==== Options + # * :value - The value of the input. Defaults to "1". + # * :checked - If set to true, the checkbox will be checked by default. + # * :disabled - If set to true, the user will not be able to use this input. + # * Any other key creates standard HTML options for the tag. # - # Prior to Rails 7, Rails shipped with a JavaScript library called @rails/ujs on by default. Following Rails 7, - # this library is no longer on by default. This library integrated with the following options: + # ==== Examples + # checkbox_tag 'accept' + # # => # - # * confirm: 'question?' - If present, the - # unobtrusive JavaScript drivers will provide a prompt with - # the question specified. If the user accepts, the form is - # processed normally, otherwise no action is taken. - # * :disable_with - Value of this parameter will be - # used as the value for a disabled version of the submit - # button when the form is submitted. This feature is provided - # by the unobtrusive JavaScript driver. + # checkbox_tag 'rock', 'rock music' + # # => # - # button_tag "Save", data: { confirm: "Are you sure?" } - # # => + # checkbox_tag 'receive_email', 'yes', true + # # => # - # button_tag "Checkout", data: { disable_with: "Please wait..." } - # # => + # checkbox_tag 'tos', 'yes', false, class: 'accept_tos' + # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#578 - def button_tag(content_or_options = T.unsafe(nil), options = T.unsafe(nil), &block); end + # checkbox_tag 'eula', 'accepted', false, disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#469 + def check_box_tag(name, *args); end + # :call-seq: + # checkbox_tag(name, options = {}) + # checkbox_tag(name, value, options = {}) + # checkbox_tag(name, value, checked, options = {}) + # # Creates a check box form input tag. # # ==== Options + # * :value - The value of the input. Defaults to "1". + # * :checked - If set to true, the checkbox will be checked by default. # * :disabled - If set to true, the user will not be able to use this input. # * Any other key creates standard HTML options for the tag. # # ==== Examples - # check_box_tag 'accept' + # checkbox_tag 'accept' # # => # - # check_box_tag 'rock', 'rock music' + # checkbox_tag 'rock', 'rock music' # # => # - # check_box_tag 'receive_email', 'yes', true + # checkbox_tag 'receive_email', 'yes', true # # => # - # check_box_tag 'tos', 'yes', false, class: 'accept_tos' + # checkbox_tag 'tos', 'yes', false, class: 'accept_tos' # # => # - # check_box_tag 'eula', 'accepted', false, disabled: true + # checkbox_tag 'eula', 'accepted', false, disabled: true # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#444 - def check_box_tag(name, value = T.unsafe(nil), checked = T.unsafe(nil), options = T.unsafe(nil)); end + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#459 + def checkbox_tag(name, *args); end # Creates a text field of type "color". # @@ -7283,7 +7975,7 @@ module ActionView::Helpers::FormTagHelper # color_field_tag 'color', '#DEF726', class: 'special_input', disabled: true # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#676 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#671 def color_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end # Creates a text field of type "date". @@ -7297,16 +7989,16 @@ module ActionView::Helpers::FormTagHelper # date_field_tag 'name' # # => # - # date_field_tag 'date', '01/01/2014' - # # => + # date_field_tag 'date', '2014-12-31' + # # => # # date_field_tag 'date', nil, class: 'special_input' # # => # - # date_field_tag 'date', '01/01/2014', class: 'special_input', disabled: true - # # => + # date_field_tag 'date', '2014-12-31', class: 'special_input', disabled: true + # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#746 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#741 def date_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end # Creates a text field of type "datetime-local". @@ -7318,8 +8010,23 @@ module ActionView::Helpers::FormTagHelper # * :min - The minimum acceptable value. # * :max - The maximum acceptable value. # * :step - The acceptable value granularity. + # * :include_seconds - Include seconds in the output timestamp format (true by default). # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#773 + # ==== Examples + # + # datetime_field_tag 'name' + # # => + # + # datetime_field_tag 'datetime', '2014-01-01T01:01' + # # => + # + # datetime_field_tag 'datetime', nil, class: 'special_input' + # # => + # + # datetime_field_tag 'datetime', '2014-01-01T01:01', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#800 def datetime_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end # Creates a text field of type "datetime-local". @@ -7331,14 +8038,29 @@ module ActionView::Helpers::FormTagHelper # * :min - The minimum acceptable value. # * :max - The maximum acceptable value. # * :step - The acceptable value granularity. + # * :include_seconds - Include seconds in the output timestamp format (true by default). + # + # ==== Examples # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#773 + # datetime_field_tag 'name' + # # => + # + # datetime_field_tag 'datetime', '2014-01-01T01:01' + # # => + # + # datetime_field_tag 'datetime', nil, class: 'special_input' + # # => + # + # datetime_field_tag 'datetime', '2014-01-01T01:01', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#804 def datetime_local_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#26 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#28 def default_enforce_utf8; end - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#26 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#28 def default_enforce_utf8=(val); end # Creates a text field of type "email". @@ -7361,13 +8083,13 @@ module ActionView::Helpers::FormTagHelper # email_field_tag 'email', 'email@example.com', class: 'special_input', disabled: true # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#847 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#902 def email_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#23 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#25 def embed_authenticity_token_in_remote_forms; end - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#23 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#25 def embed_authenticity_token_in_remote_forms=(val); end # Generate an HTML id attribute value for the given name and @@ -7377,16 +8099,16 @@ module ActionView::Helpers::FormTagHelper # attribute name. # # <%= label_tag :post, :title %> - # <%= text_field_tag :post, :title, aria: { describedby: field_id(:post, :title, :error) } %> + # <%= text_field :post, :title, aria: { describedby: field_id(:post, :title, :error) } %> # <%= tag.span("is blank", id: field_id(:post, :title, :error) %> # # In the example above, the element built by - # the call to text_field_tag declares an + # the call to text_field declares an # aria-describedby attribute referencing the # element, sharing a common id root (post_title, in this # case). # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#99 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#101 def field_id(object_name, method_name, *suffixes, index: T.unsafe(nil), namespace: T.unsafe(nil)); end # Generate an HTML name attribute value for the given name and @@ -7395,13 +8117,13 @@ module ActionView::Helpers::FormTagHelper # Return the value generated by the FormBuilder for the given # attribute name. # - # <%= text_field_tag :post, :title, name: field_name(:post, :title, :subtitle) %> - # <%# => + # <%= text_field :post, :title, name: field_name(:post, :title, :subtitle) %> + # <%# => %> # - # <%= text_field_tag :post, :tag, name: field_name(:post, :tag, multiple: true) %> - # <%# => + # <%= text_field :post, :tag, name: field_name(:post, :tag, multiple: true) %> + # <%# => %> # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#129 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#131 def field_name(object_name, method_name, *method_names, multiple: T.unsafe(nil), index: T.unsafe(nil)); end # Creates a field set for grouping HTML form elements. @@ -7425,9 +8147,33 @@ module ActionView::Helpers::FormTagHelper # <% end %> # # =>

    # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#650 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#643 def field_set_tag(legend = T.unsafe(nil), options = T.unsafe(nil), &block); end + # Creates a field set for grouping HTML form elements. + # + # legend will become the fieldset's title (optional as per W3C). + # options accept the same values as tag. + # + # ==== Examples + # <%= field_set_tag do %> + #

    <%= text_field_tag 'name' %>

    + # <% end %> + # # =>

    + # + # <%= field_set_tag 'Your details' do %> + #

    <%= text_field_tag 'name' %>

    + # <% end %> + # # =>
    Your details

    + # + # <%= field_set_tag nil, class: 'format' do %> + #

    <%= text_field_tag 'name' %>

    + # <% end %> + # # =>

    + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#650 + def fieldset_tag(legend = T.unsafe(nil), options = T.unsafe(nil), &block); end + # Creates a file upload field. If you are using file uploads then you will also need # to set the multipart option for the form tag: # @@ -7464,7 +8210,7 @@ module ActionView::Helpers::FormTagHelper # file_field_tag 'file', accept: 'text/html', class: 'upload', value: 'index.html' # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#344 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#350 def file_field_tag(name, options = T.unsafe(nil)); end # Starts a form tag that points the action to a URL configured with url_for_options just like @@ -7514,7 +8260,7 @@ module ActionView::Helpers::FormTagHelper # form_tag('http://far.away.com/form', authenticity_token: "cf50faa3fe97702ca1ae") # # form with custom authenticity token # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#75 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#77 def form_tag(url_for_options = T.unsafe(nil), options = T.unsafe(nil), &block); end # Creates a hidden form input field used to transmit data that would be lost due to HTTP's statelessness or @@ -7534,7 +8280,7 @@ module ActionView::Helpers::FormTagHelper # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#305 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#307 def hidden_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end # Displays an image which when clicked will submit the form. @@ -7568,7 +8314,7 @@ module ActionView::Helpers::FormTagHelper # image_submit_tag("save.png", data: { confirm: "Are you sure?" }) # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#624 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#617 def image_submit_tag(source, options = T.unsafe(nil)); end # Creates a label element. Accepts a block. @@ -7586,7 +8332,7 @@ module ActionView::Helpers::FormTagHelper # label_tag 'name', nil, class: 'small_label' # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#278 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#280 def label_tag(name = T.unsafe(nil), content_or_options = T.unsafe(nil), options = T.unsafe(nil), &block); end # Creates a text field of type "month". @@ -7599,7 +8345,21 @@ module ActionView::Helpers::FormTagHelper # * :max - The maximum acceptable value. # * :step - The acceptable value granularity. # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#788 + # ==== Examples + # + # month_field_tag 'name' + # # => + # + # month_field_tag 'month', '2014-01' + # # => + # + # month_field_tag 'month', nil, class: 'special_input' + # # => + # + # month_field_tag 'month', '2014-01', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#829 def month_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end # Creates a number field. @@ -7647,7 +8407,7 @@ module ActionView::Helpers::FormTagHelper # number_field_tag 'quantity', '1', class: 'special_input', disabled: true # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#895 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#950 def number_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end # Creates a password field, a masked text field that will hide the users input behind a mask character. @@ -7680,7 +8440,7 @@ module ActionView::Helpers::FormTagHelper # password_field_tag 'pin', '1234', maxlength: 4, size: 6, class: "pin_input" # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#377 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#383 def password_field_tag(name = T.unsafe(nil), value = T.unsafe(nil), options = T.unsafe(nil)); end # Creates a text field of type "tel". @@ -7703,13 +8463,18 @@ module ActionView::Helpers::FormTagHelper # telephone_field_tag 'tel', '0123456789', class: 'special_input', disabled: true # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#722 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#720 def phone_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + # :call-seq: + # radio_button_tag(name, value, options = {}) + # radio_button_tag(name, value, checked, options = {}) + # # Creates a radio button; use groups of radio buttons named the same to allow users to # select from a group of options. # # ==== Options + # * :checked - If set to true, the radio button will be selected by default. # * :disabled - If set to true, the user will not be able to use this input. # * Any other key creates standard HTML options for the tag. # @@ -7726,8 +8491,8 @@ module ActionView::Helpers::FormTagHelper # radio_button_tag 'color', "green", true, class: "color_input" # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#469 - def radio_button_tag(name, value, checked = T.unsafe(nil), options = T.unsafe(nil)); end + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#496 + def radio_button_tag(name, value, *args); end # Creates a range form element. # @@ -7735,7 +8500,18 @@ module ActionView::Helpers::FormTagHelper # # Supports the same options as #number_field_tag. # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#909 + # ==== Examples + # + # range_field_tag 'quantity', '1' + # # => + # + # range_field_tag 'quantity', in: 1...10 + # # => + # + # range_field_tag 'quantity', min: 1, max: 10, step: 2 + # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#699 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#694 def search_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end # Creates a dropdown selection box, or if the :multiple option is set to true, a multiple @@ -7817,7 +8593,7 @@ module ActionView::Helpers::FormTagHelper # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#198 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#200 def select_tag(name, option_tags = T.unsafe(nil), options = T.unsafe(nil)); end # Creates a submit button with the text value as the caption. @@ -7843,26 +8619,7 @@ module ActionView::Helpers::FormTagHelper # submit_tag "Edit", class: "edit_button" # # => # - # ==== Deprecated: Rails UJS attributes - # - # Prior to Rails 7, Rails shipped with the JavaScript library called @rails/ujs on by default. Following Rails 7, - # this library is no longer on by default. This library integrated with the following options: - # - # * confirm: 'question?' - If present the unobtrusive JavaScript - # drivers will provide a prompt with the question specified. If the user accepts, - # the form is processed normally, otherwise no action is taken. - # * :disable_with - Value of this parameter will be used as the value for a - # disabled version of the submit button when the form is submitted. This feature is - # provided by the unobtrusive JavaScript driver. To disable this feature for a single submit tag - # pass :data => { disable_with: false } Defaults to value attribute. - # - # submit_tag "Complete sale", data: { disable_with: "Submitting..." } - # # => - # - # submit_tag "Save", data: { confirm: "Are you sure?" } - # # => - # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#517 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#530 def submit_tag(value = T.unsafe(nil), options = T.unsafe(nil)); end # Creates a text field of type "tel". @@ -7885,7 +8642,7 @@ module ActionView::Helpers::FormTagHelper # telephone_field_tag 'tel', '0123456789', class: 'special_input', disabled: true # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#722 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#717 def telephone_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end # Creates a text input area; use a textarea for longer text inputs such as blog posts or descriptions. @@ -7900,25 +8657,25 @@ module ActionView::Helpers::FormTagHelper # * Any other key creates standard HTML attributes for the tag. # # ==== Examples - # text_area_tag 'post' + # textarea_tag 'post' # # => # - # text_area_tag 'bio', @user.bio + # textarea_tag 'bio', @user.bio # # => # - # text_area_tag 'body', nil, rows: 10, cols: 25 + # textarea_tag 'body', nil, rows: 10, cols: 25 # # => # - # text_area_tag 'body', nil, size: "25x10" + # textarea_tag 'body', nil, size: "25x10" # # => # - # text_area_tag 'description', "Description goes here.", disabled: true + # textarea_tag 'description', "Description goes here.", disabled: true # # => # - # text_area_tag 'comment', nil, class: 'comment_input' + # textarea_tag 'comment', nil, class: 'comment_input' # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#410 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#428 def text_area_tag(name, content = T.unsafe(nil), options = T.unsafe(nil)); end # Creates a standard text field; use these text fields to input smaller chunks of text like a username @@ -7958,9 +8715,42 @@ module ActionView::Helpers::FormTagHelper # text_field_tag 'ip', '0.0.0.0', maxlength: 15, size: 20, class: "ip-input" # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#260 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#262 def text_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + # Creates a text input area; use a textarea for longer text inputs such as blog posts or descriptions. + # + # ==== Options + # * :size - A string specifying the dimensions (columns by rows) of the textarea (e.g., "25x10"). + # * :rows - Specify the number of rows in the textarea + # * :cols - Specify the number of columns in the textarea + # * :disabled - If set to true, the user will not be able to use this input. + # * :escape - By default, the contents of the text input are HTML escaped. + # If you need unescaped contents, set this to false. + # * Any other key creates standard HTML attributes for the tag. + # + # ==== Examples + # textarea_tag 'post' + # # => + # + # textarea_tag 'bio', @user.bio + # # => + # + # textarea_tag 'body', nil, rows: 10, cols: 25 + # # => + # + # textarea_tag 'body', nil, size: "25x10" + # # => + # + # textarea_tag 'description', "Description goes here.", disabled: true + # # => + # + # textarea_tag 'comment', nil, class: 'comment_input' + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#416 + def textarea_tag(name, content = T.unsafe(nil), options = T.unsafe(nil)); end + # Creates a text field of type "time". # # ==== Options @@ -7972,7 +8762,24 @@ module ActionView::Helpers::FormTagHelper # * :step - The acceptable value granularity. # * :include_seconds - Include seconds and ms in the output timestamp format (true by default). # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#760 + # ==== Examples + # + # time_field_tag 'name' + # # => + # + # time_field_tag 'time', '01:01' + # # => + # + # time_field_tag 'time', nil, class: 'special_input' + # # => + # + # time_field_tag 'time', '01:01', include_seconds: true + # # => + # + # time_field_tag 'time', '01:01', min: '00:00', max: '23:59', step: 1 + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#772 def time_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end # Creates a text field of type "url". @@ -7995,13 +8802,13 @@ module ActionView::Helpers::FormTagHelper # url_field_tag 'url', 'http://rubyonrails.org', class: 'special_input', disabled: true # # => # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#824 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#879 def url_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end # Creates the hidden UTF-8 enforcer tag. Override this method in a helper # to customize the tag. # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#915 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#981 def utf8_enforcer_tag; end # Creates a text field of type "week". @@ -8014,51 +8821,73 @@ module ActionView::Helpers::FormTagHelper # * :max - The maximum acceptable value. # * :step - The acceptable value granularity. # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#801 + # ==== Examples + # + # week_field_tag 'name' + # # => + # + # week_field_tag 'week', '2014-W01' + # # => + # + # week_field_tag 'week', nil, class: 'special_input' + # # => + # + # week_field_tag 'week', '2014-W01', class: 'special_input', disabled: true + # # => + # + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#856 def week_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end private - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#1011 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#1083 def convert_direct_upload_option_to_url(options); end - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#950 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#1021 def extra_tags_for_form(html_options); end - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#980 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#1051 def form_tag_html(html_options); end - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#985 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#1057 def form_tag_with_body(html_options, content); end - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#923 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#994 def html_options_for_form(url_for_options, options); end # see http://www.w3.org/TR/html4/types.html#type-name # - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#992 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#1064 def sanitize_to_id(name); end - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#996 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#1068 def set_default_disable_with(value, tag_options); end class << self - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#26 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#28 def default_enforce_utf8; end - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#26 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#28 def default_enforce_utf8=(val); end - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#23 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#25 def embed_authenticity_token_in_remote_forms; end - # source://actionview//lib/action_view/helpers/form_tag_helper.rb#23 + # source://actionview//lib/action_view/helpers/form_tag_helper.rb#25 def embed_authenticity_token_in_remote_forms=(val); end end end -# source://actionview//lib/action_view/helpers/javascript_helper.rb#5 +# = Action View JavaScript \Helpers +# +# source://actionview//lib/action_view/helpers/javascript_helper.rb#6 module ActionView::Helpers::JavaScriptHelper + # source://actionview//lib/action_view/helpers/javascript_helper.rb#7 + def auto_include_nonce; end + + # source://actionview//lib/action_view/helpers/javascript_helper.rb#7 + def auto_include_nonce=(val); end + # Escapes carriage returns and single and double quotes for JavaScript segments. # # Also available through the alias j(). This is particularly helpful in JavaScript @@ -8066,7 +8895,7 @@ module ActionView::Helpers::JavaScriptHelper # # $('some_element').replaceWith('<%= j render 'some/element_template' %>'); # - # source://actionview//lib/action_view/helpers/javascript_helper.rb#27 + # source://actionview//lib/action_view/helpers/javascript_helper.rb#30 def escape_javascript(javascript); end # Escapes carriage returns and single and double quotes for JavaScript segments. @@ -8076,10 +8905,10 @@ module ActionView::Helpers::JavaScriptHelper # # $('some_element').replaceWith('<%= j render 'some/element_template' %>'); # - # source://actionview//lib/action_view/helpers/javascript_helper.rb#27 + # source://actionview//lib/action_view/helpers/javascript_helper.rb#40 def j(javascript); end - # source://actionview//lib/action_view/helpers/javascript_helper.rb#90 + # source://actionview//lib/action_view/helpers/javascript_helper.rb#95 def javascript_cdata_section(content); end # Returns a JavaScript tag with the +content+ inside. Example: @@ -8118,13 +8947,23 @@ module ActionView::Helpers::JavaScriptHelper # alert('All is good') # <% end -%> # - # source://actionview//lib/action_view/helpers/javascript_helper.rb#74 + # source://actionview//lib/action_view/helpers/javascript_helper.rb#77 def javascript_tag(content_or_options_with_block = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + class << self + # source://actionview//lib/action_view/helpers/javascript_helper.rb#7 + def auto_include_nonce; end + + # source://actionview//lib/action_view/helpers/javascript_helper.rb#7 + def auto_include_nonce=(val); end + end end -# source://actionview//lib/action_view/helpers/javascript_helper.rb#6 +# source://actionview//lib/action_view/helpers/javascript_helper.rb#9 ActionView::Helpers::JavaScriptHelper::JS_ESCAPE_MAP = T.let(T.unsafe(nil), Hash) +# = Action View Number \Helpers +# # Provides methods for converting numbers into formatted strings. # Methods are provided for phone numbers, currency, percentage, # precision, positional notation, file size, and pretty printing. @@ -8132,445 +8971,162 @@ ActionView::Helpers::JavaScriptHelper::JS_ESCAPE_MAP = T.let(T.unsafe(nil), Hash # Most methods expect a +number+ argument, and will return it # unchanged if can't be converted into a valid number. # -# source://actionview//lib/action_view/helpers/number_helper.rb#16 +# source://actionview//lib/action_view/helpers/number_helper.rb#17 module ActionView::Helpers::NumberHelper - # Formats a +number+ into a currency string (e.g., $13.65). You - # can customize the format in the +options+ hash. + # Delegates to ActiveSupport::NumberHelper#number_to_currency. # - # The currency unit and number formatting of the current locale will be used - # unless otherwise specified in the provided options. No currency conversion - # is performed. If the user is given a way to change their locale, they will - # also be able to change the relative value of the currency displayed with - # this helper. If your application will ever support multiple locales, you - # may want to specify a constant :locale option or consider - # using a library capable of currency conversion. + # number_to_currency("1234") # => "$1234.00" # - # ==== Options - # - # * :locale - Sets the locale to be used for formatting - # (defaults to current locale). - # * :precision - Sets the level of precision (defaults - # to 2). - # * :unit - Sets the denomination of the currency - # (defaults to "$"). - # * :separator - Sets the separator between the units - # (defaults to "."). - # * :delimiter - Sets the thousands delimiter (defaults - # to ","). - # * :format - Sets the format for non-negative numbers - # (defaults to "%u%n"). Fields are %u for the - # currency, and %n for the number. - # * :negative_format - Sets the format for negative - # numbers (defaults to prepending a hyphen to the formatted - # number given by :format). Accepts the same fields - # than :format, except %n is here the - # absolute value of the number. - # * :raise - If true, raises +InvalidNumberError+ when - # the argument is invalid. - # * :strip_insignificant_zeros - If +true+ removes - # insignificant zeros after the decimal separator (defaults to - # +false+). + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: # - # ==== Examples + # number_to_currency("12x34") # => "$12x34" + # number_to_currency("12x34", raise: true) # => InvalidNumberError # - # number_to_currency(1234567890.50) # => $1,234,567,890.50 - # number_to_currency(1234567890.506) # => $1,234,567,890.51 - # number_to_currency(1234567890.506, precision: 3) # => $1,234,567,890.506 - # number_to_currency(1234567890.506, locale: :fr) # => 1 234 567 890,51 € - # number_to_currency("123a456") # => $123a456 - # - # number_to_currency("123a456", raise: true) # => InvalidNumberError - # - # number_to_currency(-0.456789, precision: 0) - # # => "$0" - # number_to_currency(-1234567890.50, negative_format: "(%u%n)") - # # => ($1,234,567,890.50) - # number_to_currency(1234567890.50, unit: "R$", separator: ",", delimiter: "") - # # => R$1234567890,50 - # number_to_currency(1234567890.50, unit: "R$", separator: ",", delimiter: "", format: "%n %u") - # # => 1234567890,50 R$ - # number_to_currency(1234567890.50, strip_insignificant_zeros: true) - # # => "$1,234,567,890.5" - # - # source://actionview//lib/action_view/helpers/number_helper.rb#127 + # source://actionview//lib/action_view/helpers/number_helper.rb#55 def number_to_currency(number, options = T.unsafe(nil)); end - # Pretty prints (formats and approximates) a number in a way it - # is more readable by humans (e.g.: 1200000000 becomes "1.2 - # Billion"). This is useful for numbers that can get very large - # (and too hard to read). - # - # See number_to_human_size if you want to print a file - # size. + # Delegates to ActiveSupport::NumberHelper#number_to_human. # - # You can also define your own unit-quantifier names if you want - # to use other decimal units (e.g.: 1500 becomes "1.5 - # kilometers", 0.150 becomes "150 milliliters", etc). You may - # define a wide range of unit quantifiers, even fractional ones - # (centi, deci, mili, etc). + # number_to_human("1234") # => "1.23 Thousand" # - # ==== Options - # - # * :locale - Sets the locale to be used for formatting - # (defaults to current locale). - # * :precision - Sets the precision of the number - # (defaults to 3). - # * :significant - If +true+, precision will be the number - # of significant_digits. If +false+, the number of fractional - # digits (defaults to +true+) - # * :separator - Sets the separator between the - # fractional and integer digits (defaults to "."). - # * :delimiter - Sets the thousands delimiter (defaults - # to ""). - # * :strip_insignificant_zeros - If +true+ removes - # insignificant zeros after the decimal separator (defaults to - # +true+) - # * :units - A Hash of unit quantifier names. Or a - # string containing an i18n scope where to find this hash. It - # might have the following keys: - # * *integers*: :unit, :ten, - # :hundred, :thousand, :million, - # :billion, :trillion, - # :quadrillion - # * *fractionals*: :deci, :centi, - # :mili, :micro, :nano, - # :pico, :femto - # * :format - Sets the format of the output string - # (defaults to "%n %u"). The field types are: - # * %u - The quantifier (ex.: 'thousand') - # * %n - The number - # * :raise - If true, raises +InvalidNumberError+ when - # the argument is invalid. + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: # - # ==== Examples + # number_to_human("12x34") # => "12x34" + # number_to_human("12x34", raise: true) # => InvalidNumberError # - # number_to_human(123) # => "123" - # number_to_human(1234) # => "1.23 Thousand" - # number_to_human(12345) # => "12.3 Thousand" - # number_to_human(1234567) # => "1.23 Million" - # number_to_human(1234567890) # => "1.23 Billion" - # number_to_human(1234567890123) # => "1.23 Trillion" - # number_to_human(1234567890123456) # => "1.23 Quadrillion" - # number_to_human(1234567890123456789) # => "1230 Quadrillion" - # number_to_human(489939, precision: 2) # => "490 Thousand" - # number_to_human(489939, precision: 4) # => "489.9 Thousand" - # number_to_human(1234567, precision: 4, - # significant: false) # => "1.2346 Million" - # number_to_human(1234567, precision: 1, - # separator: ',', - # significant: false) # => "1,2 Million" - # - # number_to_human(500000000, precision: 5) # => "500 Million" - # number_to_human(12345012345, significant: false) # => "12.345 Billion" - # - # Non-significant zeros after the decimal separator are stripped - # out by default (set :strip_insignificant_zeros to - # +false+ to change that): - # - # number_to_human(12.00001) # => "12" - # number_to_human(12.00001, strip_insignificant_zeros: false) # => "12.0" - # - # ==== Custom Unit Quantifiers - # - # You can also use your own custom unit quantifiers: - # number_to_human(500000, units: {unit: "ml", thousand: "lt"}) # => "500 lt" - # - # If in your I18n locale you have: - # distance: - # centi: - # one: "centimeter" - # other: "centimeters" - # unit: - # one: "meter" - # other: "meters" - # thousand: - # one: "kilometer" - # other: "kilometers" - # billion: "gazillion-distance" - # - # Then you could do: - # - # number_to_human(543934, units: :distance) # => "544 kilometers" - # number_to_human(54393498, units: :distance) # => "54400 kilometers" - # number_to_human(54393498000, units: :distance) # => "54.4 gazillion-distance" - # number_to_human(343, units: :distance, precision: 1) # => "300 meters" - # number_to_human(1, units: :distance) # => "1 meter" - # number_to_human(0.34, units: :distance) # => "34 centimeters" - # - # source://actionview//lib/action_view/helpers/number_helper.rb#403 + # source://actionview//lib/action_view/helpers/number_helper.rb#125 def number_to_human(number, options = T.unsafe(nil)); end - # Formats the bytes in +number+ into a more understandable - # representation (e.g., giving it 1500 yields 1.46 KB). This - # method is useful for reporting file sizes to users. You can - # customize the format in the +options+ hash. - # - # See number_to_human if you want to pretty-print a - # generic number. + # Delegates to ActiveSupport::NumberHelper#number_to_human_size. # - # ==== Options + # number_to_human_size("1234") # => "1.21 KB" # - # * :locale - Sets the locale to be used for formatting - # (defaults to current locale). - # * :precision - Sets the precision of the number - # (defaults to 3). - # * :significant - If +true+, precision will be the number - # of significant_digits. If +false+, the number of fractional - # digits (defaults to +true+) - # * :separator - Sets the separator between the - # fractional and integer digits (defaults to "."). - # * :delimiter - Sets the thousands delimiter (defaults - # to ""). - # * :strip_insignificant_zeros - If +true+ removes - # insignificant zeros after the decimal separator (defaults to - # +true+) - # * :raise - If true, raises +InvalidNumberError+ when - # the argument is invalid. + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: # - # ==== Examples + # number_to_human_size("12x34") # => "12x34" + # number_to_human_size("12x34", raise: true) # => InvalidNumberError # - # number_to_human_size(123) # => 123 Bytes - # number_to_human_size(1234) # => 1.21 KB - # number_to_human_size(12345) # => 12.1 KB - # number_to_human_size(1234567) # => 1.18 MB - # number_to_human_size(1234567890) # => 1.15 GB - # number_to_human_size(1234567890123) # => 1.12 TB - # number_to_human_size(1234567890123456) # => 1.1 PB - # number_to_human_size(1234567890123456789) # => 1.07 EB - # number_to_human_size(1234567, precision: 2) # => 1.2 MB - # number_to_human_size(483989, precision: 2) # => 470 KB - # number_to_human_size(1234567, precision: 2, separator: ',') # => 1,2 MB - # number_to_human_size(1234567890123, precision: 5) # => "1.1228 TB" - # number_to_human_size(524288000, precision: 5) # => "500 MB" - # - # source://actionview//lib/action_view/helpers/number_helper.rb#297 + # source://actionview//lib/action_view/helpers/number_helper.rb#111 def number_to_human_size(number, options = T.unsafe(nil)); end - # Formats a +number+ as a percentage string (e.g., 65%). You can - # customize the format in the +options+ hash. - # - # ==== Options + # Delegates to ActiveSupport::NumberHelper#number_to_percentage. # - # * :locale - Sets the locale to be used for formatting - # (defaults to current locale). - # * :precision - Sets the precision of the number - # (defaults to 3). - # * :significant - If +true+, precision will be the number - # of significant_digits. If +false+, the number of fractional - # digits (defaults to +false+). - # * :separator - Sets the separator between the - # fractional and integer digits (defaults to "."). - # * :delimiter - Sets the thousands delimiter (defaults - # to ""). - # * :strip_insignificant_zeros - If +true+ removes - # insignificant zeros after the decimal separator (defaults to - # +false+). - # * :format - Specifies the format of the percentage - # string The number field is %n (defaults to "%n%"). - # * :raise - If true, raises +InvalidNumberError+ when - # the argument is invalid. + # number_to_percentage("99") # => "99.000%" # - # ==== Examples - # - # number_to_percentage(100) # => 100.000% - # number_to_percentage("98") # => 98.000% - # number_to_percentage(100, precision: 0) # => 100% - # number_to_percentage(1000, delimiter: '.', separator: ',') # => 1.000,000% - # number_to_percentage(302.24398923423, precision: 5) # => 302.24399% - # number_to_percentage(1000, locale: :fr) # => 1 000,000% - # number_to_percentage("98a") # => 98a% - # number_to_percentage(100, format: "%n %") # => 100.000 % + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: # - # number_to_percentage("98a", raise: true) # => InvalidNumberError + # number_to_percentage("99x") # => "99x%" + # number_to_percentage("99x", raise: true) # => InvalidNumberError # - # source://actionview//lib/action_view/helpers/number_helper.rb#167 + # source://actionview//lib/action_view/helpers/number_helper.rb#69 def number_to_percentage(number, options = T.unsafe(nil)); end - # Formats a +number+ into a phone number (US by default e.g., (555) - # 123-9876). You can customize the format in the +options+ hash. + # Delegates to ActiveSupport::NumberHelper#number_to_phone. # - # ==== Options + # number_to_phone("1234567890") # => "123-456-7890" # - # * :area_code - Adds parentheses around the area code. - # * :delimiter - Specifies the delimiter to use - # (defaults to "-"). - # * :extension - Specifies an extension to add to the - # end of the generated number. - # * :country_code - Sets the country code for the phone - # number. - # * :pattern - Specifies how the number is divided into three - # groups with the custom regexp to override the default format. - # * :raise - If true, raises +InvalidNumberError+ when - # the argument is invalid. + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: # - # ==== Examples + # number_to_phone("12x34") # => "12x34" + # number_to_phone("12x34", raise: true) # => InvalidNumberError # - # number_to_phone(5551234) # => 555-1234 - # number_to_phone("5551234") # => 555-1234 - # number_to_phone(1235551234) # => 123-555-1234 - # number_to_phone(1235551234, area_code: true) # => (123) 555-1234 - # number_to_phone(1235551234, delimiter: " ") # => 123 555 1234 - # number_to_phone(1235551234, area_code: true, extension: 555) # => (123) 555-1234 x 555 - # number_to_phone(1235551234, country_code: 1) # => +1-123-555-1234 - # number_to_phone("123a456") # => 123a456 - # number_to_phone("1234a567", raise: true) # => InvalidNumberError - # - # number_to_phone(1235551234, country_code: 1, extension: 1343, delimiter: ".") - # # => +1.123.555.1234 x 1343 - # - # number_to_phone(75561234567, pattern: /(\d{1,4})(\d{4})(\d{4})$/, area_code: true) - # # => "(755) 6123-4567" - # number_to_phone(13312345678, pattern: /(\d{3})(\d{4})(\d{4})$/) - # # => "133-1234-5678" - # - # source://actionview//lib/action_view/helpers/number_helper.rb#62 + # source://actionview//lib/action_view/helpers/number_helper.rb#37 def number_to_phone(number, options = T.unsafe(nil)); end - # Formats a +number+ with grouped thousands using +delimiter+ - # (e.g., 12,324). You can customize the format in the +options+ - # hash. + # Delegates to ActiveSupport::NumberHelper#number_to_delimited. # - # ==== Options - # - # * :locale - Sets the locale to be used for formatting - # (defaults to current locale). - # * :delimiter - Sets the thousands delimiter (defaults - # to ","). - # * :separator - Sets the separator between the - # fractional and integer digits (defaults to "."). - # * :delimiter_pattern - Sets a custom regular expression used for - # deriving the placement of delimiter. Helpful when using currency formats - # like INR. - # * :raise - If true, raises +InvalidNumberError+ when - # the argument is invalid. - # - # ==== Examples + # number_with_delimiter("1234") # => "1,234" # - # number_with_delimiter(12345678) # => 12,345,678 - # number_with_delimiter("123456") # => 123,456 - # number_with_delimiter(12345678.05) # => 12,345,678.05 - # number_with_delimiter(12345678, delimiter: ".") # => 12.345.678 - # number_with_delimiter(12345678, delimiter: ",") # => 12,345,678 - # number_with_delimiter(12345678.05, separator: " ") # => 12,345,678 05 - # number_with_delimiter(12345678.05, locale: :fr) # => 12 345 678,05 - # number_with_delimiter("112a") # => 112a - # number_with_delimiter(98765432.98, delimiter: " ", separator: ",") - # # => 98 765 432,98 + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: # - # number_with_delimiter("123456.78", - # delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/) # => "1,23,456.78" + # number_with_delimiter("12x34") # => "12x34" + # number_with_delimiter("12x34", raise: true) # => InvalidNumberError # - # number_with_delimiter("112a", raise: true) # => raise InvalidNumberError - # - # source://actionview//lib/action_view/helpers/number_helper.rb#206 + # source://actionview//lib/action_view/helpers/number_helper.rb#83 def number_with_delimiter(number, options = T.unsafe(nil)); end - # Formats a +number+ with the specified level of - # :precision (e.g., 112.32 has a precision of 2 if - # +:significant+ is +false+, and 5 if +:significant+ is +true+). - # You can customize the format in the +options+ hash. - # - # ==== Options - # - # * :locale - Sets the locale to be used for formatting - # (defaults to current locale). - # * :precision - Sets the precision of the number - # (defaults to 3). - # * :significant - If +true+, precision will be the number - # of significant_digits. If +false+, the number of fractional - # digits (defaults to +false+). - # * :separator - Sets the separator between the - # fractional and integer digits (defaults to "."). - # * :delimiter - Sets the thousands delimiter (defaults - # to ""). - # * :strip_insignificant_zeros - If +true+ removes - # insignificant zeros after the decimal separator (defaults to - # +false+). - # * :raise - If true, raises +InvalidNumberError+ when - # the argument is invalid. + # Delegates to ActiveSupport::NumberHelper#number_to_rounded. # - # ==== Examples - # - # number_with_precision(111.2345) # => 111.235 - # number_with_precision(111.2345, precision: 2) # => 111.23 - # number_with_precision(13, precision: 5) # => 13.00000 - # number_with_precision(389.32314, precision: 0) # => 389 - # number_with_precision(111.2345, significant: true) # => 111 - # number_with_precision(111.2345, precision: 1, significant: true) # => 100 - # number_with_precision(13, precision: 5, significant: true) # => 13.000 - # number_with_precision(111.234, locale: :fr) # => 111,234 + # number_with_precision("1234") # => "1234.000" # - # number_with_precision(13, precision: 5, significant: true, strip_insignificant_zeros: true) - # # => 13 + # Additionally, supports a +:raise+ option that will cause + # InvalidNumberError to be raised if +number+ is not a valid number: # - # number_with_precision(389.32314, precision: 4, significant: true) # => 389.3 - # number_with_precision(1111.2345, precision: 2, separator: ',', delimiter: '.') - # # => 1.111,23 + # number_with_precision("12x34") # => "12x34" + # number_with_precision("12x34", raise: true) # => InvalidNumberError # - # source://actionview//lib/action_view/helpers/number_helper.rb#251 + # source://actionview//lib/action_view/helpers/number_helper.rb#97 def number_with_precision(number, options = T.unsafe(nil)); end private - # source://actionview//lib/action_view/helpers/number_helper.rb#408 + # source://actionview//lib/action_view/helpers/number_helper.rb#130 def delegate_number_helper_method(method, number, options); end - # source://actionview//lib/action_view/helpers/number_helper.rb#427 + # source://actionview//lib/action_view/helpers/number_helper.rb#149 def escape_units(units); end - # source://actionview//lib/action_view/helpers/number_helper.rb#417 + # source://actionview//lib/action_view/helpers/number_helper.rb#139 def escape_unsafe_options(options); end # @raise [InvalidNumberError] # - # source://actionview//lib/action_view/helpers/number_helper.rb#450 + # source://actionview//lib/action_view/helpers/number_helper.rb#172 def parse_float(number, raise_error); end # @return [Boolean] # - # source://actionview//lib/action_view/helpers/number_helper.rb#446 + # source://actionview//lib/action_view/helpers/number_helper.rb#168 def valid_float?(number); end # @raise [InvalidNumberError] # - # source://actionview//lib/action_view/helpers/number_helper.rb#433 + # source://actionview//lib/action_view/helpers/number_helper.rb#155 def wrap_with_output_safety_handling(number, raise_on_invalid, &block); end end # Raised when argument +number+ param given to the helpers is invalid and # the option +:raise+ is set to +true+. # -# source://actionview//lib/action_view/helpers/number_helper.rb#19 +# source://actionview//lib/action_view/helpers/number_helper.rb#20 class ActionView::Helpers::NumberHelper::InvalidNumberError < ::StandardError # @return [InvalidNumberError] a new instance of InvalidNumberError # - # source://actionview//lib/action_view/helpers/number_helper.rb#21 + # source://actionview//lib/action_view/helpers/number_helper.rb#22 def initialize(number); end # Returns the value of attribute number. # - # source://actionview//lib/action_view/helpers/number_helper.rb#20 + # source://actionview//lib/action_view/helpers/number_helper.rb#21 def number; end # Sets the attribute number # # @param value the value to set the attribute number to. # - # source://actionview//lib/action_view/helpers/number_helper.rb#20 + # source://actionview//lib/action_view/helpers/number_helper.rb#21 def number=(_arg0); end end +# = Action View Raw Output \Helpers +# # source://actionview//lib/action_view/helpers/output_safety_helper.rb#8 module ActionView::Helpers::OutputSafetyHelper # 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 # escape tags. This is not recommended if the data is coming from the user's # input. # # For example: # - # raw @user.name - # # => 'Jimmy Tables' + # raw @user.name + # # => 'Jimmy Tables' # # source://actionview//lib/action_view/helpers/output_safety_helper.rb#18 def raw(stringish); end @@ -8580,110 +9136,209 @@ module ActionView::Helpers::OutputSafetyHelper # the supplied separator, are HTML escaped unless they are HTML # safe, and the returned string is marked as HTML safe. # - # safe_join([raw("

    foo

    "), "

    bar

    "], "
    ") - # # => "

    foo

    <br /><p>bar</p>" + # safe_join([tag.p("foo"), "

    bar

    "], "
    ") + # # => "

    foo

    <br><p>bar</p>" # - # safe_join([raw("

    foo

    "), raw("

    bar

    ")], raw("
    ")) - # # => "

    foo


    bar

    " + # safe_join([tag.p("foo"), tag.p("bar")], tag.br) + # # => "

    foo


    bar

    " # # source://actionview//lib/action_view/helpers/output_safety_helper.rb#33 def safe_join(array, sep = T.unsafe(nil)); end # Converts the array to a comma-separated sentence where the last element is # joined by the connector word. This is the html_safe-aware version of - # ActiveSupport's {Array#to_sentence}[https://api.rubyonrails.org/classes/Array.html#method-i-to_sentence]. + # ActiveSupport's Array#to_sentence. # - # source://actionview//lib/action_view/helpers/output_safety_helper.rb#43 + # source://actionview//lib/action_view/helpers/output_safety_helper.rb#42 def to_sentence(array, options = T.unsafe(nil)); end end -# = Action View Rendering +# # Action View Rendering Helpers # -# Implements methods that allow rendering from a view context. -# In order to use this module, all you need is to implement -# view_renderer that returns an ActionView::Renderer object. +# Implements methods that allow rendering from a view context. In order to use +# this module, all you need is to implement view_renderer that returns an +# ActionView::Renderer object. # -# source://actionview//lib/action_view/helpers/rendering_helper.rb#10 +# source://actionview//lib/action_view/helpers/rendering_helper.rb#12 module ActionView::Helpers::RenderingHelper # Overrides _layout_for in the context object so it supports the case a block is - # passed to a partial. Returns the contents that are yielded to a layout, given a - # name or a block. + # passed to a partial. Returns the contents that are yielded to a layout, given + # a name or a block. # - # You can think of a layout as a method that is called with a block. If the user calls - # yield :some_name, the block, by default, returns content_for(:some_name). - # If the user calls simply +yield+, the default block returns content_for(:layout). + # You can think of a layout as a method that is called with a block. If the user + # calls `yield :some_name`, the block, by default, returns + # `content_for(:some_name)`. If the user calls simply `yield`, the default block + # returns `content_for(:layout)`. # # The user can override this default by passing a block to the layout: # - # # The template - # <%= render layout: "my_layout" do %> - # Content - # <% end %> + # # The template + # <%= render layout: "my_layout" do %> + # Content + # <% end %> # - # # The layout - # - # <%= yield %> - # + # # The layout + # + # <%= yield %> + # # - # In this case, instead of the default block, which would return content_for(:layout), - # this method returns the block that was passed in to render :layout, and the response + # In this case, instead of the default block, which would return `content_for(:layout)`, + # this method returns the block that was passed in to `render :layout`, and the response # would be # - # - # Content - # + # + # Content + # # - # Finally, the block can take block arguments, which can be passed in by +yield+: + # Finally, the block can take block arguments, which can be passed in by + # `yield`: # - # # The template - # <%= render layout: "my_layout" do |customer| %> - # Hello <%= customer.name %> - # <% end %> + # # The template + # <%= render layout: "my_layout" do |customer| %> + # Hello <%= customer.name %> + # <% end %> # - # # The layout - # - # <%= yield Struct.new(:name).new("David") %> - # + # # The layout + # + # <%= yield Struct.new(:name).new("David") %> + # # - # In this case, the layout would receive the block passed into render :layout, + # In this case, the layout would receive the block passed into `render :layout`, # and the struct specified would be passed into the block as an argument. The result # would be # - # - # Hello David - # + # + # Hello David + # # - # source://actionview//lib/action_view/helpers/rendering_helper.rb#97 + # source://actionview//lib/action_view/helpers/rendering_helper.rb#207 def _layout_for(*args, &block); end - # Returns the result of a render that's dictated by the options hash. The primary options are: + # Renders a template and returns the result. + # + # Pass the template to render as the first argument. This is shorthand + # syntax for partial rendering, so the template filename should be + # prefixed with an underscore. The partial renderer looks for the partial + # template in the directory of the calling template first. + # + # <% # app/views/posts/new.html.erb %> + # <%= render "form" %> + # # => renders app/views/posts/_form.html.erb + # + # Use the complete view path to render a partial from another directory. + # + # <% # app/views/posts/show.html.erb %> + # <%= render "comments/form" %> + # # => renders app/views/comments/_form.html.erb + # + # Without the rendering mode, the second argument can be a Hash of local + # variable assignments for the template. + # + # <% # app/views/posts/new.html.erb %> + # <%= render "form", post: Post.new %> + # # => renders app/views/posts/_form.html.erb + # + # If the first argument responds to `render_in`, the template will be rendered + # by calling `render_in` with the current view context. + # + # class Greeting + # def render_in(view_context) + # view_context.render html: "

    Hello, World

    " + # end + # + # def format + # :html + # end + # end + # + # <%= render Greeting.new %> + # # => "

    Hello, World

    " + # + # #### Rendering Mode + # + # Pass the rendering mode as first argument to override it. + # + # `:partial` + # + # <%= render partial: "form", locals: { post: Post.new } %> + # # => renders app/views/posts/_form.html.erb + # + # `:file` + # unsanitized user input. + # + # <%= render file: "/path/to/some/file" %> + # # => renders /path/to/some/file + # + # `:inline` + # + # <% name = "World" %> + # <%= render inline: "

    Hello, <%= name %>!

    " %> + # # => renders "

    Hello, World!

    " + # + # `:body` + # + # <%= render body: "Hello, World!" %> + # # => renders "Hello, World!" + # + # `:plain` + # + # <%= render plain: "Hello, World!" %> + # # => renders "Hello, World!" + # + # `:html` + # `:html`. If the string is not `html_safe?`, performs HTML escaping on + # the string before rendering. + # + # <%= render html: "

    Hello, World!

    ".html_safe %> + # # => renders "

    Hello, World!

    " + # + # <%= render html: "

    Hello, World!

    " %> + # # => renders "<h1>Hello, World!</h1>" + # + # `:renderable` + # context. The format is determined by calling `format` on the + # renderable if it responds to `format`, falling back to `:html` by + # default. # - # * :partial - See ActionView::PartialRenderer. - # * :file - Renders an explicit template file (this used to be the old default), add +:locals+ to pass in those. - # * :inline - Renders an inline template similar to how it's done in the controller. - # * :plain - Renders the text passed in out. Setting the content - # type as text/plain. - # * :html - Renders the HTML safe string passed in out, otherwise - # performs HTML escape on the string first. Setting the content type as - # text/html. - # * :body - Renders the text passed in, and inherits the content - # type of text/plain from ActionDispatch::Response object. + # <%= render renderable: Greeting.new %> + # # => renders "

    Hello, World

    " # - # If no options hash is passed or if :update is specified, then: # - # If an object responding to +render_in+ is passed, +render_in+ is called on the object, - # passing in the current view context. + # #### Options # - # Otherwise, a partial is rendered using the second parameter as the locals hash. + # `:locals` # - # source://actionview//lib/action_view/helpers/rendering_helper.rb#30 + # <%= render inline: "

    Hello, <%= name %>!

    ", locals: { name: "World" } %> + # # => renders "

    Hello, World!

    " + # + # `:formats` + # + # <% # app/views/posts/show.html.erb %> + # <%= render template: "posts/content", formats: [:text] %> + # # => renders app/views/posts/content.text.erb + # + # `:variants` + # + # <% # app/views/posts/show.html.erb %> + # <%= render template: "posts/content", variants: [:tablet] %> + # # => renders app/views/posts/content.html+tablet.erb + # + # `:handlers` + # + # <% # app/views/posts/show.html.erb %> + # <%= render template: "posts/content", handlers: [:builder] %> + # # => renders app/views/posts/content.html.builder + # + # source://actionview//lib/action_view/helpers/rendering_helper.rb#138 def render(options = T.unsafe(nil), locals = T.unsafe(nil), &block); end end +# = Action View Sanitize \Helpers +# # 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. # -# source://actionview//lib/action_view/helpers/sanitize_helper.rb#10 +# source://actionview//lib/action_view/helpers/sanitize_helper.rb#11 module ActionView::Helpers::SanitizeHelper extend ::ActiveSupport::Concern @@ -8691,41 +9346,51 @@ module ActionView::Helpers::SanitizeHelper # Sanitizes HTML input, stripping all but known-safe tags and attributes. # - # It also strips href/src attributes with unsafe protocols like - # javascript:, while also protecting against attempts to use Unicode, - # ASCII, and hex character references to work around these protocol filters. - # All special characters will be escaped. + # It also strips +href+ / +src+ attributes with unsafe protocols like +javascript:+, while + # also protecting against attempts to use Unicode, ASCII, and hex character references to work + # around these protocol filters. # - # The default sanitizer is Rails::Html::SafeListSanitizer. See {Rails HTML + # The default sanitizer is +Rails::HTML5::SafeListSanitizer+. See {Rails HTML # Sanitizers}[https://github.com/rails/rails-html-sanitizer] for more information. # # Custom sanitization rules can also be provided. # + # Warning: Adding disallowed tags or attributes to the allowlists may introduce + # vulnerabilities into your application. Please rely on the default allowlists whenever + # possible, because they are curated to maintain security and safety. If you think that the + # default allowlists should be expanded, please {open an issue on the rails-html-sanitizer + # project}[https://github.com/rails/rails-html-sanitizer/issues]. + # # Please note that sanitizing user-provided text does not guarantee that the # resulting markup is valid or even well-formed. # # ==== Options # - # * :tags - An array of allowed tags. - # * :attributes - An array of allowed attributes. - # * :scrubber - A {Rails::Html scrubber}[https://github.com/rails/rails-html-sanitizer] + # [+:tags+] + # An array of allowed tags. + # + # [+:attributes+] + # An array of allowed attributes. + # + # [+:scrubber+] + # A {Rails::HTML scrubber}[https://github.com/rails/rails-html-sanitizer] # or {Loofah::Scrubber}[https://github.com/flavorjones/loofah] object that # defines custom sanitization rules. A custom scrubber takes precedence over # custom tags and attributes. # # ==== Examples # - # Normal use: + # ===== Normal use # # <%= sanitize @comment.body %> # - # Providing custom lists of permitted tags and attributes: + # ===== Providing custom lists of permitted tags and attributes # # <%= sanitize @comment.body, tags: %w(strong em a), attributes: %w(href) %> # - # Providing a custom Rails::Html scrubber: + # ===== Providing a custom +Rails::HTML+ scrubber # - # class CommentScrubber < Rails::Html::PermitScrubber + # class CommentScrubber < Rails::HTML::PermitScrubber # def initialize # super # self.tags = %w( form script comment blockquote ) @@ -8737,21 +9402,27 @@ module ActionView::Helpers::SanitizeHelper # end # end # + # + # # <%= sanitize @comment.body, scrubber: CommentScrubber.new %> # # See {Rails HTML Sanitizer}[https://github.com/rails/rails-html-sanitizer] for - # documentation about Rails::Html scrubbers. + # documentation about +Rails::HTML+ scrubbers. # - # Providing a custom Loofah::Scrubber: + # ===== Providing a custom +Loofah::Scrubber+ # # scrubber = Loofah::Scrubber.new do |node| # node.remove if node.name == 'script' # end # + # + # # <%= sanitize @comment.body, scrubber: scrubber %> # # See {Loofah's documentation}[https://github.com/flavorjones/loofah] for more - # information about defining custom Loofah::Scrubber objects. + # information about defining custom +Loofah::Scrubber+ objects. + # + # ==== Global Configuration # # To set the default allowed tags or attributes across your application: # @@ -8759,14 +9430,36 @@ module ActionView::Helpers::SanitizeHelper # config.action_view.sanitized_allowed_tags = ['strong', 'em', 'a'] # config.action_view.sanitized_allowed_attributes = ['href', 'title'] # - # source://actionview//lib/action_view/helpers/sanitize_helper.rb#81 + # The default, starting in \Rails 7.1, is to use an HTML5 parser for sanitization (if it is + # available, see NOTE below). If you wish to revert back to the previous HTML4 behavior, you + # can do so by setting the following in your application configuration: + # + # # In config/application.rb + # config.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer + # + # Or, if you're upgrading from a previous version of \Rails and wish to opt into the HTML5 + # behavior: + # + # # In config/application.rb + # config.action_view.sanitizer_vendor = Rails::HTML5::Sanitizer + # + # NOTE: +Rails::HTML5::Sanitizer+ is not supported on JRuby, so on JRuby platforms \Rails will + # fall back to using +Rails::HTML4::Sanitizer+. + # + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#117 def sanitize(html, options = T.unsafe(nil)); end - # Sanitizes a block of CSS code. Used by +sanitize+ when it comes across a style attribute. + # Sanitizes a block of CSS code. Used by #sanitize when it comes across a style attribute. # - # source://actionview//lib/action_view/helpers/sanitize_helper.rb#86 + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#122 def sanitize_css(style); end + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#12 + def sanitizer_vendor; end + + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#12 + def sanitizer_vendor=(val); end + # Strips all link tags from +html+ leaving just the link text. # # strip_links('Ruby on Rails') @@ -8781,7 +9474,7 @@ module ActionView::Helpers::SanitizeHelper # strip_links('<malformed & link') # # => <malformed & link # - # source://actionview//lib/action_view/helpers/sanitize_helper.rb#120 + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#156 def strip_links(html); end # Strips all HTML tags from +html+, including comments and special characters. @@ -8798,130 +9491,87 @@ module ActionView::Helpers::SanitizeHelper # strip_tags("> A quote from Smith & Wesson") # # => > A quote from Smith & Wesson # - # source://actionview//lib/action_view/helpers/sanitize_helper.rb#103 + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#139 def strip_tags(html); end + + class << self + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#12 + def sanitizer_vendor; end + + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#12 + def sanitizer_vendor=(val); end + end end -# source://actionview//lib/action_view/helpers/sanitize_helper.rb#124 +# source://actionview//lib/action_view/helpers/sanitize_helper.rb#160 module ActionView::Helpers::SanitizeHelper::ClassMethods - # Gets the Rails::Html::FullSanitizer instance used by +strip_tags+. Replace with + # Gets the Rails::HTML::FullSanitizer instance used by +strip_tags+. Replace with # any object that responds to +sanitize+. # # class Application < Rails::Application # config.action_view.full_sanitizer = MySpecialSanitizer.new # end # - # source://actionview//lib/action_view/helpers/sanitize_helper.rb#145 + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#181 def full_sanitizer; end # Sets the attribute full_sanitizer # # @param value the value to set the attribute full_sanitizer to. # - # source://actionview//lib/action_view/helpers/sanitize_helper.rb#125 + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#161 def full_sanitizer=(_arg0); end - # Gets the Rails::Html::LinkSanitizer instance used by +strip_links+. + # Gets the Rails::HTML::LinkSanitizer instance used by +strip_links+. # Replace with any object that responds to +sanitize+. # # class Application < Rails::Application # config.action_view.link_sanitizer = MySpecialSanitizer.new # end # - # source://actionview//lib/action_view/helpers/sanitize_helper.rb#155 + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#191 def link_sanitizer; end # Sets the attribute link_sanitizer # # @param value the value to set the attribute link_sanitizer to. # - # source://actionview//lib/action_view/helpers/sanitize_helper.rb#125 + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#161 def link_sanitizer=(_arg0); end - # Gets the Rails::Html::SafeListSanitizer instance used by sanitize and +sanitize_css+. + # Gets the Rails::HTML::SafeListSanitizer instance used by sanitize and +sanitize_css+. # Replace with any object that responds to +sanitize+. # # class Application < Rails::Application # config.action_view.safe_list_sanitizer = MySpecialSanitizer.new # end # - # source://actionview//lib/action_view/helpers/sanitize_helper.rb#165 + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#201 def safe_list_sanitizer; end # Sets the attribute safe_list_sanitizer # # @param value the value to set the attribute safe_list_sanitizer to. # - # source://actionview//lib/action_view/helpers/sanitize_helper.rb#125 + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#161 def safe_list_sanitizer=(_arg0); end - # source://actionview//lib/action_view/helpers/sanitize_helper.rb#135 + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#171 def sanitized_allowed_attributes; end - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#50 - def sanitized_allowed_attributes=(attributes); end - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#63 - def sanitized_allowed_css_keywords; end - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#64 - def sanitized_allowed_css_keywords=(_); end - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#63 - def sanitized_allowed_css_properties; end - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#64 - def sanitized_allowed_css_properties=(_); end - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#63 - def sanitized_allowed_protocols; end - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#64 - def sanitized_allowed_protocols=(_); end - - # source://actionview//lib/action_view/helpers/sanitize_helper.rb#131 + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#167 def sanitized_allowed_tags; end - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#40 - def sanitized_allowed_tags=(tags); end - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#63 - def sanitized_bad_tags; end - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#64 - def sanitized_bad_tags=(_); end - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#63 - def sanitized_protocol_separator; end - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#64 - def sanitized_protocol_separator=(_); end - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#63 - def sanitized_shorthand_css_properties; end - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#64 - def sanitized_shorthand_css_properties=(_); end - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#63 - def sanitized_uri_attributes; end - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#64 - def sanitized_uri_attributes=(_); end - - # source://actionview//lib/action_view/helpers/sanitize_helper.rb#127 + # source://actionview//lib/action_view/helpers/sanitize_helper.rb#163 def sanitizer_vendor; end - - private - - # source://rails-html-sanitizer/1.4.3/lib/rails-html-sanitizer.rb#68 - def deprecate_option(name); end end +# = Action View Tag \Helpers +# # Provides methods to generate HTML tags programmatically both as a modern # HTML5 compliant builder style and legacy XHTML compliant tags. # -# source://actionview//lib/action_view/helpers/tag_helper.rb#14 +# source://actionview//lib/action_view/helpers/tag_helper.rb#16 module ActionView::Helpers::TagHelper include ::ActionView::Helpers::CaptureHelper include ::ActionView::Helpers::OutputSafetyHelper @@ -8940,7 +9590,7 @@ module ActionView::Helpers::TagHelper # cdata_section("hello]]>world") # # => world]]> # - # source://actionview//lib/action_view/helpers/tag_helper.rb#408 + # source://actionview//lib/action_view/helpers/tag_helper.rb#555 def cdata_section(content); end # Returns a string of tokens built from +args+. @@ -8955,7 +9605,7 @@ module ActionView::Helpers::TagHelper # token_list(nil, false, 123, "", "foo", { bar: true }) # # => "123 foo bar" # - # source://actionview//lib/action_view/helpers/tag_helper.rb#388 + # source://actionview//lib/action_view/helpers/tag_helper.rb#540 def class_names(*args); end # Returns an HTML block tag of type +name+ surrounding the +content+. Add @@ -8987,7 +9637,7 @@ module ActionView::Helpers::TagHelper # <% end -%> # # =>
    Hello world!
    # - # source://actionview//lib/action_view/helpers/tag_helper.rb#368 + # source://actionview//lib/action_view/helpers/tag_helper.rb#513 def content_tag(name, content_or_options_with_block = T.unsafe(nil), options = T.unsafe(nil), escape = T.unsafe(nil), &block); end # Returns an escaped version of +html+ without affecting existing escaped entities. @@ -8998,7 +9648,7 @@ module ActionView::Helpers::TagHelper # escape_once("<< Accept & Checkout") # # => "<< Accept & Checkout" # - # source://actionview//lib/action_view/helpers/tag_helper.rb#420 + # source://actionview//lib/action_view/helpers/tag_helper.rb#567 def escape_once(html); end # Returns an HTML tag. @@ -9078,6 +9728,14 @@ module ActionView::Helpers::TagHelper # # A void element: # tag.br # =>
    # + # Note that when using the block form options should be wrapped in + # parenthesis. + # + # <%= tag.a(href: "/about", class: "font-bold") do %> + # About the author + # <% end %> + # # => About the author + # # === Building HTML attributes # # Transforms a Hash into HTML attributes, ready to be interpolated into @@ -9094,7 +9752,7 @@ module ActionView::Helpers::TagHelper # # === Legacy syntax # - # The following format is for legacy syntax support. It will be deprecated in future versions of Rails. + # The following format is for legacy syntax support. It will be deprecated in future versions of \Rails. # # tag(name, options = nil, open = false, escape = true) # @@ -9140,7 +9798,7 @@ module ActionView::Helpers::TagHelper # tag("div", class: { highlight: current_user.admin? }) # # =>
    # - # source://actionview//lib/action_view/helpers/tag_helper.rb#331 + # source://actionview//lib/action_view/helpers/tag_helper.rb#476 def tag(name = T.unsafe(nil), options = T.unsafe(nil), open = T.unsafe(nil), escape = T.unsafe(nil)); end # Returns a string of tokens built from +args+. @@ -9155,672 +9813,1108 @@ module ActionView::Helpers::TagHelper # token_list(nil, false, 123, "", "foo", { bar: true }) # # => "123 foo bar" # - # source://actionview//lib/action_view/helpers/tag_helper.rb#388 + # source://actionview//lib/action_view/helpers/tag_helper.rb#535 def token_list(*args); end private - # source://actionview//lib/action_view/helpers/tag_helper.rb#425 + # source://actionview//lib/action_view/helpers/tag_helper.rb#577 def build_tag_values(*args); end - # source://actionview//lib/action_view/helpers/tag_helper.rb#445 + # @raise [ArgumentError] + # + # source://actionview//lib/action_view/helpers/tag_helper.rb#572 + def ensure_valid_html5_tag_name(name); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#597 def tag_builder; end class << self - # source://actionview//lib/action_view/helpers/tag_helper.rb#425 + # source://actionview//lib/action_view/helpers/tag_helper.rb#595 def build_tag_values(*args); end + + # @raise [ArgumentError] + # + # source://actionview//lib/action_view/helpers/tag_helper.rb#575 + def ensure_valid_html5_tag_name(name); end end end -# source://actionview//lib/action_view/helpers/tag_helper.rb#31 +# source://actionview//lib/action_view/helpers/tag_helper.rb#33 ActionView::Helpers::TagHelper::ARIA_PREFIXES = T.let(T.unsafe(nil), Set) -# source://actionview//lib/action_view/helpers/tag_helper.rb#18 +# source://actionview//lib/action_view/helpers/tag_helper.rb#20 ActionView::Helpers::TagHelper::BOOLEAN_ATTRIBUTES = T.let(T.unsafe(nil), Set) -# source://actionview//lib/action_view/helpers/tag_helper.rb#32 +# source://actionview//lib/action_view/helpers/tag_helper.rb#34 ActionView::Helpers::TagHelper::DATA_PREFIXES = T.let(T.unsafe(nil), Set) -# source://actionview//lib/action_view/helpers/tag_helper.rb#40 +# source://actionview//lib/action_view/helpers/tag_helper.rb#42 ActionView::Helpers::TagHelper::PRE_CONTENT_STRINGS = T.let(T.unsafe(nil), Hash) -# source://actionview//lib/action_view/helpers/tag_helper.rb#34 +# source://actionview//lib/action_view/helpers/tag_helper.rb#36 ActionView::Helpers::TagHelper::TAG_TYPES = T.let(T.unsafe(nil), Hash) -# source://actionview//lib/action_view/helpers/tag_helper.rb#44 +# source://actionview//lib/action_view/helpers/tag_helper.rb#46 class ActionView::Helpers::TagHelper::TagBuilder - include ::ActionView::Helpers::CaptureHelper - include ::ActionView::Helpers::OutputSafetyHelper - # @return [TagBuilder] a new instance of TagBuilder # - # source://actionview//lib/action_view/helpers/tag_helper.rb#51 + # source://actionview//lib/action_view/helpers/tag_helper.rb#213 def initialize(view_context); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def a(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def abbr(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def address(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def animate(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def animate_motion(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def animate_transform(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def area(escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def article(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def aside(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + # Transforms a Hash into HTML Attributes, ready to be interpolated into # ERB. # # > # # => # - # source://actionview//lib/action_view/helpers/tag_helper.rb#60 + # source://actionview//lib/action_view/helpers/tag_helper.rb#222 def attributes(attributes); end - # source://actionview//lib/action_view/helpers/tag_helper.rb#133 - def boolean_tag_option(key); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def audio(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end # source://actionview//lib/action_view/helpers/tag_helper.rb#80 - def content_tag_string(name, content, options, escape = T.unsafe(nil)); end + def b(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tag_helper.rb#64 - def p(*arguments, **options, &block); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def base(escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tag_helper.rb#137 - def tag_option(key, value, escape); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def bdi(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tag_helper.rb#91 - def tag_options(options, escape = T.unsafe(nil)); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def bdo(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tag_helper.rb#68 - def tag_string(name, content = T.unsafe(nil), **options, &block); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def blockquote(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def body(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tag_helper.rb#167 - def handle_deprecated_escape_options(options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def br(escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tag_helper.rb#188 - def method_missing(called, *args, **options, &block); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def button(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tag_helper.rb#155 - def prefix_tag_option(prefix, key, value, escape); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def canvas(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # @return [Boolean] - # - # source://actionview//lib/action_view/helpers/tag_helper.rb#163 - def respond_to_missing?(*args); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def caption(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tag_helper.rb#48 -ActionView::Helpers::TagHelper::TagBuilder::HTML_VOID_ELEMENTS = T.let(T.unsafe(nil), Set) + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def circle(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tag_helper.rb#49 -ActionView::Helpers::TagHelper::TagBuilder::SVG_SELF_CLOSING_ELEMENTS = T.let(T.unsafe(nil), Set) + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def cite(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags.rb#5 -module ActionView::Helpers::Tags - extend ::ActiveSupport::Autoload -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def code(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/base.rb#6 -class ActionView::Helpers::Tags::Base - include ::ActionView::Helpers::CaptureHelper - include ::ActionView::Helpers::OutputSafetyHelper - include ::ActionView::Helpers::TagHelper - include ::ActionView::Helpers::UrlHelper - include ::ActionView::Helpers::SanitizeHelper - include ::ActionView::Helpers::TextHelper - include ::ActionView::Helpers::FormTagHelper - include ::ActionView::Helpers::ActiveModelInstanceTag - include ::ActionView::Helpers::FormOptionsHelper - extend ::ActionView::Helpers::UrlHelper::ClassMethods - extend ::ActionView::Helpers::SanitizeHelper::ClassMethods + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def col(escape: T.unsafe(nil), **options, &block); end - # @return [Base] a new instance of Base - # - # source://actionview//lib/action_view/helpers/tags/base.rb#12 - def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def colgroup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # Returns the value of attribute object. - # - # source://actionview//lib/action_view/helpers/tags/base.rb#10 - def object; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#226 + def content_tag_string(name, content, options, escape = T.unsafe(nil)); end - # This is what child classes implement. - # - # @raise [NotImplementedError] - # - # source://actionview//lib/action_view/helpers/tags/base.rb#32 - def render; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def data(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def datalist(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/base.rb#95 - def add_default_name_and_id(options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def dd(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/base.rb#82 - def add_default_name_and_id_for_value(tag_value, options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def del(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/base.rb#147 - def add_options(option_tags, options, value = T.unsafe(nil)); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def details(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # @return [Boolean] - # - # source://actionview//lib/action_view/helpers/tags/base.rb#173 - def generate_ids?; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def dfn(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/base.rb#165 - def name_and_id_index(options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def dialog(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # @return [Boolean] - # - # source://actionview//lib/action_view/helpers/tags/base.rb#142 - def placeholder_required?(html_options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def div(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/base.rb#73 - def retrieve_autoindex(pre_match); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def dl(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/base.rb#62 - def retrieve_object(object); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def dt(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/base.rb#115 - def sanitized_method_name; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def ellipse(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/base.rb#119 - def sanitized_value(value); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def em(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/base.rb#123 - def select_content_tag(option_tags, options, html_options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def embed(escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/base.rb#111 - def tag_id(index = T.unsafe(nil), namespace = T.unsafe(nil)); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def fieldset(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/base.rb#107 - def tag_name(multiple = T.unsafe(nil), index = T.unsafe(nil)); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def figcaption(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/base.rb#37 - def value; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def figure(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/base.rb#45 - def value_before_type_cast; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def footer(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # @return [Boolean] - # - # source://actionview//lib/action_view/helpers/tags/base.rb#57 - def value_came_from_user?; end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def form(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/check_box.rb#8 -class ActionView::Helpers::Tags::CheckBox < ::ActionView::Helpers::Tags::Base - include ::ActionView::Helpers::Tags::Checkable + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def h1(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # @return [CheckBox] a new instance of CheckBox - # - # source://actionview//lib/action_view/helpers/tags/check_box.rb#11 - def initialize(object_name, method_name, template_object, checked_value, unchecked_value, options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def h2(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/check_box.rb#17 - def render; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def h3(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def h4(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # @return [Boolean] - # - # source://actionview//lib/action_view/helpers/tags/check_box.rb#42 - def checked?(value); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def h5(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/check_box.rb#59 - def hidden_field_for_checkbox(options); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def h6(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/checkable.rb#6 -module ActionView::Helpers::Tags::Checkable - # @return [Boolean] - # - # source://actionview//lib/action_view/helpers/tags/checkable.rb#7 - def input_checked?(options); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def head(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#8 -class ActionView::Helpers::Tags::CollectionCheckBoxes < ::ActionView::Helpers::Tags::Base - include ::ActionView::Helpers::Tags::CollectionHelpers + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def header(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#20 - def render(&block); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def hgroup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def hr(escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#29 - def hidden_field_name; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def html(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#25 - def render_component(builder); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def i(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#11 -class ActionView::Helpers::Tags::CollectionCheckBoxes::CheckBoxBuilder < ::ActionView::Helpers::Tags::CollectionHelpers::Builder - # source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#12 - def check_box(extra_html_options = T.unsafe(nil)); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def iframe(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#6 -module ActionView::Helpers::Tags::CollectionHelpers - # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#30 - def initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def img(escape: T.unsafe(nil), **options, &block); end - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def input(escape: T.unsafe(nil), **options, &block); end - # Generate default options for collection helpers, such as :checked and - # :disabled. - # - # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#47 - def default_html_options_for_collection(item, value); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def ins(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#107 - def hidden_field; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def kbd(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#112 - def hidden_field_name; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def keygen(escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#40 - def instantiate_builder(builder_class, item, value, text, html_options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def label(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#75 - def render_collection; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def legend(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#86 - def render_collection_for(builder_class, &block); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def li(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#71 - def sanitize_attribute_name(value); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def line(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#7 -class ActionView::Helpers::Tags::CollectionHelpers::Builder - # @return [Builder] a new instance of Builder - # - # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#10 - def initialize(template_object, object_name, method_name, object, sanitized_attribute_name, text, value, input_html_options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def link(escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#22 - def label(label_html_options = T.unsafe(nil), &block); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def main(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # Returns the value of attribute object. - # - # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#8 - def object; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def map(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # Returns the value of attribute text. - # - # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#8 - def text; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def mark(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # Returns the value of attribute value. - # - # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#8 - def value; end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def menu(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#8 -class ActionView::Helpers::Tags::CollectionRadioButtons < ::ActionView::Helpers::Tags::Base - include ::ActionView::Helpers::Tags::CollectionHelpers + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def meta(escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#19 - def render(&block); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def meter(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def nav(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#24 - def render_component(builder); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def noscript(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#11 -class ActionView::Helpers::Tags::CollectionRadioButtons::RadioButtonBuilder < ::ActionView::Helpers::Tags::CollectionHelpers::Builder - # source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#12 - def radio_button(extra_html_options = T.unsafe(nil)); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def object(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/collection_select.rb#6 -class ActionView::Helpers::Tags::CollectionSelect < ::ActionView::Helpers::Tags::Base - # @return [CollectionSelect] a new instance of CollectionSelect - # - # source://actionview//lib/action_view/helpers/tags/collection_select.rb#7 - def initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def ol(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/collection_select.rb#16 - def render; end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def optgroup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/color_field.rb#6 -class ActionView::Helpers::Tags::ColorField < ::ActionView::Helpers::Tags::TextField - # source://actionview//lib/action_view/helpers/tags/color_field.rb#7 - def render; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def option(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def output(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/color_field.rb#15 - def validate_color_string(string); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def p(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/date_field.rb#6 -class ActionView::Helpers::Tags::DateField < ::ActionView::Helpers::Tags::DatetimeField - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def path(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/date_field.rb#8 - def format_date(value); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def picture(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/date_select.rb#8 -class ActionView::Helpers::Tags::DateSelect < ::ActionView::Helpers::Tags::Base - # @return [DateSelect] a new instance of DateSelect - # - # source://actionview//lib/action_view/helpers/tags/date_select.rb#9 - def initialize(object_name, method_name, template_object, options, html_options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def polygon(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/date_select.rb#15 - def render; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def polyline(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def portal(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/date_select.rb#30 - def datetime_selector(options, html_options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def pre(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/date_select.rb#43 - def default_datetime(options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def progress(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/date_select.rb#26 - def select_type; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def q(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - class << self - # source://actionview//lib/action_view/helpers/tags/date_select.rb#20 - def select_type; end - end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def rect(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/datetime_field.rb#6 -class ActionView::Helpers::Tags::DatetimeField < ::ActionView::Helpers::Tags::TextField - # source://actionview//lib/action_view/helpers/tags/datetime_field.rb#7 - def render; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def rp(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def rt(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/datetime_field.rb#21 - def datetime_value(value); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def ruby(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # @raise [NotImplementedError] - # - # source://actionview//lib/action_view/helpers/tags/datetime_field.rb#17 - def format_date(value); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def s(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/datetime_local_field.rb#6 -class ActionView::Helpers::Tags::DatetimeLocalField < ::ActionView::Helpers::Tags::DatetimeField - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def samp(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/datetime_local_field.rb#14 - def format_date(value); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def script(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - class << self - # source://actionview//lib/action_view/helpers/tags/datetime_local_field.rb#8 - def field_type; end - end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def search(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/datetime_select.rb#6 -class ActionView::Helpers::Tags::DatetimeSelect < ::ActionView::Helpers::Tags::DateSelect; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def section(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/email_field.rb#6 -class ActionView::Helpers::Tags::EmailField < ::ActionView::Helpers::Tags::TextField; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def select(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/file_field.rb#6 -class ActionView::Helpers::Tags::FileField < ::ActionView::Helpers::Tags::TextField - # source://actionview//lib/action_view/helpers/tags/file_field.rb#7 - def render; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def set(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def slot(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/file_field.rb#20 - def hidden_field_for_multiple_file(options); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def small(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/grouped_collection_select.rb#6 -class ActionView::Helpers::Tags::GroupedCollectionSelect < ::ActionView::Helpers::Tags::Base - # @return [GroupedCollectionSelect] a new instance of GroupedCollectionSelect - # - # source://actionview//lib/action_view/helpers/tags/grouped_collection_select.rb#7 - def initialize(object_name, method_name, template_object, collection, group_method, group_label_method, option_key_method, option_value_method, options, html_options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def source(escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/grouped_collection_select.rb#18 - def render; end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def span(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/hidden_field.rb#6 -class ActionView::Helpers::Tags::HiddenField < ::ActionView::Helpers::Tags::TextField - # source://actionview//lib/action_view/helpers/tags/hidden_field.rb#7 - def render; end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def stop(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/label.rb#6 -class ActionView::Helpers::Tags::Label < ::ActionView::Helpers::Tags::Base - # @return [Label] a new instance of Label - # - # source://actionview//lib/action_view/helpers/tags/label.rb#34 - def initialize(object_name, method_name, template_object, content_or_options = T.unsafe(nil), options = T.unsafe(nil)); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def strong(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/label.rb#48 - def render(&block); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def style(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def sub(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/label.rb#78 - def render_component(builder); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def summary(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/label.rb#7 -class ActionView::Helpers::Tags::Label::LabelBuilder - # @return [LabelBuilder] a new instance of LabelBuilder - # - # source://actionview//lib/action_view/helpers/tags/label.rb#10 - def initialize(template_object, object_name, method_name, object, tag_value); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def sup(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # Returns the value of attribute object. - # - # source://actionview//lib/action_view/helpers/tags/label.rb#8 - def object; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def table(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/label.rb#29 - def to_s; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#235 + def tag_options(options, escape = T.unsafe(nil)); end - # source://actionview//lib/action_view/helpers/tags/label.rb#18 - def translation; end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def tbody(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/month_field.rb#6 -class ActionView::Helpers::Tags::MonthField < ::ActionView::Helpers::Tags::DatetimeField - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def td(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/month_field.rb#8 - def format_date(value); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def template(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/number_field.rb#6 -class ActionView::Helpers::Tags::NumberField < ::ActionView::Helpers::Tags::TextField - # source://actionview//lib/action_view/helpers/tags/number_field.rb#7 - def render; end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def textarea(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/password_field.rb#6 -class ActionView::Helpers::Tags::PasswordField < ::ActionView::Helpers::Tags::TextField - # source://actionview//lib/action_view/helpers/tags/password_field.rb#7 - def render; end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def tfoot(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/placeholderable.rb#6 -module ActionView::Helpers::Tags::Placeholderable - # source://actionview//lib/action_view/helpers/tags/placeholderable.rb#7 - def initialize(*_arg0); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def th(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/radio_button.rb#8 -class ActionView::Helpers::Tags::RadioButton < ::ActionView::Helpers::Tags::Base - include ::ActionView::Helpers::Tags::Checkable + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def thead(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # @return [RadioButton] a new instance of RadioButton - # - # source://actionview//lib/action_view/helpers/tags/radio_button.rb#11 - def initialize(object_name, method_name, template_object, tag_value, options); end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def time(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # source://actionview//lib/action_view/helpers/tags/radio_button.rb#16 - def render; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def title(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - private + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def tr(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end - # @return [Boolean] - # - # source://actionview//lib/action_view/helpers/tags/radio_button.rb#26 - def checked?(value); end -end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def track(escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/range_field.rb#6 -class ActionView::Helpers::Tags::RangeField < ::ActionView::Helpers::Tags::NumberField; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def u(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end -# source://actionview//lib/action_view/helpers/tags/search_field.rb#6 -class ActionView::Helpers::Tags::SearchField < ::ActionView::Helpers::Tags::TextField - # source://actionview//lib/action_view/helpers/tags/search_field.rb#7 - def render; end + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def ul(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def use(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def var(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def video(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def view(content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#80 + def wbr(escape: T.unsafe(nil), **options, &block); end + + private + + # source://actionview//lib/action_view/helpers/tag_helper.rb#288 + def boolean_tag_option(key); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#321 + def method_missing(called, *args, escape: T.unsafe(nil), **options, &block); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#309 + def prefix_tag_option(prefix, key, value, escape); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/tag_helper.rb#317 + def respond_to_missing?(*args); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#284 + def self_closing_tag_string(name, options, escape = T.unsafe(nil), tag_suffix = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#292 + def tag_option(key, value, escape); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#278 + def tag_string(name, content = T.unsafe(nil), options, escape: T.unsafe(nil), &block); end + + class << self + # source://actionview//lib/action_view/helpers/tag_helper.rb#47 + def define_element(name, code_generator:, method_name: T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#67 + def define_self_closing_element(name, code_generator:, method_name: T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tag_helper.rb#58 + def define_void_element(name, code_generator:, method_name: T.unsafe(nil)); end + end end -# source://actionview//lib/action_view/helpers/tags/select.rb#6 -class ActionView::Helpers::Tags::Select < ::ActionView::Helpers::Tags::Base - # @return [Select] a new instance of Select +# source://actionview//lib/action_view/helpers/tags.rb#5 +module ActionView::Helpers::Tags + extend ::ActiveSupport::Autoload +end + +# source://actionview//lib/action_view/helpers/tags/base.rb#6 +class ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::ActiveModelInstanceTag + extend ::ActionView::Helpers::UrlHelper::ClassMethods + extend ::ActionView::Helpers::SanitizeHelper::ClassMethods + + # @return [Base] a new instance of Base # - # source://actionview//lib/action_view/helpers/tags/select.rb#7 - def initialize(object_name, method_name, template_object, choices, options, html_options); end + # source://actionview//lib/action_view/helpers/tags/base.rb#11 + def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + + # Returns the value of attribute object. + # + # source://actionview//lib/action_view/helpers/tags/base.rb#9 + def object; end - # source://actionview//lib/action_view/helpers/tags/select.rb#16 + # This is what child classes implement. + # + # @raise [NotImplementedError] + # + # source://actionview//lib/action_view/helpers/tags/base.rb#31 def render; end private - # Grouped choices look like this: - # - # [nil, []] - # { nil => [] } - # + # source://actionview//lib/action_view/helpers/tags/base.rb#97 + def add_default_name_and_field(options, field = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#83 + def add_default_name_and_field_for_value(tag_value, options, field = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#108 + def add_default_name_and_id(options, field = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#95 + def add_default_name_and_id_for_value(tag_value, options, field = T.unsafe(nil)); end + # @return [Boolean] # - # source://actionview//lib/action_view/helpers/tags/select.rb#36 - def grouped_choices?; end -end + # source://actionview//lib/action_view/helpers/tags/base.rb#134 + def generate_ids?; end -# source://actionview//lib/action_view/helpers/tags/tel_field.rb#6 -class ActionView::Helpers::Tags::TelField < ::ActionView::Helpers::Tags::TextField; end + # source://actionview//lib/action_view/helpers/tags/base.rb#126 + def name_and_id_index(options); end -# source://actionview//lib/action_view/helpers/tags/text_area.rb#8 -class ActionView::Helpers::Tags::TextArea < ::ActionView::Helpers::Tags::Base - include ::ActionView::Helpers::Tags::Placeholderable + # source://actionview//lib/action_view/helpers/tags/base.rb#74 + def retrieve_autoindex(pre_match); end - # source://actionview//lib/action_view/helpers/tags/text_area.rb#11 - def render; end + # source://actionview//lib/action_view/helpers/tags/base.rb#63 + def retrieve_object(object); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#118 + def sanitized_method_name; end + + # source://actionview//lib/action_view/helpers/tags/base.rb#122 + def sanitized_value(value); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#114 + def tag_id(index = T.unsafe(nil), namespace = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#110 + def tag_name(multiple = T.unsafe(nil), index = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tags/base.rb#36 + def value; end + + # source://actionview//lib/action_view/helpers/tags/base.rb#46 + def value_before_type_cast; end + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/tags/base.rb#58 + def value_came_from_user?; end end -# source://actionview//lib/action_view/helpers/tags/text_field.rb#8 -class ActionView::Helpers::Tags::TextField < ::ActionView::Helpers::Tags::Base - include ::ActionView::Helpers::Tags::Placeholderable +# source://actionview//lib/action_view/helpers/tags/check_box.rb#8 +class ActionView::Helpers::Tags::CheckBox < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Checkable - # source://actionview//lib/action_view/helpers/tags/text_field.rb#11 + # @return [CheckBox] a new instance of CheckBox + # + # source://actionview//lib/action_view/helpers/tags/check_box.rb#11 + def initialize(object_name, method_name, template_object, checked_value, unchecked_value, options); end + + # source://actionview//lib/action_view/helpers/tags/check_box.rb#17 def render; end private - # source://actionview//lib/action_view/helpers/tags/text_field.rb#27 - def field_type; end + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/tags/check_box.rb#42 + def checked?(value); end - class << self - # source://actionview//lib/action_view/helpers/tags/text_field.rb#21 - def field_type; end - end + # source://actionview//lib/action_view/helpers/tags/check_box.rb#59 + def hidden_field_for_checkbox(options); end end -# source://actionview//lib/action_view/helpers/tags/time_field.rb#6 -class ActionView::Helpers::Tags::TimeField < ::ActionView::Helpers::Tags::DatetimeField - # @return [TimeField] a new instance of TimeField +# source://actionview//lib/action_view/helpers/tags/checkable.rb#6 +module ActionView::Helpers::Tags::Checkable + # @return [Boolean] # - # source://actionview//lib/action_view/helpers/tags/time_field.rb#7 - def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + # source://actionview//lib/action_view/helpers/tags/checkable.rb#7 + def input_checked?(options); end +end + +# source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#8 +class ActionView::Helpers::Tags::CollectionCheckBoxes < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::CollectionHelpers + include ::ActionView::Helpers::FormOptionsHelper + + # source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#22 + def render(&block); end private - # source://actionview//lib/action_view/helpers/tags/time_field.rb#13 - def format_date(value); end -end + # source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#31 + def hidden_field_name; end -# source://actionview//lib/action_view/helpers/tags/time_select.rb#6 -class ActionView::Helpers::Tags::TimeSelect < ::ActionView::Helpers::Tags::DateSelect; end + # source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#27 + def render_component(builder); end +end -# source://actionview//lib/action_view/helpers/tags/time_zone_select.rb#6 -class ActionView::Helpers::Tags::TimeZoneSelect < ::ActionView::Helpers::Tags::Base - # @return [TimeZoneSelect] a new instance of TimeZoneSelect - # - # source://actionview//lib/action_view/helpers/tags/time_zone_select.rb#7 - def initialize(object_name, method_name, template_object, priority_zones, options, html_options); end +# source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#12 +class ActionView::Helpers::Tags::CollectionCheckBoxes::CheckBoxBuilder < ::ActionView::Helpers::Tags::CollectionHelpers::Builder + # source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#19 + def check_box(extra_html_options = T.unsafe(nil)); end - # source://actionview//lib/action_view/helpers/tags/time_zone_select.rb#14 - def render; end + # source://actionview//lib/action_view/helpers/tags/collection_check_boxes.rb#13 + def checkbox(extra_html_options = T.unsafe(nil)); end end -# source://actionview//lib/action_view/helpers/tags/translator.rb#6 -class ActionView::Helpers::Tags::Translator - # @return [Translator] a new instance of Translator +# source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#6 +module ActionView::Helpers::Tags::CollectionHelpers + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#30 + def initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options); end + + private + + # Generate default options for collection helpers, such as :checked and + # :disabled. # - # source://actionview//lib/action_view/helpers/tags/translator.rb#7 - def initialize(object, object_name, method_and_value, scope:); end + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#47 + def default_html_options_for_collection(item, value); end - # source://actionview//lib/action_view/helpers/tags/translator.rb#14 - def translate; end + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#107 + def hidden_field; end - private + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#113 + def hidden_field_name; end - # source://actionview//lib/action_view/helpers/tags/translator.rb#31 - def human_attribute_name; end + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#40 + def instantiate_builder(builder_class, item, value, text, html_options); end - # source://actionview//lib/action_view/helpers/tags/translator.rb#22 - def i18n_default; end + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#75 + def render_collection; end - # Returns the value of attribute method_and_value. + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#86 + def render_collection_for(builder_class, &block); end + + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#71 + def sanitize_attribute_name(value); end +end + +# source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#7 +class ActionView::Helpers::Tags::CollectionHelpers::Builder + # @return [Builder] a new instance of Builder # - # source://actionview//lib/action_view/helpers/tags/translator.rb#20 - def method_and_value; end + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#10 + def initialize(template_object, object_name, method_name, object, sanitized_attribute_name, text, value, input_html_options); end - # Returns the value of attribute model. + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#22 + def label(label_html_options = T.unsafe(nil), &block); end + + # Returns the value of attribute object. # - # source://actionview//lib/action_view/helpers/tags/translator.rb#20 - def model; end + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#8 + def object; end - # Returns the value of attribute object_name. + # Returns the value of attribute text. # - # source://actionview//lib/action_view/helpers/tags/translator.rb#20 - def object_name; end + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#8 + def text; end - # Returns the value of attribute scope. + # Returns the value of attribute value. # - # source://actionview//lib/action_view/helpers/tags/translator.rb#20 - def scope; end + # source://actionview//lib/action_view/helpers/tags/collection_helpers.rb#8 + def value; end end -# source://actionview//lib/action_view/helpers/tags/url_field.rb#6 -class ActionView::Helpers::Tags::UrlField < ::ActionView::Helpers::Tags::TextField; end +# source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#8 +class ActionView::Helpers::Tags::CollectionRadioButtons < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::CollectionHelpers + include ::ActionView::Helpers::FormOptionsHelper + + # source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#20 + def render(&block); end -# source://actionview//lib/action_view/helpers/tags/week_field.rb#6 -class ActionView::Helpers::Tags::WeekField < ::ActionView::Helpers::Tags::DatetimeField private - # source://actionview//lib/action_view/helpers/tags/week_field.rb#8 - def format_date(value); end + # source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#25 + def render_component(builder); end end -# source://actionview//lib/action_view/helpers/tags/weekday_select.rb#6 -class ActionView::Helpers::Tags::WeekdaySelect < ::ActionView::Helpers::Tags::Base - # @return [WeekdaySelect] a new instance of WeekdaySelect +# source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#12 +class ActionView::Helpers::Tags::CollectionRadioButtons::RadioButtonBuilder < ::ActionView::Helpers::Tags::CollectionHelpers::Builder + # source://actionview//lib/action_view/helpers/tags/collection_radio_buttons.rb#13 + def radio_button(extra_html_options = T.unsafe(nil)); end +end + +# source://actionview//lib/action_view/helpers/tags/collection_select.rb#6 +class ActionView::Helpers::Tags::CollectionSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # @return [CollectionSelect] a new instance of CollectionSelect # - # source://actionview//lib/action_view/helpers/tags/weekday_select.rb#7 - def initialize(object_name, method_name, template_object, options, html_options); end + # source://actionview//lib/action_view/helpers/tags/collection_select.rb#10 + def initialize(object_name, method_name, template_object, collection, value_method, text_method, options, html_options); end - # source://actionview//lib/action_view/helpers/tags/weekday_select.rb#13 + # source://actionview//lib/action_view/helpers/tags/collection_select.rb#19 def render; end end -# The TextHelper module provides a set of methods for filtering, formatting +# source://actionview//lib/action_view/helpers/tags/color_field.rb#6 +class ActionView::Helpers::Tags::ColorField < ::ActionView::Helpers::Tags::TextField + # source://actionview//lib/action_view/helpers/tags/color_field.rb#7 + def render; end + + private + + # source://actionview//lib/action_view/helpers/tags/color_field.rb#15 + def validate_color_string(string); end +end + +# source://actionview//lib/action_view/helpers/tags/date_field.rb#6 +class ActionView::Helpers::Tags::DateField < ::ActionView::Helpers::Tags::DatetimeField + private + + # source://actionview//lib/action_view/helpers/tags/date_field.rb#8 + def format_datetime(value); end +end + +# source://actionview//lib/action_view/helpers/tags/date_select.rb#8 +class ActionView::Helpers::Tags::DateSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + + # @return [DateSelect] a new instance of DateSelect + # + # source://actionview//lib/action_view/helpers/tags/date_select.rb#11 + def initialize(object_name, method_name, template_object, options, html_options); end + + # source://actionview//lib/action_view/helpers/tags/date_select.rb#17 + def render; end + + private + + # source://actionview//lib/action_view/helpers/tags/date_select.rb#32 + def datetime_selector(options, html_options); end + + # source://actionview//lib/action_view/helpers/tags/date_select.rb#45 + def default_datetime(options); end + + # source://actionview//lib/action_view/helpers/tags/date_select.rb#28 + def select_type; end + + class << self + # source://actionview//lib/action_view/helpers/tags/date_select.rb#22 + def select_type; end + end +end + +# source://actionview//lib/action_view/helpers/tags/datetime_field.rb#6 +class ActionView::Helpers::Tags::DatetimeField < ::ActionView::Helpers::Tags::TextField + # source://actionview//lib/action_view/helpers/tags/datetime_field.rb#7 + def render; end + + private + + # source://actionview//lib/action_view/helpers/tags/datetime_field.rb#17 + def datetime_value(value); end + + # @raise [NotImplementedError] + # + # source://actionview//lib/action_view/helpers/tags/datetime_field.rb#25 + def format_datetime(value); end + + # source://actionview//lib/action_view/helpers/tags/datetime_field.rb#29 + def parse_datetime(value); end +end + +# source://actionview//lib/action_view/helpers/tags/datetime_local_field.rb#6 +class ActionView::Helpers::Tags::DatetimeLocalField < ::ActionView::Helpers::Tags::DatetimeField + # @return [DatetimeLocalField] a new instance of DatetimeLocalField + # + # source://actionview//lib/action_view/helpers/tags/datetime_local_field.rb#7 + def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + + private + + # source://actionview//lib/action_view/helpers/tags/datetime_local_field.rb#19 + def format_datetime(value); end + + class << self + # source://actionview//lib/action_view/helpers/tags/datetime_local_field.rb#13 + def field_type; end + end +end + +# source://actionview//lib/action_view/helpers/tags/datetime_select.rb#6 +class ActionView::Helpers::Tags::DatetimeSelect < ::ActionView::Helpers::Tags::DateSelect; end + +# source://actionview//lib/action_view/helpers/tags/email_field.rb#6 +class ActionView::Helpers::Tags::EmailField < ::ActionView::Helpers::Tags::TextField; end + +# source://actionview//lib/action_view/helpers/tags/file_field.rb#6 +class ActionView::Helpers::Tags::FileField < ::ActionView::Helpers::Tags::TextField + # source://actionview//lib/action_view/helpers/tags/file_field.rb#7 + def render; end + + private + + # source://actionview//lib/action_view/helpers/tags/file_field.rb#23 + def hidden_field_for_multiple_file(options); end +end + +# source://actionview//lib/action_view/helpers/tags/grouped_collection_select.rb#6 +class ActionView::Helpers::Tags::GroupedCollectionSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # @return [GroupedCollectionSelect] a new instance of GroupedCollectionSelect + # + # source://actionview//lib/action_view/helpers/tags/grouped_collection_select.rb#10 + def initialize(object_name, method_name, template_object, collection, group_method, group_label_method, option_key_method, option_value_method, options, html_options); end + + # source://actionview//lib/action_view/helpers/tags/grouped_collection_select.rb#21 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/hidden_field.rb#6 +class ActionView::Helpers::Tags::HiddenField < ::ActionView::Helpers::Tags::TextField + # source://actionview//lib/action_view/helpers/tags/hidden_field.rb#7 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/label.rb#6 +class ActionView::Helpers::Tags::Label < ::ActionView::Helpers::Tags::Base + # @return [Label] a new instance of Label + # + # source://actionview//lib/action_view/helpers/tags/label.rb#34 + def initialize(object_name, method_name, template_object, content_or_options = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://actionview//lib/action_view/helpers/tags/label.rb#48 + def render(&block); end + + private + + # source://actionview//lib/action_view/helpers/tags/label.rb#71 + def render_component(builder); end +end + +# source://actionview//lib/action_view/helpers/tags/label.rb#7 +class ActionView::Helpers::Tags::Label::LabelBuilder + # @return [LabelBuilder] a new instance of LabelBuilder + # + # source://actionview//lib/action_view/helpers/tags/label.rb#10 + def initialize(template_object, object_name, method_name, object, tag_value); end + + # Returns the value of attribute object. + # + # source://actionview//lib/action_view/helpers/tags/label.rb#8 + def object; end + + # source://actionview//lib/action_view/helpers/tags/label.rb#29 + def to_s; end + + # source://actionview//lib/action_view/helpers/tags/label.rb#18 + def translation; end +end + +# source://actionview//lib/action_view/helpers/tags/month_field.rb#6 +class ActionView::Helpers::Tags::MonthField < ::ActionView::Helpers::Tags::DatetimeField + private + + # source://actionview//lib/action_view/helpers/tags/month_field.rb#8 + def format_datetime(value); end +end + +# source://actionview//lib/action_view/helpers/tags/number_field.rb#6 +class ActionView::Helpers::Tags::NumberField < ::ActionView::Helpers::Tags::TextField + # source://actionview//lib/action_view/helpers/tags/number_field.rb#7 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/password_field.rb#6 +class ActionView::Helpers::Tags::PasswordField < ::ActionView::Helpers::Tags::TextField + # source://actionview//lib/action_view/helpers/tags/password_field.rb#7 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/placeholderable.rb#6 +module ActionView::Helpers::Tags::Placeholderable + # source://actionview//lib/action_view/helpers/tags/placeholderable.rb#7 + def initialize(*_arg0); end +end + +# source://actionview//lib/action_view/helpers/tags/radio_button.rb#8 +class ActionView::Helpers::Tags::RadioButton < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Checkable + + # @return [RadioButton] a new instance of RadioButton + # + # source://actionview//lib/action_view/helpers/tags/radio_button.rb#11 + def initialize(object_name, method_name, template_object, tag_value, options); end + + # source://actionview//lib/action_view/helpers/tags/radio_button.rb#16 + def render; end + + private + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/tags/radio_button.rb#26 + def checked?(value); end +end + +# source://actionview//lib/action_view/helpers/tags/range_field.rb#6 +class ActionView::Helpers::Tags::RangeField < ::ActionView::Helpers::Tags::NumberField; end + +# source://actionview//lib/action_view/helpers/tags/search_field.rb#6 +class ActionView::Helpers::Tags::SearchField < ::ActionView::Helpers::Tags::TextField + # source://actionview//lib/action_view/helpers/tags/search_field.rb#7 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/select.rb#6 +class ActionView::Helpers::Tags::Select < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # @return [Select] a new instance of Select + # + # source://actionview//lib/action_view/helpers/tags/select.rb#10 + def initialize(object_name, method_name, template_object, choices, options, html_options); end + + # source://actionview//lib/action_view/helpers/tags/select.rb#19 + def render; end + + private + + # Grouped choices look like this: + # + # [nil, []] + # { nil => [] } + # + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/tags/select.rb#39 + def grouped_choices?; end +end + +# source://actionview//lib/action_view/helpers/tags/select_renderer.rb#6 +module ActionView::Helpers::Tags::SelectRenderer + private + + # source://actionview//lib/action_view/helpers/tags/select_renderer.rb#38 + def add_options(option_tags, options, value = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/helpers/tags/select_renderer.rb#33 + def placeholder_required?(html_options); end + + # source://actionview//lib/action_view/helpers/tags/select_renderer.rb#8 + def select_content_tag(option_tags, options, html_options); end +end + +# source://actionview//lib/action_view/helpers/tags/tel_field.rb#6 +class ActionView::Helpers::Tags::TelField < ::ActionView::Helpers::Tags::TextField; end + +# source://actionview//lib/action_view/helpers/tags/text_area.rb#8 +class ActionView::Helpers::Tags::TextArea < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Placeholderable + + # source://actionview//lib/action_view/helpers/tags/text_area.rb#11 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/text_field.rb#8 +class ActionView::Helpers::Tags::TextField < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Placeholderable + + # source://actionview//lib/action_view/helpers/tags/text_field.rb#11 + def render; end + + private + + # source://actionview//lib/action_view/helpers/tags/text_field.rb#27 + def field_type; end + + class << self + # source://actionview//lib/action_view/helpers/tags/text_field.rb#21 + def field_type; end + end +end + +# source://actionview//lib/action_view/helpers/tags/time_field.rb#6 +class ActionView::Helpers::Tags::TimeField < ::ActionView::Helpers::Tags::DatetimeField + # @return [TimeField] a new instance of TimeField + # + # source://actionview//lib/action_view/helpers/tags/time_field.rb#7 + def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + + private + + # source://actionview//lib/action_view/helpers/tags/time_field.rb#13 + def format_datetime(value); end +end + +# source://actionview//lib/action_view/helpers/tags/time_select.rb#6 +class ActionView::Helpers::Tags::TimeSelect < ::ActionView::Helpers::Tags::DateSelect; end + +# source://actionview//lib/action_view/helpers/tags/time_zone_select.rb#6 +class ActionView::Helpers::Tags::TimeZoneSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # @return [TimeZoneSelect] a new instance of TimeZoneSelect + # + # source://actionview//lib/action_view/helpers/tags/time_zone_select.rb#10 + def initialize(object_name, method_name, template_object, priority_zones, options, html_options); end + + # source://actionview//lib/action_view/helpers/tags/time_zone_select.rb#17 + def render; end +end + +# source://actionview//lib/action_view/helpers/tags/translator.rb#6 +class ActionView::Helpers::Tags::Translator + # @return [Translator] a new instance of Translator + # + # source://actionview//lib/action_view/helpers/tags/translator.rb#7 + def initialize(object, object_name, method_and_value, scope:); end + + # source://actionview//lib/action_view/helpers/tags/translator.rb#14 + def translate; end + + private + + # source://actionview//lib/action_view/helpers/tags/translator.rb#31 + def human_attribute_name; end + + # source://actionview//lib/action_view/helpers/tags/translator.rb#22 + def i18n_default; end + + # Returns the value of attribute method_and_value. + # + # source://actionview//lib/action_view/helpers/tags/translator.rb#20 + def method_and_value; end + + # Returns the value of attribute model. + # + # source://actionview//lib/action_view/helpers/tags/translator.rb#20 + def model; end + + # Returns the value of attribute object_name. + # + # source://actionview//lib/action_view/helpers/tags/translator.rb#20 + def object_name; end + + # Returns the value of attribute scope. + # + # source://actionview//lib/action_view/helpers/tags/translator.rb#20 + def scope; end +end + +# source://actionview//lib/action_view/helpers/tags/url_field.rb#6 +class ActionView::Helpers::Tags::UrlField < ::ActionView::Helpers::Tags::TextField; end + +# source://actionview//lib/action_view/helpers/tags/week_field.rb#6 +class ActionView::Helpers::Tags::WeekField < ::ActionView::Helpers::Tags::DatetimeField + private + + # source://actionview//lib/action_view/helpers/tags/week_field.rb#8 + def format_datetime(value); end +end + +# source://actionview//lib/action_view/helpers/tags/weekday_select.rb#6 +class ActionView::Helpers::Tags::WeekdaySelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + include ::ActionView::Helpers::FormOptionsHelper + + # @return [WeekdaySelect] a new instance of WeekdaySelect + # + # source://actionview//lib/action_view/helpers/tags/weekday_select.rb#10 + def initialize(object_name, method_name, template_object, options, html_options); end + + # source://actionview//lib/action_view/helpers/tags/weekday_select.rb#16 + def render; end +end + +# = Action View Text \Helpers +# +# The TextHelper module provides a set of methods for filtering, formatting # and transforming strings, which can reduce the amount of inline Ruby code in # your views. These helper methods extend Action View making them callable # within your template files. @@ -9843,7 +10937,7 @@ end # simple_format h('Example') # # => "

    <a href=\"http://example.com/\">Example</a>

    " # -# source://actionview//lib/action_view/helpers/text_helper.rb#35 +# source://actionview//lib/action_view/helpers/text_helper.rb#36 module ActionView::Helpers::TextHelper include ::ActionView::Helpers::CaptureHelper include ::ActionView::Helpers::OutputSafetyHelper @@ -9854,41 +10948,44 @@ module ActionView::Helpers::TextHelper mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods # The preferred method of outputting text in your views is to use the - # <%= "text" %> eRuby syntax. The regular _puts_ and _print_ methods + # <%= "text" %> eRuby syntax. The regular +puts+ and +print+ methods # do not operate as expected in an eRuby code block. If you absolutely must - # output text within a non-output code block (i.e., <% %>), you can use the concat method. + # output text within a non-output code block (i.e., <% %>), you + # can use the +concat+ method. # - # <% - # concat "hello" - # # is the equivalent of <%= "hello" %> + # <% concat "hello" %> is equivalent to <%= "hello" %> # - # if logged_in - # concat "Logged in!" - # else - # concat link_to('login', action: :login) - # end - # # will either display "Logged in!" or a login link + # <% + # unless signed_in? + # concat link_to("Sign In", action: :sign_in) + # end # %> # - # source://actionview//lib/action_view/helpers/text_helper.rb#58 + # is equivalent to + # + # <% unless signed_in? %> + # <%= link_to "Sign In", action: :sign_in %> + # <% end %> + # + # source://actionview//lib/action_view/helpers/text_helper.rb#63 def concat(string); end # Returns the current cycle string after a cycle has been started. Useful # for complex table highlighting or any other design need which requires # the current cycle string in more than one place. # - # # Alternate background colors - # @items = [1,2,3,4] + # <%# Alternate background colors %> + # <% @items = [1,2,3,4] %> # <% @items.each do |item| %> #
    "> # <%= item %> #
    # <% end %> # - # source://actionview//lib/action_view/helpers/text_helper.rb#382 + # source://actionview//lib/action_view/helpers/text_helper.rb#461 def current_cycle(name = T.unsafe(nil)); end - # Creates a Cycle object whose _to_s_ method cycles through elements of an + # Creates a Cycle object whose +to_s+ method cycles through elements of an # array every time it is called. This can be used for example, to alternate # classes for table rows. You can use named cycles to allow nesting in loops. # Passing a Hash as the last parameter with a :name key will create a @@ -9897,8 +10994,8 @@ module ActionView::Helpers::TextHelper # and passing the name of the cycle. The current cycle string can be obtained # anytime using the current_cycle method. # - # # Alternate CSS classes for even and odd numbers... - # @items = [1,2,3,4] + # <%# Alternate CSS classes for even and odd numbers... %> + # <% @items = [1,2,3,4] %> # # <% @items.each do |item| %> # "> @@ -9908,10 +11005,12 @@ module ActionView::Helpers::TextHelper #
    # # - # # Cycle CSS classes for rows, and text colors for values within each row - # @items = x = [{first: 'Robert', middle: 'Daniel', last: 'James'}, - # {first: 'Emily', middle: 'Shannon', maiden: 'Pike', last: 'Hicks'}, - # {first: 'June', middle: 'Dae', last: 'Jones'}] + # <%# Cycle CSS classes for rows, and text colors for values within each row %> + # <% @items = [ + # { first: "Robert", middle: "Daniel", last: "James" }, + # { first: "Emily", middle: "Shannon", maiden: "Pike", last: "Hicks" }, + # { first: "June", middle: "Dae", last: "Jones" }, + # ] %> # <% @items.each do |item| %> # "> # @@ -9926,100 +11025,129 @@ module ActionView::Helpers::TextHelper # # <% end %> # - # source://actionview//lib/action_view/helpers/text_helper.rb#358 + # source://actionview//lib/action_view/helpers/text_helper.rb#437 def cycle(first_value, *values); end - # Extracts an excerpt from +text+ that matches the first instance of +phrase+. - # The :radius option expands the excerpt on each side of the first occurrence of +phrase+ by the number of characters - # defined in :radius (which defaults to 100). If the excerpt radius overflows the beginning or end of the +text+, - # then the :omission option (which defaults to "...") will be prepended/appended accordingly. Use the - # :separator option to choose the delimitation. The resulting string will be stripped in any case. If the +phrase+ - # isn't found, +nil+ is returned. + # Extracts the first occurrence of +phrase+ plus surrounding text from + # +text+. An omission marker is prepended / appended if the start / end of + # the result does not coincide with the start / end of +text+. The result + # is always stripped in any case. Returns +nil+ if +phrase+ isn't found. + # + # ==== Options + # + # [+:radius+] + # The number of characters (or tokens — see +:separator+ option) around + # +phrase+ to include in the result. Defaults to 100. + # + # [+:omission+] + # The marker to prepend / append when the start / end of the excerpt + # does not coincide with the start / end of +text+. Defaults to + # "...". + # + # [+:separator+] + # The separator between tokens to count for +:radius+. Defaults to + # "", which treats each character as a token. + # + # ==== Examples # # excerpt('This is an example', 'an', radius: 5) - # # => ...s is an exam... + # # => "...s is an exam..." # # excerpt('This is an example', 'is', radius: 5) - # # => This is a... + # # => "This is a..." # # excerpt('This is an example', 'is') - # # => This is an example + # # => "This is an example" # # excerpt('This next thing is an example', 'ex', radius: 2) - # # => ...next... + # # => "...next..." # # excerpt('This is also an example', 'an', radius: 8, omission: ' ') - # # => is also an example + # # => " is also an example" # # excerpt('This is a very beautiful morning', 'very', separator: ' ', radius: 1) - # # => ...a very beautiful... + # # => "...a very beautiful..." # - # source://actionview//lib/action_view/helpers/text_helper.rb#179 + # source://actionview//lib/action_view/helpers/text_helper.rb#235 def excerpt(text, phrase, options = T.unsafe(nil)); end - # Highlights one or more +phrases+ everywhere in +text+ by inserting it into - # a :highlighter string. The highlighter can be specialized by passing :highlighter - # as a single-quoted string with \1 where the phrase is to be inserted (defaults to - # \1) or passing a block that receives each matched term. By default +text+ - # is sanitized to prevent possible XSS attacks. If the input is trustworthy, passing false - # for :sanitize will turn sanitizing off. + # Highlights occurrences of +phrases+ in +text+ by formatting them with a + # highlighter string. +phrases+ can be one or more strings or regular + # expressions. The result will be marked HTML safe. By default, +text+ is + # sanitized before highlighting to prevent possible XSS attacks. + # + # If a block is specified, it will be used instead of the highlighter + # string. Each occurrence of a phrase will be passed to the block, and its + # return value will be inserted into the final result. + # + # ==== Options + # + # [+:highlighter+] + # The highlighter string. Uses \1 as the placeholder for a + # phrase, similar to +String#sub+. Defaults to "\1". + # This option is ignored if a block is specified. + # + # [+:sanitize+] + # Whether to sanitize +text+ before highlighting. Defaults to true. + # + # ==== Examples # # highlight('You searched for: rails', 'rails') - # # => You searched for: rails + # # => "You searched for: rails" # # highlight('You searched for: rails', /for|rails/) - # # => You searched for: rails + # # => "You searched for: rails" # # highlight('You searched for: ruby, rails, dhh', 'actionpack') - # # => You searched for: ruby, rails, dhh + # # => "You searched for: ruby, rails, dhh" # # highlight('You searched for: rails', ['for', 'rails'], highlighter: '\1') - # # => You searched for: rails + # # => "You searched for: rails" # # highlight('You searched for: rails', 'rails', highlighter: '\1') - # # => You searched for: rails + # # => "You searched for: rails" # - # highlight('You searched for: rails', 'rails') { |match| link_to(search_path(q: match, match)) } - # # => You searched for: rails + # highlight('You searched for: rails', 'rails') { |match| link_to(search_path(q: match)) } + # # => "You searched for: rails" # # highlight('ruby on rails', 'rails', sanitize: false) - # # => ruby on rails + # # => "ruby on rails" # - # source://actionview//lib/action_view/helpers/text_helper.rb#136 + # source://actionview//lib/action_view/helpers/text_helper.rb#174 def highlight(text, phrases, options = T.unsafe(nil), &block); end # Attempts to pluralize the +singular+ word unless +count+ is 1. If # +plural+ is supplied, it will use that when count is > 1, otherwise # it will use the Inflector to determine the plural form for the given locale, - # which defaults to I18n.locale + # which defaults to +I18n.locale+. # # The word will be pluralized using rules defined for the locale # (you must define your own inflection rules for languages other than English). - # See ActiveSupport::Inflector.pluralize + # See ActiveSupport::Inflector.pluralize. # # pluralize(1, 'person') - # # => 1 person + # # => "1 person" # # pluralize(2, 'person') - # # => 2 people + # # => "2 people" # # pluralize(3, 'person', plural: 'users') - # # => 3 users + # # => "3 users" # # pluralize(0, 'person') - # # => 0 people + # # => "0 people" # # pluralize(2, 'Person', locale: :de) - # # => 2 Personen + # # => "2 Personen" # - # source://actionview//lib/action_view/helpers/text_helper.rb#234 + # source://actionview//lib/action_view/helpers/text_helper.rb#297 def pluralize(count, singular, plural_arg = T.unsafe(nil), plural: T.unsafe(nil), locale: T.unsafe(nil)); end # Resets a cycle so that it starts from the first element the next time # it is called. Pass in +name+ to reset a named cycle. # - # # Alternate CSS classes for even and odd numbers... - # @items = [[1,2,3,4], [5,6,3], [3,4,5,6,7,4]] + # <%# Alternate CSS classes for even and odd numbers... %> + # <% @items = [[1,2,3,4], [5,6,3], [3,4,5,6,7,4]] %> # # <% @items.each do |item| %> # "> @@ -10034,10 +11162,10 @@ module ActionView::Helpers::TextHelper # <% end %> #
    # - # source://actionview//lib/action_view/helpers/text_helper.rb#405 + # source://actionview//lib/action_view/helpers/text_helper.rb#484 def reset_cycle(name = T.unsafe(nil)); end - # source://actionview//lib/action_view/helpers/text_helper.rb#62 + # source://actionview//lib/action_view/helpers/text_helper.rb#67 def safe_concat(string); end # Returns +text+ transformed into HTML using simple formatting rules. @@ -10052,7 +11180,8 @@ module ActionView::Helpers::TextHelper # # ==== Options # * :sanitize - If +false+, does not sanitize +text+. - # * :wrapper_tag - String representing the wrapper tag, defaults to "p" + # * :sanitize_options - Any extra options you want appended to the sanitize. + # * :wrapper_tag - String representing the wrapper tag, defaults to "p". # # ==== Examples # my_text = "Here is some basic text...\n...with a line break." @@ -10077,20 +11206,42 @@ module ActionView::Helpers::TextHelper # simple_format("Blinkable! It's true.", {}, sanitize: false) # # => "

    Blinkable! It's true.

    " # - # source://actionview//lib/action_view/helpers/text_helper.rb#306 + # simple_format("Continue", {}, { sanitize_options: { attributes: %w[target href] } }) + # # => "

    Continue

    " + # + # source://actionview//lib/action_view/helpers/text_helper.rb#383 def simple_format(text, html_options = T.unsafe(nil), options = T.unsafe(nil)); end - # Truncates a given +text+ after a given :length if +text+ is longer than :length - # (defaults to 30). The last characters will be replaced with the :omission (defaults to "...") - # for a total length not exceeding :length. + # Truncates +text+ if it is longer than a specified +:length+. If +text+ + # is truncated, an omission marker will be appended to the result for a + # total length not exceeding +:length+. + # + # You can also pass a block to render and append extra content after the + # omission marker when +text+ is truncated. However, this content _can_ + # cause the total length to exceed +:length+ characters. + # + # The result will be escaped unless escape: false is specified. + # In any case, the result will be marked HTML-safe. Care should be taken + # if +text+ might contain HTML tags or entities, because truncation could + # produce invalid HTML, such as unbalanced or incomplete tags. + # + # ==== Options # - # Pass a :separator to truncate +text+ at a natural break. + # [+:length+] + # The maximum number of characters that should be returned, excluding + # any extra content from the block. Defaults to 30. # - # Pass a block if you want to show extra content when the text is truncated. + # [+:omission+] + # The string to append after truncating. Defaults to "...". # - # The result is marked as HTML-safe, but it is escaped by default, unless :escape is - # +false+. Care should be taken if +text+ contains HTML tags or entities, because truncation - # may produce invalid HTML (such as unbalanced or incomplete tags). + # [+:separator+] + # A string or regexp used to find a breaking point at which to truncate. + # By default, truncation can occur at any character in +text+. + # + # [+:escape+] + # Whether to escape the result. Defaults to true. + # + # ==== Examples # # truncate("Once upon a time in a world far far away") # # => "Once upon a time in a world..." @@ -10111,9 +11262,9 @@ module ActionView::Helpers::TextHelper # # => "

    Once upon a time in a wo..." # # truncate("Once upon a time in a world far far away") { link_to "Continue", "#" } - # # => "Once upon a time in a wo...Continue" + # # => "Once upon a time in a world...Continue" # - # source://actionview//lib/action_view/helpers/text_helper.rb#98 + # source://actionview//lib/action_view/helpers/text_helper.rb#122 def truncate(text, options = T.unsafe(nil), &block); end # Wraps the +text+ into lines no longer than +line_width+ width. This method @@ -10121,77 +11272,79 @@ module ActionView::Helpers::TextHelper # (which is 80 by default). # # word_wrap('Once upon a time') - # # => Once upon a time + # # => "Once upon a time" # # word_wrap('Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding a successor to the throne turned out to be more trouble than anyone could have imagined...') - # # => Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding\na successor to the throne turned out to be more trouble than anyone could have\nimagined... + # # => "Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding\na successor to the throne turned out to be more trouble than anyone could have\nimagined..." # # word_wrap('Once upon a time', line_width: 8) - # # => Once\nupon a\ntime + # # => "Once\nupon a\ntime" # # word_wrap('Once upon a time', line_width: 1) - # # => Once\nupon\na\ntime + # # => "Once\nupon\na\ntime" # - # You can also specify a custom +break_sequence+ ("\n" by default) + # You can also specify a custom +break_sequence+ ("\n" by default): # # word_wrap('Once upon a time', line_width: 1, break_sequence: "\r\n") - # # => Once\r\nupon\r\na\r\ntime + # # => "Once\r\nupon\r\na\r\ntime" # - # source://actionview//lib/action_view/helpers/text_helper.rb#264 + # source://actionview//lib/action_view/helpers/text_helper.rb#327 def word_wrap(text, line_width: T.unsafe(nil), break_sequence: T.unsafe(nil)); end private - # source://actionview//lib/action_view/helpers/text_helper.rb#468 + # source://actionview//lib/action_view/helpers/text_helper.rb#547 def cut_excerpt_part(part_position, part, separator, options); end # The cycle helpers need to store the cycles in a place that is # guaranteed to be reset every time a page is rendered, so it # uses an instance variable of ActionView::Base. # - # source://actionview//lib/action_view/helpers/text_helper.rb#450 + # source://actionview//lib/action_view/helpers/text_helper.rb#529 def get_cycle(name); end - # source://actionview//lib/action_view/helpers/text_helper.rb#455 + # source://actionview//lib/action_view/helpers/text_helper.rb#534 def set_cycle(name, cycle_object); end - # source://actionview//lib/action_view/helpers/text_helper.rb#460 + # source://actionview//lib/action_view/helpers/text_helper.rb#539 def split_paragraphs(text); end end -# source://actionview//lib/action_view/helpers/text_helper.rb#410 +# source://actionview//lib/action_view/helpers/text_helper.rb#489 class ActionView::Helpers::TextHelper::Cycle # @return [Cycle] a new instance of Cycle # - # source://actionview//lib/action_view/helpers/text_helper.rb#413 + # source://actionview//lib/action_view/helpers/text_helper.rb#492 def initialize(first_value, *values); end - # source://actionview//lib/action_view/helpers/text_helper.rb#422 + # source://actionview//lib/action_view/helpers/text_helper.rb#501 def current_value; end - # source://actionview//lib/action_view/helpers/text_helper.rb#418 + # source://actionview//lib/action_view/helpers/text_helper.rb#497 def reset; end - # source://actionview//lib/action_view/helpers/text_helper.rb#426 + # source://actionview//lib/action_view/helpers/text_helper.rb#505 def to_s; end # Returns the value of attribute values. # - # source://actionview//lib/action_view/helpers/text_helper.rb#411 + # source://actionview//lib/action_view/helpers/text_helper.rb#490 def values; end private - # source://actionview//lib/action_view/helpers/text_helper.rb#433 + # source://actionview//lib/action_view/helpers/text_helper.rb#512 def next_index; end - # source://actionview//lib/action_view/helpers/text_helper.rb#437 + # source://actionview//lib/action_view/helpers/text_helper.rb#516 def previous_index; end - # source://actionview//lib/action_view/helpers/text_helper.rb#441 + # source://actionview//lib/action_view/helpers/text_helper.rb#520 def step_index(n); end end +# = Action View Translation \Helpers +# # source://actionview//lib/action_view/helpers/translation_helper.rb#9 module ActionView::Helpers::TranslationHelper include ::ActionView::Helpers::CaptureHelper @@ -10204,7 +11357,7 @@ module ActionView::Helpers::TranslationHelper # See https://www.rubydoc.info/gems/i18n/I18n/Backend/Base:localize # for more information. # - # source://actionview//lib/action_view/helpers/translation_helper.rb#116 + # source://actionview//lib/action_view/helpers/translation_helper.rb#119 def l(object, **options); end # Delegates to I18n.localize with no additional functionality. @@ -10267,7 +11420,7 @@ module ActionView::Helpers::TranslationHelper # This enables annotate translated text to be aware of the scope it was # resolved against. # - # source://actionview//lib/action_view/helpers/translation_helper.rb#73 + # source://actionview//lib/action_view/helpers/translation_helper.rb#110 def t(key, **options); end # Delegates to I18n#translate but also performs three additional @@ -10348,16 +11501,19 @@ ActionView::Helpers::TranslationHelper::MISSING_TRANSLATION = T.let(T.unsafe(nil # source://actionview//lib/action_view/helpers/translation_helper.rb#125 ActionView::Helpers::TranslationHelper::NO_DEFAULT = T.let(T.unsafe(nil), Array) +# = Action View URL \Helpers +# # Provides a set of methods for making links and getting URLs that # depend on the routing subsystem (see ActionDispatch::Routing). # This allows you to use the same format for links in views # and controllers. # -# source://actionview//lib/action_view/helpers/url_helper.rb#15 +# source://actionview//lib/action_view/helpers/url_helper.rb#17 module ActionView::Helpers::UrlHelper include ::ActionView::Helpers::CaptureHelper include ::ActionView::Helpers::OutputSafetyHelper include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper extend ::ActiveSupport::Concern mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods @@ -10365,9 +11521,6 @@ module ActionView::Helpers::UrlHelper # Generates a form containing a single button that submits to the URL created # by the set of +options+. This is the safest method to ensure links that # cause changes to your data are not triggered by search bots or accelerators. - # If the HTML button does not work with your layout, you can also consider - # using the +link_to+ method with the :method modifier as described in - # the +link_to+ documentation. # # You can control the form and button behavior with +html_options+. Most # values in +html_options+ are passed through to the button element. For @@ -10378,8 +11531,13 @@ module ActionView::Helpers::UrlHelper # +:form_class+ option within +html_options+. It defaults to # "button_to" to allow styling of the form and its children. # - # The form submits a POST request by default. You can specify a different - # HTTP verb via the +:method+ option within +html_options+. + # The form submits a POST request by default if the object is not persisted; + # conversely, if the object is persisted, it will submit a PATCH request. + # To specify a different HTTP verb use the +:method+ option within +html_options+. + # + # If the HTML button generated from +button_to+ does not work with your layout, you can + # consider using the +link_to+ method with the +data-turbo-method+ + # attribute as described in the +link_to+ documentation. # # ==== Options # The +options+ hash accepts the same options as +url_for+. To generate a @@ -10446,45 +11604,74 @@ module ActionView::Helpers::UrlHelper # # # #

    " # - # ==== Deprecated: Rails UJS Attributes + # source://actionview//lib/action_view/helpers/url_helper.rb#296 + def button_to(name = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # source://actionview//lib/action_view/helpers/url_helper.rb#35 + def button_to_generates_button_tag; end + + # source://actionview//lib/action_view/helpers/url_helper.rb#35 + def button_to_generates_button_tag=(val); end + + # True if the current request URI was generated by the given +options+. # - # Prior to Rails 7, Rails shipped with a JavaScript library called @rails/ujs on by default. Following Rails 7, - # this library is no longer on by default. This library integrated with the following options: + # ==== Examples + # Let's say we're in the http://www.example.com/shop/checkout?order=desc&page=1 action. # - # * :remote - If set to true, will allow @rails/ujs to control the - # submit behavior. By default this behavior is an Ajax submit. + # current_page?(action: 'process') + # # => false # - # @rails/ujs also integrated with the following +:data+ options: + # current_page?(action: 'checkout') + # # => true # - # * confirm: "question?" - This will allow @rails/ujs - # to prompt with the question specified (in this case, the - # resulting text would be question?). If the user accepts, the - # button is processed normally, otherwise no action is taken. - # * :disable_with - Value of this parameter will be - # used as the value for a disabled version of the submit - # button when the form is submitted. + # current_page?(controller: 'library', action: 'checkout') + # # => false # - # ===== Rails UJS Examples + # current_page?(controller: 'shop', action: 'checkout') + # # => true # - # <%= button_to "Create", { action: "create" }, remote: true, form: { "data-type" => "json" } %> - # # => "
    - # # - # # - # #
    " + # current_page?(controller: 'shop', action: 'checkout', order: 'asc') + # # => false + # + # current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '1') + # # => true + # + # current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '2') + # # => false + # + # current_page?('http://www.example.com/shop/checkout') + # # => true + # + # current_page?('http://www.example.com/shop/checkout', check_parameters: true) + # # => false + # + # current_page?('/shop/checkout') + # # => true + # + # current_page?('http://www.example.com/shop/checkout?order=desc&page=1') + # # => true + # + # Different actions may share the same URL path but have a different HTTP method. Let's say we + # sent a POST to http://www.example.com/products and rendered a validation error. + # + # current_page?(controller: 'product', action: 'index') + # # => false + # + # current_page?(controller: 'product', action: 'create') + # # => false + # + # current_page?(controller: 'product', action: 'create', method: :post) + # # => true + # + # current_page?(controller: 'product', action: 'index', method: [:get, :post]) + # # => true + # + # We can also pass in the symbol arguments instead of strings. # - # source://actionview//lib/action_view/helpers/url_helper.rb#331 - def button_to(name = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end - - # source://actionview//lib/action_view/helpers/url_helper.rb#32 - def button_to_generates_button_tag; end - - # source://actionview//lib/action_view/helpers/url_helper.rb#32 - def button_to_generates_button_tag=(val); end - # @return [Boolean] # - # source://actionview//lib/action_view/helpers/url_helper.rb#619 - def current_page?(*args); end + # source://actionview//lib/action_view/helpers/url_helper.rb#559 + def current_page?(options = T.unsafe(nil), check_parameters: T.unsafe(nil), method: T.unsafe(nil), **options_as_kwargs); end # Creates an anchor element of the given +name+ using a URL created by the set of +options+. # See the valid options in the documentation for +url_for+. It's also possible to @@ -10519,7 +11706,7 @@ module ActionView::Helpers::UrlHelper # ==== Examples # # Because it relies on +url_for+, +link_to+ supports both older-style controller/action/id arguments - # and newer RESTful routes. Current Rails style favors RESTful routes whenever possible, so base + # and newer RESTful routes. Current \Rails style favors RESTful routes whenever possible, so base # your application on resources and use # # link_to "Profile", profile_path(@profile) @@ -10596,43 +11783,29 @@ module ActionView::Helpers::UrlHelper # link_to "External link", "http://www.rubyonrails.org/", target: "_blank", rel: "nofollow" # # => External link # - # ==== Deprecated: Rails UJS Attributes + # ==== Turbo # - # Prior to Rails 7, Rails shipped with a JavaScript library called @rails/ujs on by default. Following Rails 7, - # this library is no longer on by default. This library integrated with the following options: + # Rails 7 ships with Turbo enabled by default. Turbo provides the following +:data+ options: # - # * method: symbol of HTTP verb - This modifier will dynamically - # create an HTML form and immediately submit the form for processing using - # the HTTP verb specified. Useful for having links perform a POST operation - # in dangerous actions like deleting a record (which search bots can follow - # while spidering your site). Supported verbs are :post, :delete, :patch, and :put. - # Note that if the user has JavaScript disabled, the request will fall back - # to using GET. If href: '#' is used and the user has JavaScript - # disabled clicking the link will have no effect. If you are relying on the - # POST behavior, you should check for it in your controller's action by using - # the request object's methods for post?, delete?, patch?, or put?. - # * remote: true - This will allow @rails/ujs - # to make an Ajax request to the URL in question instead of following - # the link. + # * turbo_method: symbol of HTTP verb - Performs a Turbo link visit + # with the given HTTP verb. Forms are recommended when performing non-+GET+ requests. + # Only use data-turbo-method where a form is not possible. # - # @rails/ujs also integrated with the following +:data+ options: + # * turbo_confirm: "question?" - Adds a confirmation dialog to the link with the + # given value. # - # * confirm: "question?" - This will allow @rails/ujs - # to prompt with the question specified (in this case, the - # resulting text would be question?). If the user accepts, the - # link is processed normally, otherwise no action is taken. - # * :disable_with - Value of this parameter will be used as the - # name for a disabled version of the link. + # {Consult the Turbo Handbook for more information on the options + # above.}[https://turbo.hotwired.dev/handbook/drive#performing-visits-with-a-different-method] # - # ===== Rails UJS Examples + # ===== \Examples # - # link_to "Remove Profile", profile_path(@profile), method: :delete - # # => Remove Profile + # link_to "Delete profile", @profile, data: { turbo_method: :delete } + # # => Delete profile # - # link_to "Visit Other Site", "http://www.rubyonrails.org/", data: { confirm: "Are you sure?" } - # # => Visit Other Site + # link_to "Visit Other Site", "https://rubyonrails.org/", data: { turbo_confirm: "Are you sure?" } + # # => Visit Other Site # - # source://actionview//lib/action_view/helpers/url_helper.rb#209 + # source://actionview//lib/action_view/helpers/url_helper.rb#198 def link_to(name = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end # Creates a link tag of the given +name+ using a URL created by the set of @@ -10655,7 +11828,7 @@ module ActionView::Helpers::UrlHelper # # If they are logged in... # # => my_username # - # source://actionview//lib/action_view/helpers/url_helper.rb#471 + # source://actionview//lib/action_view/helpers/url_helper.rb#438 def link_to_if(condition, name, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end # Creates a link tag of the given +name+ using a URL created by the set of @@ -10679,7 +11852,7 @@ module ActionView::Helpers::UrlHelper # # If not... # # => Reply # - # source://actionview//lib/action_view/helpers/url_helper.rb#448 + # source://actionview//lib/action_view/helpers/url_helper.rb#415 def link_to_unless(condition, name, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end # Creates a link tag of the given +name+ using a URL created by the set of @@ -10721,7 +11894,7 @@ module ActionView::Helpers::UrlHelper # end # %> # - # source://actionview//lib/action_view/helpers/url_helper.rb#424 + # source://actionview//lib/action_view/helpers/url_helper.rb#391 def link_to_unless_current(name, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end # Creates a mailto link tag to the specified +email_address+, which is @@ -10736,10 +11909,10 @@ module ActionView::Helpers::UrlHelper # * :body - Preset the body of the email. # * :cc - Carbon Copy additional recipients on the email. # * :bcc - Blind Carbon Copy additional recipients on the email. - # * :reply_to - Preset the Reply-To field of the email. + # * :reply_to - Preset the +Reply-To+ field of the email. # # ==== Obfuscation - # Prior to Rails 4.0, +mail_to+ provided options for encoding the address + # Prior to \Rails 4.0, +mail_to+ provided options for encoding the address # in order to hinder email harvesters. To take advantage of these options, # install the +actionview-encoded_mail_to+ gem. # @@ -10763,7 +11936,7 @@ module ActionView::Helpers::UrlHelper # Email me: me@domain.com # # - # source://actionview//lib/action_view/helpers/url_helper.rb#521 + # source://actionview//lib/action_view/helpers/url_helper.rb#488 def mail_to(email_address, name = T.unsafe(nil), html_options = T.unsafe(nil), &block); end # Creates a TEL anchor link tag to the specified +phone_number+. When the @@ -10802,7 +11975,7 @@ module ActionView::Helpers::UrlHelper # Phone me: # # - # source://actionview//lib/action_view/helpers/url_helper.rb#716 + # source://actionview//lib/action_view/helpers/url_helper.rb#693 def phone_to(phone_number, name = T.unsafe(nil), html_options = T.unsafe(nil), &block); end # Creates an SMS anchor link tag to the specified +phone_number+. When the @@ -10846,45 +12019,45 @@ module ActionView::Helpers::UrlHelper # Text me: # # - # source://actionview//lib/action_view/helpers/url_helper.rb#665 + # source://actionview//lib/action_view/helpers/url_helper.rb#642 def sms_to(phone_number, name = T.unsafe(nil), html_options = T.unsafe(nil), &block); end # Basic implementation of url_for to allow use helpers without routes existence # - # source://actionview//lib/action_view/helpers/url_helper.rb#35 + # source://actionview//lib/action_view/helpers/url_helper.rb#38 def url_for(options = T.unsafe(nil)); end private - # source://actionview//lib/action_view/helpers/url_helper.rb#47 + # source://actionview//lib/action_view/helpers/url_helper.rb#50 def _back_url; end - # source://actionview//lib/action_view/helpers/url_helper.rb#52 + # source://actionview//lib/action_view/helpers/url_helper.rb#55 def _filtered_referrer; end - # source://actionview//lib/action_view/helpers/url_helper.rb#759 + # source://actionview//lib/action_view/helpers/url_helper.rb#736 def add_method_to_attributes!(html_options, method); end - # source://actionview//lib/action_view/helpers/url_helper.rb#730 + # source://actionview//lib/action_view/helpers/url_helper.rb#707 def convert_options_to_data_attributes(options, html_options); end # @return [Boolean] # - # source://actionview//lib/action_view/helpers/url_helper.rb#753 + # source://actionview//lib/action_view/helpers/url_helper.rb#730 def link_to_remote_options?(options); end - # source://actionview//lib/action_view/helpers/url_helper.rb#770 + # source://actionview//lib/action_view/helpers/url_helper.rb#747 def method_for_options(options); end # @return [Boolean] # - # source://actionview//lib/action_view/helpers/url_helper.rb#788 + # source://actionview//lib/action_view/helpers/url_helper.rb#765 def method_not_get_method?(method); end - # source://actionview//lib/action_view/helpers/url_helper.rb#807 + # source://actionview//lib/action_view/helpers/url_helper.rb#786 def method_tag(method); end - # source://actionview//lib/action_view/helpers/url_helper.rb#853 + # source://actionview//lib/action_view/helpers/url_helper.rb#834 def remove_trailing_slash!(url_string); end # Returns an array of hashes each containing :name and :value keys @@ -10904,20 +12077,20 @@ module ActionView::Helpers::UrlHelper # to_form_params({ name: 'Denmark' }, 'country') # # => [{name: 'country[name]', value: 'Denmark'}] # - # source://actionview//lib/action_view/helpers/url_helper.rb#827 + # source://actionview//lib/action_view/helpers/url_helper.rb#808 def to_form_params(attribute, namespace = T.unsafe(nil)); end - # source://actionview//lib/action_view/helpers/url_helper.rb#793 + # source://actionview//lib/action_view/helpers/url_helper.rb#770 def token_tag(token = T.unsafe(nil), form_options: T.unsafe(nil)); end - # source://actionview//lib/action_view/helpers/url_helper.rb#745 + # source://actionview//lib/action_view/helpers/url_helper.rb#722 def url_target(name, options); end class << self - # source://actionview//lib/action_view/helpers/url_helper.rb#32 + # source://actionview//lib/action_view/helpers/url_helper.rb#35 def button_to_generates_button_tag; end - # source://actionview//lib/action_view/helpers/url_helper.rb#32 + # source://actionview//lib/action_view/helpers/url_helper.rb#35 def button_to_generates_button_tag=(val); end end end @@ -10928,16 +12101,16 @@ end # (link_to_unless_current, for instance), which must be provided # as a method called #request on the context. # -# source://actionview//lib/action_view/helpers/url_helper.rb#21 +# source://actionview//lib/action_view/helpers/url_helper.rb#23 ActionView::Helpers::UrlHelper::BUTTON_TAG_METHOD_VERBS = T.let(T.unsafe(nil), Array) -# source://actionview//lib/action_view/helpers/url_helper.rb#26 +# source://actionview//lib/action_view/helpers/url_helper.rb#29 module ActionView::Helpers::UrlHelper::ClassMethods - # source://actionview//lib/action_view/helpers/url_helper.rb#27 + # source://actionview//lib/action_view/helpers/url_helper.rb#30 def _url_for_modules; end end -# source://actionview//lib/action_view/helpers/url_helper.rb#780 +# source://actionview//lib/action_view/helpers/url_helper.rb#757 ActionView::Helpers::UrlHelper::STRINGIFIED_COMMON_METHODS = T.let(T.unsafe(nil), Hash) # This is a class to fix I18n global state. Whenever you provide I18n.locale during a request, @@ -10950,10 +12123,10 @@ class ActionView::I18nProxy < ::I18n::Config # source://actionview//lib/action_view/rendering.rb#11 def initialize(original_config, lookup_context); end - # source://actionview//lib/action_view/rendering.rb#16 + # source://actionview//lib/action_view/rendering.rb#17 def locale; end - # source://actionview//lib/action_view/rendering.rb#20 + # source://actionview//lib/action_view/rendering.rb#21 def locale=(value); end # source://actionview//lib/action_view/rendering.rb#9 @@ -10963,12 +12136,14 @@ class ActionView::I18nProxy < ::I18n::Config def original_config; end end +# = Action View \Layouts +# # Layouts reverse the common pattern of including shared headers and footers in many templates to isolate changes in # repeated setups. The inclusion pattern has pages that look like this: # -# <%= render "shared/header" %> +# <%= render "application/header" %> # Hello World -# <%= render "shared/footer" %> +# <%= render "application/footer" %> # # This approach is a decent way of keeping common structures isolated from the changing content, but it's verbose # and if you ever want to change the structure of these two includes, you'll have to change all the templates. @@ -11109,7 +12284,7 @@ end # The template will be looked always in app/views/layouts/ folder. But you can point # layouts folder direct also. layout "layouts/demo" is the same as layout "demo". # -# Setting the layout to +nil+ forces it to be looked up in the filesystem and fallbacks to the parent behavior if none exists. +# Setting the layout to +nil+ forces it to be looked up in the filesystem and falls back to the parent behavior if none exists. # Setting it to +nil+ is useful to re-enable template lookup overriding a previous configuration set in the parent: # # class ApplicationController < ActionController::Base @@ -11121,7 +12296,7 @@ end # end # # class CommentsController < ApplicationController -# # Will search for "comments" layout and fallback "application" layout +# # Will search for "comments" layout and fall back to "application" layout # layout nil # end # @@ -11160,7 +12335,7 @@ end # # This will override the controller-wide "weblog_standard" layout, and will render the help action with the "help" layout instead. # -# source://actionview//lib/action_view/layouts.rb#203 +# source://actionview//lib/action_view/layouts.rb#205 module ActionView::Layouts extend ::ActiveSupport::Concern include GeneratedInstanceMethods @@ -11175,12 +12350,10 @@ module ActionView::Layouts # source://actionview//lib/action_view/layouts.rb#361 def initialize(*_arg0); end - # source://actionview//lib/action_view/layouts.rb#215 - def _layout_conditions(*_arg0, &_arg1); end - # source://actionview//lib/action_view/layouts.rb#350 - def _normalize_options(options); end + def _process_render_template_options(options); end + # source://actionview//lib/action_view/layouts.rb#359 def action_has_layout=(_arg0); end # Controls whether an action should be rendered using a layout. @@ -11214,7 +12387,7 @@ module ActionView::Layouts # * template - The template object for the default layout (or +nil+) # # source://actionview//lib/action_view/layouts.rb#415 - def _default_layout(lookup_context, formats, require_layout = T.unsafe(nil)); end + def _default_layout(lookup_context, formats, keys, require_layout = T.unsafe(nil)); end # @return [Boolean] # @@ -11246,7 +12419,10 @@ module ActionView::Layouts def _layout_conditions?; end end - module GeneratedInstanceMethods; end + module GeneratedInstanceMethods + def _layout_conditions; end + def _layout_conditions?; end + end end # source://actionview//lib/action_view/layouts.rb#217 @@ -11319,57 +12495,80 @@ module ActionView::Layouts::ClassMethods::LayoutConditions def _conditional_layout?; end end -# = Action View Log Subscriber -# -# Provides functionality so that Rails can output logs from Action View. -# -# source://actionview//lib/action_view/log_subscriber.rb#9 +# source://actionview//lib/action_view/log_subscriber.rb#6 class ActionView::LogSubscriber < ::ActiveSupport::LogSubscriber + include ::ActionView::LogSubscriber::Utils + # @return [LogSubscriber] a new instance of LogSubscriber # - # source://actionview//lib/action_view/log_subscriber.rb#12 + # source://actionview//lib/action_view/log_subscriber.rb#9 def initialize; end - # source://actionview//lib/action_view/log_subscriber.rb#59 - def logger; end - # source://actionview//lib/action_view/log_subscriber.rb#42 def render_collection(event); end - # source://actionview//lib/action_view/log_subscriber.rb#35 + # source://actionview//lib/action_view/log_subscriber.rb#34 def render_layout(event); end - # source://actionview//lib/action_view/log_subscriber.rb#25 + # source://actionview//lib/action_view/log_subscriber.rb#23 def render_partial(event); end - # source://actionview//lib/action_view/log_subscriber.rb#17 + # source://actionview//lib/action_view/log_subscriber.rb#14 def render_template(event); end - # source://actionview//lib/action_view/log_subscriber.rb#53 - def start(name, id, payload); end - private - # source://actionview//lib/action_view/log_subscriber.rb#83 + # source://actionview//lib/action_view/log_subscriber.rb#118 def cache_message(payload); end - # source://actionview//lib/action_view/log_subscriber.rb#65 - def from_rails_root(string); end + # source://actionview//lib/action_view/log_subscriber.rb#110 + def render_count(payload); end - # source://actionview//lib/action_view/log_subscriber.rb#92 - def log_rendering_start(payload, name); end + class << self + # source://actionview//lib/action_view/log_subscriber.rb#102 + def attach_to(*_arg0); end - # source://actionview//lib/action_view/log_subscriber.rb#71 - def rails_root; end + private - # source://actionview//lib/action_view/log_subscriber.rb#75 - def render_count(payload); end + # source://actionview//lib/action_view/log_subscriber.rb#21 + def __class_attr_log_levels; end + + # source://actionview//lib/action_view/log_subscriber.rb#21 + def __class_attr_log_levels=(new_value); end + end +end + +# source://actionview//lib/action_view/log_subscriber.rb#73 +class ActionView::LogSubscriber::Start + include ::ActionView::LogSubscriber::Utils + + # source://actionview//lib/action_view/log_subscriber.rb#94 + def finish(name, id, payload); end + + # @return [Boolean] + # + # source://actionview//lib/action_view/log_subscriber.rb#97 + def silenced?(_); end + + # source://actionview//lib/action_view/log_subscriber.rb#76 + def start(name, id, payload); end end -# source://actionview//lib/action_view/log_subscriber.rb#64 -ActionView::LogSubscriber::EMPTY = T.let(T.unsafe(nil), String) +# source://actionview//lib/action_view/log_subscriber.rb#54 +module ActionView::LogSubscriber::Utils + # source://actionview//lib/action_view/log_subscriber.rb#55 + def logger; end + + private + + # source://actionview//lib/action_view/log_subscriber.rb#60 + def from_rails_root(string); end + + # source://actionview//lib/action_view/log_subscriber.rb#66 + def rails_root; end +end -# source://actionview//lib/action_view/log_subscriber.rb#10 +# source://actionview//lib/action_view/log_subscriber.rb#7 ActionView::LogSubscriber::VIEWS_PATTERN = T.let(T.unsafe(nil), Regexp) # = Action View Lookup Context @@ -11388,28 +12587,28 @@ class ActionView::LookupContext # @return [LookupContext] a new instance of LookupContext # - # source://actionview//lib/action_view/lookup_context.rb#216 + # source://actionview//lib/action_view/lookup_context.rb#232 def initialize(view_paths, details = T.unsafe(nil), prefixes = T.unsafe(nil)); end - # source://actionview//lib/action_view/lookup_context.rb#226 + # source://actionview//lib/action_view/lookup_context.rb#242 def digest_cache; end # Override formats= to expand ["*/*"] values and automatically # add :html as fallback to :js. # - # source://actionview//lib/action_view/lookup_context.rb#247 + # source://actionview//lib/action_view/lookup_context.rb#263 def formats=(values); end # Override locale to return a symbol instead of array. # - # source://actionview//lib/action_view/lookup_context.rb#267 + # source://actionview//lib/action_view/lookup_context.rb#283 def locale; end # Overload locale= to also set the I18n.locale. If the current I18n.config object responds # to original_config, it means that it has a copy of the original I18n configuration and it's # acting as proxy, which we need to skip. # - # source://actionview//lib/action_view/lookup_context.rb#274 + # source://actionview//lib/action_view/lookup_context.rb#290 def locale=(value); end # source://actionview//lib/action_view/lookup_context.rb#16 @@ -11418,18 +12617,12 @@ class ActionView::LookupContext # source://actionview//lib/action_view/lookup_context.rb#16 def prefixes=(_arg0); end - # source://actionview//lib/action_view/lookup_context.rb#16 - def rendered_format; end - - # source://actionview//lib/action_view/lookup_context.rb#16 - def rendered_format=(_arg0); end - - # source://actionview//lib/action_view/lookup_context.rb#230 + # source://actionview//lib/action_view/lookup_context.rb#246 def with_prepended_formats(formats); end private - # source://actionview//lib/action_view/lookup_context.rb#237 + # source://actionview//lib/action_view/lookup_context.rb#253 def initialize_details(target, details); end class << self @@ -11448,40 +12641,40 @@ end # # source://actionview//lib/action_view/lookup_context.rb#39 module ActionView::LookupContext::Accessors - # source://actionview//lib/action_view/lookup_context.rb#50 + # source://actionview//lib/action_view/lookup_context.rb#25 def default_formats; end - # source://actionview//lib/action_view/lookup_context.rb#52 + # source://actionview//lib/action_view/lookup_context.rb#25 def default_handlers; end - # source://actionview//lib/action_view/lookup_context.rb#43 + # source://actionview//lib/action_view/lookup_context.rb#25 def default_locale; end - # source://actionview//lib/action_view/lookup_context.rb#51 + # source://actionview//lib/action_view/lookup_context.rb#25 def default_variants; end - # source://actionview//lib/action_view/lookup_context.rb#27 + # source://actionview//lib/action_view/lookup_context.rb#26 def formats; end - # source://actionview//lib/action_view/lookup_context.rb#31 + # source://actionview//lib/action_view/lookup_context.rb#26 def formats=(value); end - # source://actionview//lib/action_view/lookup_context.rb#27 + # source://actionview//lib/action_view/lookup_context.rb#26 def handlers; end - # source://actionview//lib/action_view/lookup_context.rb#31 + # source://actionview//lib/action_view/lookup_context.rb#26 def handlers=(value); end - # source://actionview//lib/action_view/lookup_context.rb#27 + # source://actionview//lib/action_view/lookup_context.rb#26 def locale; end - # source://actionview//lib/action_view/lookup_context.rb#31 + # source://actionview//lib/action_view/lookup_context.rb#26 def locale=(value); end - # source://actionview//lib/action_view/lookup_context.rb#27 + # source://actionview//lib/action_view/lookup_context.rb#26 def variants; end - # source://actionview//lib/action_view/lookup_context.rb#31 + # source://actionview//lib/action_view/lookup_context.rb#26 def variants=(value); end end @@ -11490,43 +12683,44 @@ ActionView::LookupContext::Accessors::DEFAULT_PROCS = T.let(T.unsafe(nil), Hash) # Add caching behavior on top of Details. # -# source://actionview//lib/action_view/lookup_context.rb#94 +# source://actionview//lib/action_view/lookup_context.rb#98 module ActionView::LookupContext::DetailsCache # Returns the value of attribute cache. # - # source://actionview//lib/action_view/lookup_context.rb#95 + # source://actionview//lib/action_view/lookup_context.rb#99 def cache; end # Sets the attribute cache # # @param value the value to set the attribute cache to. # - # source://actionview//lib/action_view/lookup_context.rb#95 + # source://actionview//lib/action_view/lookup_context.rb#99 def cache=(_arg0); end # Calculate the details key. Remove the handlers from calculation to improve performance # since the user cannot modify it explicitly. # - # source://actionview//lib/action_view/lookup_context.rb#99 + # source://actionview//lib/action_view/lookup_context.rb#103 def details_key; end # Temporary skip passing the details_key forward. # - # source://actionview//lib/action_view/lookup_context.rb#104 + # source://actionview//lib/action_view/lookup_context.rb#108 def disable_cache; end private - # source://actionview//lib/action_view/lookup_context.rb#112 + # source://actionview//lib/action_view/lookup_context.rb#116 def _set_detail(key, value); end end # source://actionview//lib/action_view/lookup_context.rb#54 class ActionView::LookupContext::DetailsKey + # source://actionview//lib/action_view/lookup_context.rb#55 def eql?(_arg0); end class << self - # source://actionview//lib/action_view/lookup_context.rb#73 + # source://actionview//lib/action_view/lookup_context.rb#77 def clear; end # source://actionview//lib/action_view/lookup_context.rb#65 @@ -11535,55 +12729,61 @@ class ActionView::LookupContext::DetailsKey # source://actionview//lib/action_view/lookup_context.rb#61 def digest_cache(details); end - # source://actionview//lib/action_view/lookup_context.rb#82 + # source://actionview//lib/action_view/lookup_context.rb#86 def digest_caches; end - # source://actionview//lib/action_view/lookup_context.rb#86 - def view_context_class(klass); end + # source://actionview//lib/action_view/lookup_context.rb#90 + def view_context_class; end end end # Helpers related to template lookup using the lookup context information. # -# source://actionview//lib/action_view/lookup_context.rb#121 +# source://actionview//lib/action_view/lookup_context.rb#125 module ActionView::LookupContext::ViewPaths # @return [Boolean] # - # source://actionview//lib/action_view/lookup_context.rb#144 + # source://actionview//lib/action_view/lookup_context.rb#148 def any?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil)); end # @return [Boolean] # - # source://actionview//lib/action_view/lookup_context.rb#144 + # source://actionview//lib/action_view/lookup_context.rb#153 def any_templates?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil)); end + # source://actionview//lib/action_view/lookup_context.rb#155 + def append_view_paths(paths); end + # @return [Boolean] # - # source://actionview//lib/action_view/lookup_context.rb#137 + # source://actionview//lib/action_view/lookup_context.rb#141 def exists?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), **options); end - # source://actionview//lib/action_view/lookup_context.rb#124 + # source://actionview//lib/action_view/lookup_context.rb#128 def find(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), options = T.unsafe(nil)); end - # source://actionview//lib/action_view/lookup_context.rb#131 + # source://actionview//lib/action_view/lookup_context.rb#135 def find_all(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), options = T.unsafe(nil)); end - # source://actionview//lib/action_view/lookup_context.rb#124 + # source://actionview//lib/action_view/lookup_context.rb#133 def find_template(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), options = T.unsafe(nil)); end # Returns the value of attribute html_fallback_for_js. # - # source://actionview//lib/action_view/lookup_context.rb#122 + # source://actionview//lib/action_view/lookup_context.rb#126 def html_fallback_for_js; end + # source://actionview//lib/action_view/lookup_context.rb#159 + def prepend_view_paths(paths); end + # @return [Boolean] # - # source://actionview//lib/action_view/lookup_context.rb#137 + # source://actionview//lib/action_view/lookup_context.rb#146 def template_exists?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil), keys = T.unsafe(nil), **options); end # Returns the value of attribute view_paths. # - # source://actionview//lib/action_view/lookup_context.rb#122 + # source://actionview//lib/action_view/lookup_context.rb#126 def view_paths; end private @@ -11591,30 +12791,30 @@ module ActionView::LookupContext::ViewPaths # Whenever setting view paths, makes a copy so that we can manipulate them in # instance objects as we wish. # - # source://actionview//lib/action_view/lookup_context.rb#154 + # source://actionview//lib/action_view/lookup_context.rb#166 def build_view_paths(paths); end # Compute details hash and key according to user options (e.g. passed from #render). # - # source://actionview//lib/action_view/lookup_context.rb#159 + # source://actionview//lib/action_view/lookup_context.rb#175 def detail_args_for(options); end - # source://actionview//lib/action_view/lookup_context.rb#172 + # source://actionview//lib/action_view/lookup_context.rb#188 def detail_args_for_any; end # Fix when prefix is specified as part of the template name # - # source://actionview//lib/action_view/lookup_context.rb#193 + # source://actionview//lib/action_view/lookup_context.rb#209 def normalize_name(name, prefixes); end end -# source://actionview//lib/action_view/template/error.rb#29 +# source://actionview//lib/action_view/template/error.rb#41 class ActionView::MissingTemplate < ::ActionView::ActionViewError include ::DidYouMean::Correctable # @return [MissingTemplate] a new instance of MissingTemplate # - # source://actionview//lib/action_view/template/error.rb#32 + # source://actionview//lib/action_view/template/error.rb#44 def initialize(paths, path, prefixes, partial, details, *_arg5); end # Apps may have thousands of candidate templates so we attempt to @@ -11622,54 +12822,56 @@ class ActionView::MissingTemplate < ::ActionView::ActionViewError # First we split templates into prefixes and basenames, so that those can # be matched separately. # - # source://actionview//lib/action_view/template/error.rb#92 + # source://actionview//lib/action_view/template/error.rb#104 def corrections; end # Returns the value of attribute partial. # - # source://actionview//lib/action_view/template/error.rb#30 + # source://actionview//lib/action_view/template/error.rb#42 def partial; end # Returns the value of attribute path. # - # source://actionview//lib/action_view/template/error.rb#30 + # source://actionview//lib/action_view/template/error.rb#42 def path; end # Returns the value of attribute paths. # - # source://actionview//lib/action_view/template/error.rb#30 + # source://actionview//lib/action_view/template/error.rb#42 def paths; end # Returns the value of attribute prefixes. # - # source://actionview//lib/action_view/template/error.rb#30 + # source://actionview//lib/action_view/template/error.rb#42 def prefixes; end end -# source://actionview//lib/action_view/template/error.rb#59 +# source://actionview//lib/action_view/template/error.rb#71 class ActionView::MissingTemplate::Results # @return [Results] a new instance of Results # - # source://actionview//lib/action_view/template/error.rb#62 + # source://actionview//lib/action_view/template/error.rb#74 def initialize(size); end - # source://actionview//lib/action_view/template/error.rb#79 + # source://actionview//lib/action_view/template/error.rb#91 def add(path, score); end # @return [Boolean] # - # source://actionview//lib/action_view/template/error.rb#71 + # source://actionview//lib/action_view/template/error.rb#83 def should_record?(score); end - # source://actionview//lib/action_view/template/error.rb#67 + # source://actionview//lib/action_view/template/error.rb#79 def to_a; end end -# source://actionview//lib/action_view/template/error.rb#60 +# source://actionview//lib/action_view/template/error.rb#72 class ActionView::MissingTemplate::Results::Result < ::Struct # Returns the value of attribute path # # @return [Object] the current value of path + # + # source://actionview//lib/action_view/template/error.rb#72 def path; end # Sets the attribute path @@ -11677,12 +12879,14 @@ class ActionView::MissingTemplate::Results::Result < ::Struct # @param value [Object] the value to set the attribute path to. # @return [Object] the newly set value # - # source://actionview//lib/action_view/template/error.rb#60 + # source://actionview//lib/action_view/template/error.rb#72 def path=(_); end # Returns the value of attribute score # # @return [Object] the current value of score + # + # source://actionview//lib/action_view/template/error.rb#72 def score; end # Sets the attribute score @@ -11690,13 +12894,23 @@ class ActionView::MissingTemplate::Results::Result < ::Struct # @param value [Object] the value to set the attribute score to. # @return [Object] the newly set value # - # source://actionview//lib/action_view/template/error.rb#60 + # source://actionview//lib/action_view/template/error.rb#72 def score=(_); end class << self + # source://actionview//lib/action_view/template/error.rb#72 def [](*_arg0); end + + # source://actionview//lib/action_view/template/error.rb#72 def inspect; end + + # source://actionview//lib/action_view/template/error.rb#72 + def keyword_init?; end + + # source://actionview//lib/action_view/template/error.rb#72 def members; end + + # source://actionview//lib/action_view/template/error.rb#72 def new(*_arg0); end end end @@ -11752,23 +12966,80 @@ end # puts sbuf # => "hello\u0005" # # source://actionview//lib/action_view/buffers.rb#21 -class ActionView::OutputBuffer < ::ActiveSupport::SafeBuffer +class ActionView::OutputBuffer # @return [OutputBuffer] a new instance of OutputBuffer # # source://actionview//lib/action_view/buffers.rb#22 - def initialize(*_arg0); end + def initialize(buffer = T.unsafe(nil)); end - # source://actionview//lib/action_view/buffers.rb#27 + # source://actionview//lib/action_view/buffers.rb#42 def <<(value); end - # source://actionview//lib/action_view/buffers.rb#27 + # source://actionview//lib/action_view/buffers.rb#81 + def ==(other); end + + # source://actionview//lib/action_view/buffers.rb#54 def append=(value); end - # source://activesupport/7.0.4/lib/active_support/core_ext/string/output_safety.rb#195 + # source://actionview//lib/action_view/buffers.rb#27 + def blank?(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/buffers.rb#72 + def capture(*args); end + + # source://actionview//lib/action_view/buffers.rb#53 + def concat(value); end + + # source://actionview//lib/action_view/buffers.rb#27 + def empty?(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/buffers.rb#27 + def encode!(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/buffers.rb#27 + def encoding(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/buffers.rb#27 + def force_encoding(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/buffers.rb#32 + def html_safe; end + + # @return [Boolean] + # + # source://actionview//lib/action_view/buffers.rb#38 + def html_safe?; end + + # source://actionview//lib/action_view/buffers.rb#27 + def length(*_arg0, **_arg1, &_arg2); end + + # source://actionview//lib/action_view/buffers.rb#85 + def raw; end + + # Returns the value of attribute raw_buffer. + # + # source://actionview//lib/action_view/buffers.rb#89 + def raw_buffer; end + + # source://actionview//lib/action_view/buffers.rb#60 def safe_append=(value); end - # source://actionview//lib/action_view/buffers.rb#33 + # source://actionview//lib/action_view/buffers.rb#56 + def safe_concat(value); end + + # source://actionview//lib/action_view/buffers.rb#62 def safe_expr_append=(val); end + + # source://actionview//lib/action_view/buffers.rb#29 + def to_s; end + + # source://actionview//lib/action_view/buffers.rb#34 + def to_str; end + + private + + # source://actionview//lib/action_view/buffers.rb#68 + def initialize_copy(other); end end # source://actionview//lib/action_view/flows.rb#6 @@ -11785,7 +13056,7 @@ class ActionView::OutputFlow # Called by content_for # - # source://actionview//lib/action_view/flows.rb#24 + # source://actionview//lib/action_view/flows.rb#27 def append!(key, value); end # Returns the value of attribute content. @@ -11884,6 +13155,22 @@ end # # <%= render partial: "account", locals: { user: @buyer } %> # +# == \Rendering variants of a partial +# +# The :variants option can be used to render a different template variant of a partial. For instance: +# +# <%= render partial: "account", variants: :mobile %> +# +# This will render _account.html+mobile.erb. This option also accepts multiple variants +# like so: +# +# <%= render partial: "account", variants: [:desktop, :mobile] %> +# +# This will look for the following templates and render the first one that exists: +# * _account.html+desktop.erb +# * _account.html+mobile.erb +# * _account.html.erb +# # == \Rendering a collection of partials # # The example of partial use describes a familiar pattern where a template needs to iterate over an array and @@ -11930,7 +13217,7 @@ end # # <%= render partial: "accounts/account", locals: { account: @account} %> # <%= render partial: @account %> # -# # @posts is an array of Post instances, so every post record returns 'posts/post' on +to_partial_path+, +# # @posts is an array of Post instances, so every post record returns 'posts/post' on #to_partial_path, # # that's why we can replace: # # <%= render partial: "posts/post", collection: @posts %> # <%= render partial: @posts %> @@ -11950,7 +13237,7 @@ end # # <%= render partial: "accounts/account", locals: { account: @account} %> # <%= render @account %> # -# # @posts is an array of Post instances, so every post record returns 'posts/post' on +to_partial_path+, +# # @posts is an array of Post instances, so every post record returns 'posts/post' on #to_partial_path, # # that's why we can replace: # # <%= render partial: "posts/post", collection: @posts %> # <%= render @posts %> @@ -12054,44 +13341,69 @@ end # # As you can see, the :locals hash is shared between both the partial and its layout. # -# source://actionview//lib/action_view/renderer/partial_renderer.rb#220 +# source://actionview//lib/action_view/renderer/partial_renderer.rb#236 class ActionView::PartialRenderer < ::ActionView::AbstractRenderer include ::ActionView::CollectionCaching # @return [PartialRenderer] a new instance of PartialRenderer # - # source://actionview//lib/action_view/renderer/partial_renderer.rb#223 + # source://actionview//lib/action_view/renderer/partial_renderer.rb#239 def initialize(lookup_context, options); end - # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#12 + # source://actionview//lib/action_view/renderer/partial_renderer.rb#237 def collection_cache; end - # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#12 + # source://actionview//lib/action_view/renderer/partial_renderer.rb#237 def collection_cache=(val); end - # source://actionview//lib/action_view/renderer/partial_renderer.rb#230 + # source://actionview//lib/action_view/renderer/partial_renderer.rb#246 def render(partial, context, block); end private - # source://actionview//lib/action_view/renderer/partial_renderer.rb#261 + # source://actionview//lib/action_view/renderer/partial_renderer.rb#278 def find_template(path, locals); end - # source://actionview//lib/action_view/renderer/partial_renderer.rb#245 + # source://actionview//lib/action_view/renderer/partial_renderer.rb#261 def render_partial_template(view, locals, template, layout, block); end - # source://actionview//lib/action_view/renderer/partial_renderer.rb#241 + # source://actionview//lib/action_view/renderer/partial_renderer.rb#257 def template_keys(_); end class << self - # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#12 + # source://actionview//lib/action_view/renderer/partial_renderer.rb#237 def collection_cache; end - # source://actionview//lib/action_view/renderer/partial_renderer/collection_caching.rb#12 + # source://actionview//lib/action_view/renderer/partial_renderer.rb#237 def collection_cache=(val); end end end +# source://actionview//lib/action_view/path_registry.rb#4 +module ActionView::PathRegistry + class << self + # source://actionview//lib/action_view/path_registry.rb#53 + def all_file_system_resolvers; end + + # source://actionview//lib/action_view/path_registry.rb#47 + def all_resolvers; end + + # source://actionview//lib/action_view/path_registry.rb#22 + def cast_file_system_resolvers(paths); end + + # Returns the value of attribute file_system_resolver_hooks. + # + # source://actionview//lib/action_view/path_registry.rb#11 + def file_system_resolver_hooks; end + + # source://actionview//lib/action_view/path_registry.rb#14 + def get_view_paths(klass); end + + # source://actionview//lib/action_view/path_registry.rb#18 + def set_view_paths(klass, paths); end + end +end + # = Action View PathSet # # This class is used to store and access paths in Action View. A number of @@ -12110,39 +13422,30 @@ class ActionView::PathSet def initialize(paths = T.unsafe(nil)); end # source://actionview//lib/action_view/path_set.rb#35 - def +(array); end - - # source://actionview//lib/action_view/path_set.rb#41 - def <<(*args); end + def +(other); end # source://actionview//lib/action_view/path_set.rb#16 - def [](*_arg0, &_arg1); end + def [](*_arg0, **_arg1, &_arg2); end # source://actionview//lib/action_view/path_set.rb#31 def compact; end - # source://actionview//lib/action_view/path_set.rb#41 - def concat(*args); end - # source://actionview//lib/action_view/path_set.rb#16 - def each(*_arg0, &_arg1); end + def each(*_arg0, **_arg1, &_arg2); end # @return [Boolean] # - # source://actionview//lib/action_view/path_set.rb#60 + # source://actionview//lib/action_view/path_set.rb#53 def exists?(path, prefixes, partial, details, details_key, locals); end - # source://actionview//lib/action_view/path_set.rb#47 + # source://actionview//lib/action_view/path_set.rb#40 def find(path, prefixes, partial, details, details_key, locals); end - # source://actionview//lib/action_view/path_set.rb#52 + # source://actionview//lib/action_view/path_set.rb#45 def find_all(path, prefixes, partial, details, details_key, locals); end # source://actionview//lib/action_view/path_set.rb#16 - def include?(*_arg0, &_arg1); end - - # source://actionview//lib/action_view/path_set.rb#41 - def insert(*args); end + def include?(*_arg0, **_arg1, &_arg2); end # Returns the value of attribute paths. # @@ -12150,38 +13453,64 @@ class ActionView::PathSet def paths; end # source://actionview//lib/action_view/path_set.rb#16 - def pop(*_arg0, &_arg1); end - - # source://actionview//lib/action_view/path_set.rb#41 - def push(*args); end - - # source://actionview//lib/action_view/path_set.rb#16 - def size(*_arg0, &_arg1); end + def size(*_arg0, **_arg1, &_arg2); end # source://actionview//lib/action_view/path_set.rb#27 def to_ary; end - # source://actionview//lib/action_view/path_set.rb#41 - def unshift(*args); end - private # source://actionview//lib/action_view/path_set.rb#22 def initialize_copy(other); end - # source://actionview//lib/action_view/path_set.rb#65 + # source://actionview//lib/action_view/path_set.rb#58 def search_combinations(prefixes); end - # source://actionview//lib/action_view/path_set.rb#74 + # source://actionview//lib/action_view/path_set.rb#67 def typecast(paths); end end +# = Action View Railtie +# +# source://actionview//lib/action_view/railtie.rb#8 +class ActionView::Railtie < ::Rails::Engine; end + +# source://actionview//lib/action_view/buffers.rb#92 +class ActionView::RawOutputBuffer + # @return [RawOutputBuffer] a new instance of RawOutputBuffer + # + # source://actionview//lib/action_view/buffers.rb#93 + def initialize(buffer); end + + # source://actionview//lib/action_view/buffers.rb#97 + def <<(value); end + + # source://actionview//lib/action_view/buffers.rb#103 + def raw; end +end + +# source://actionview//lib/action_view/buffers.rb#150 +class ActionView::RawStreamingBuffer + # @return [RawStreamingBuffer] a new instance of RawStreamingBuffer + # + # source://actionview//lib/action_view/buffers.rb#151 + def initialize(buffer); end + + # source://actionview//lib/action_view/buffers.rb#155 + def <<(value); end + + # source://actionview//lib/action_view/buffers.rb#161 + def raw; end +end + +# = Action View \Record \Identifier +# # RecordIdentifier encapsulates methods used by various ActionView helpers # to associate records with DOM elements. # # Consider for example the following code that form of post: # -# <%= form_for(post) do |f| %> +# <%= form_with(model: post) do |f| %> # <%= f.text_field :body %> # <% end %> # @@ -12203,6 +13532,8 @@ end # automatically generated, following naming conventions encapsulated by the # RecordIdentifier methods #dom_id and #dom_class: # +# dom_id(Post) # => "new_post" +# dom_class(Post) # => "post" # dom_id(Post.new) # => "new_post" # dom_class(Post.new) # => "post" # dom_id(Post.find 42) # => "post_42" @@ -12226,7 +13557,7 @@ end # end # end # -# source://actionview//lib/action_view/record_identifier.rb#56 +# source://actionview//lib/action_view/record_identifier.rb#60 module ActionView::RecordIdentifier include ::ActionView::ModelNaming extend ::ActionView::RecordIdentifier @@ -12242,22 +13573,35 @@ module ActionView::RecordIdentifier # dom_class(post, :edit) # => "edit_post" # dom_class(Person, :edit) # => "edit_person" # - # source://actionview//lib/action_view/record_identifier.rb#74 + # source://actionview//lib/action_view/record_identifier.rb#78 def dom_class(record_or_class, prefix = T.unsafe(nil)); end # The DOM id convention is to use the singular form of an object or class with the id following an underscore. # If no id is found, prefix with "new_" instead. # - # dom_id(Post.find(45)) # => "post_45" - # dom_id(Post.new) # => "new_post" + # dom_id(Post.find(45)) # => "post_45" + # dom_id(Post) # => "new_post" # # If you need to address multiple instances of the same class in the same view, you can prefix the dom_id: # # dom_id(Post.find(45), :edit) # => "edit_post_45" - # dom_id(Post.new, :custom) # => "custom_post" + # dom_id(Post, :custom) # => "custom_post" + # + # @raise [ArgumentError] + # + # source://actionview//lib/action_view/record_identifier.rb#93 + def dom_id(record_or_class, prefix = T.unsafe(nil)); end + + # The DOM target convention is to concatenate any number of parameters into a string. + # Records are passed through dom_id, while string and symbols are retained. + # + # dom_target(Post.find(45)) # => "post_45" + # dom_target(Post.find(45), :edit) # => "post_45_edit" + # dom_target(Post.find(45), :edit, :special) # => "post_45_edit_special" + # dom_target(Post.find(45), Comment.find(1)) # => "post_45_comment_1" # - # source://actionview//lib/action_view/record_identifier.rb#89 - def dom_id(record, prefix = T.unsafe(nil)); end + # source://actionview//lib/action_view/record_identifier.rb#111 + def dom_target(*objects); end private @@ -12270,1968 +13614,2228 @@ module ActionView::RecordIdentifier # method that replaces all characters that are invalid inside DOM ids, with valid ones. You need to # make sure yourself that your dom ids are valid, in case you override this method. # - # source://actionview//lib/action_view/record_identifier.rb#106 + # source://actionview//lib/action_view/record_identifier.rb#134 def record_key_for_dom_id(record); end end -# source://actionview//lib/action_view/record_identifier.rb#62 +# source://actionview//lib/action_view/record_identifier.rb#66 ActionView::RecordIdentifier::JOIN = T.let(T.unsafe(nil), String) -# source://actionview//lib/action_view/record_identifier.rb#63 +# source://actionview//lib/action_view/record_identifier.rb#67 ActionView::RecordIdentifier::NEW = T.let(T.unsafe(nil), String) -# source://actionview//lib/action_view/ripper_ast_parser.rb#6 -class ActionView::RenderParser - # @return [RenderParser] a new instance of RenderParser +# source://actionview//lib/action_view/render_parser.rb#4 +module ActionView::RenderParser; end + +# source://actionview//lib/action_view/render_parser.rb#5 +ActionView::RenderParser::ALL_KNOWN_KEYS = T.let(T.unsafe(nil), Array) + +# source://actionview//lib/action_view/render_parser.rb#8 +class ActionView::RenderParser::Base + # @return [Base] a new instance of Base # - # source://actionview//lib/action_view/render_parser.rb#7 + # source://actionview//lib/action_view/render_parser.rb#9 def initialize(name, code); end - # source://actionview//lib/action_view/render_parser.rb#13 - def render_calls; end - private - # source://actionview//lib/action_view/render_parser.rb#22 + # source://actionview//lib/action_view/render_parser.rb#15 def directory; end - # source://actionview//lib/action_view/render_parser.rb#184 - def layout_to_virtual_path(layout_path); end - - # Convert - # render("foo", ...) - # into either - # render(template: "foo", ...) - # or - # render(partial: "foo", ...) - # - # source://actionview//lib/action_view/render_parser.rb#40 - def normalize_args(string, options_hash); end - - # source://actionview//lib/action_view/render_parser.rb#72 - def parse_hash(node); end - - # source://actionview//lib/action_view/render_parser.rb#76 - def parse_hash_to_symbols(node); end - - # source://actionview//lib/action_view/render_parser.rb#48 - def parse_render(node); end - - # source://actionview//lib/action_view/render_parser.rb#95 - def parse_render_from_options(options_hash); end + # source://actionview//lib/action_view/render_parser.rb#19 + def partial_to_virtual_path(render_type, partial_path); end +end - # source://actionview//lib/action_view/render_parser.rb#155 - def parse_str(node); end +# source://actionview//lib/action_view/render_parser.rb#37 +ActionView::RenderParser::Default = ActionView::RenderParser::PrismRenderParser - # source://actionview//lib/action_view/render_parser.rb#159 - def parse_sym(node); end +# source://actionview//lib/action_view/render_parser/prism_render_parser.rb#5 +class ActionView::RenderParser::PrismRenderParser < ::ActionView::RenderParser::Base + # source://actionview//lib/action_view/render_parser/prism_render_parser.rb#6 + def render_calls; end - # source://actionview//lib/action_view/render_parser.rb#176 - def partial_to_virtual_path(render_type, partial_path); end + private - # @return [Boolean] + # Accept a call node and return a hash of options for the render call. + # If it doesn't match the expected format, return nil. # - # source://actionview//lib/action_view/render_parser.rb#164 - def render_template_with_layout?(render_type, options_hash); end + # source://actionview//lib/action_view/render_parser/prism_render_parser.rb#43 + def render_call_options(node); end - # @return [Boolean] + # Accept the node that is being passed in the position of the template + # and return the template name and whether or not it is an object + # template. # - # source://actionview//lib/action_view/render_parser.rb#170 - def render_template_with_spacer?(options_hash); end - - # source://actionview//lib/action_view/render_parser.rb#26 - def resolve_path_directory(path); end + # source://actionview//lib/action_view/render_parser/prism_render_parser.rb#97 + def render_call_template(node); end end -# source://actionview//lib/action_view/render_parser.rb#90 -ActionView::RenderParser::ALL_KNOWN_KEYS = T.let(T.unsafe(nil), Array) - -# source://actionview//lib/action_view/render_parser.rb#92 +# source://actionview//lib/action_view/render_parser.rb#6 ActionView::RenderParser::RENDER_TYPE_KEYS = T.let(T.unsafe(nil), Array) -# source://actionview//lib/action_view/ripper_ast_parser.rb#7 -module ActionView::RenderParser::RipperASTParser - extend ::ActionView::RenderParser::RipperASTParser - - # source://actionview//lib/action_view/ripper_ast_parser.rb#188 - def parse_render_nodes(code); end -end - -# source://actionview//lib/action_view/ripper_ast_parser.rb#8 -class ActionView::RenderParser::RipperASTParser::Node < ::Array - # @return [Node] a new instance of Node +# = Action View \Renderer +# +# This is the main entry point for rendering. It basically delegates +# to other objects like TemplateRenderer and PartialRenderer which +# actually renders the template. +# +# The Renderer will parse the options from the +render+ or +render_body+ +# method and render a partial or a template based on the options. The +# +TemplateRenderer+ and +PartialRenderer+ objects are wrappers which do all +# the setup and logic necessary to render a view and a new object is created +# each time +render+ is called. +# +# source://actionview//lib/action_view/renderer/renderer.rb#15 +class ActionView::Renderer + # @return [Renderer] a new instance of Renderer # - # source://actionview//lib/action_view/ripper_ast_parser.rb#11 - def initialize(type, arr, opts = T.unsafe(nil)); end + # source://actionview//lib/action_view/renderer/renderer.rb#18 + def initialize(lookup_context); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#35 - def argument_nodes; end + # source://actionview//lib/action_view/renderer/renderer.rb#52 + def cache_hits; end - # @return [Boolean] + # Returns the value of attribute lookup_context. # - # source://actionview//lib/action_view/ripper_ast_parser.rb#57 - def call?; end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#65 - def call_method_name; end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#16 - def children; end + # source://actionview//lib/action_view/renderer/renderer.rb#16 + def lookup_context; end - # @return [Boolean] + # Sets the attribute lookup_context # - # source://actionview//lib/action_view/ripper_ast_parser.rb#25 - def fcall?; end - - # @return [Boolean] + # @param value the value to set the attribute lookup_context to. # - # source://actionview//lib/action_view/ripper_ast_parser.rb#29 - def fcall_named?(name); end + # source://actionview//lib/action_view/renderer/renderer.rb#16 + def lookup_context=(_arg0); end - # @return [Boolean] + # Main render entry point shared by Action View and Action Controller. # - # source://actionview//lib/action_view/ripper_ast_parser.rb#74 - def hash?; end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#88 - def hash_from_body(body); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#20 - def inspect; end + # source://actionview//lib/action_view/renderer/renderer.rb#23 + def render(context, options); end - # @return [Boolean] + # Render but returns a valid Rack body. If fibers are defined, we return + # a streaming body that renders the template piece by piece. # - # source://actionview//lib/action_view/ripper_ast_parser.rb#45 - def string?; end - - # @return [Boolean] + # Note that partials are not supported to be rendered with streaming, + # so in such cases, we just wrap them in an array. # - # source://actionview//lib/action_view/ripper_ast_parser.rb#96 - def symbol?; end + # source://actionview//lib/action_view/renderer/renderer.rb#40 + def render_body(context, options); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#78 - def to_hash; end + # source://actionview//lib/action_view/renderer/renderer.rb#48 + def render_partial(context, options, &block); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#69 - def to_string; end + # source://actionview//lib/action_view/renderer/renderer.rb#27 + def render_to_object(context, options); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#100 - def to_symbol; end + private - # Returns the value of attribute type. - # - # source://actionview//lib/action_view/ripper_ast_parser.rb#9 - def type; end + # source://actionview//lib/action_view/renderer/renderer.rb#103 + def collection_from_object(object); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#61 - def variable_name; end + # source://actionview//lib/action_view/renderer/renderer.rb#96 + def collection_from_options(options); end - # @return [Boolean] - # - # source://actionview//lib/action_view/ripper_ast_parser.rb#49 - def variable_reference?; end + # source://actionview//lib/action_view/renderer/renderer.rb#61 + def render_partial_to_object(context, options, &block); end - # @return [Boolean] - # - # source://actionview//lib/action_view/ripper_ast_parser.rb#53 - def vcall?; end + # source://actionview//lib/action_view/renderer/renderer.rb#57 + def render_template_to_object(context, options); end end -# source://actionview//lib/action_view/ripper_ast_parser.rb#111 -class ActionView::RenderParser::RipperASTParser::NodeParser < ::Ripper - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_BEGIN(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_CHAR(tok); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_END(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on___end__(tok); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_alias(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_alias_error(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_aref(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_aref_field(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_arg_ambiguous(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_arg_paren(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_args_add(list, item); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_args_add_block(list, item); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_args_add_star(list, item); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_args_forward(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#116 - def on_args_new(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_array(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_aryptn(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_assign(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_assign_error(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_assoc_new(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_assoc_splat(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_assoclist_from_args(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_backref(tok); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_backtick(tok); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_bare_assoc_hash(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_begin(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_binary(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_block_var(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_blockarg(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_bodystmt(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_brace_block(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_break(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_call(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_case(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_class(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_class_name_error(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_comma(tok); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_command(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_command_call(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_comment(tok); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_const(tok); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_const_path_field(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_const_path_ref(*args); end - - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_const_ref(*args); end +# source://actionview//lib/action_view/rendering.rb#26 +module ActionView::Rendering + extend ::ActiveSupport::Concern + include ::ActionView::ViewPaths - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_cvar(tok); end + mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods + mixes_in_class_methods ::ActionView::Rendering::ClassMethods - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_def(*args); end + # source://actionview//lib/action_view/rendering.rb#32 + def initialize; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_defined(*args); end + # Override process to set up I18n proxy. + # + # source://actionview//lib/action_view/rendering.rb#38 + def process(*_arg0, **_arg1, &_arg2); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_defs(*args); end + # source://actionview//lib/action_view/rendering.rb#119 + def render_to_body(options = T.unsafe(nil)); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_do_block(*args); end + # source://actionview//lib/action_view/rendering.rb#30 + def rendered_format; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_dot2(*args); end + # An instance of a view class. The default view class is ActionView::Base. + # + # The view class must have the following methods: + # + # * View.new(lookup_context, assigns, controller) — Create a new + # ActionView instance for a controller and we can also pass the arguments. + # + # * View#render(option) — Returns String with the rendered template. + # + # Override this method in a module to change the default behavior. + # + # source://actionview//lib/action_view/rendering.rb#109 + def view_context; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_dot3(*args); end + # source://actionview//lib/action_view/rendering.rb#95 + def view_context_class; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_dyna_symbol(*args); end + # Returns an object that is able to render templates. + # + # source://actionview//lib/action_view/rendering.rb#114 + def view_renderer; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_else(*args); end + private - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_elsif(*args); end + # Normalize args by converting render "foo" to render action: "foo" and + # render "foo/bar" to render template: "foo/bar". + # + # source://actionview//lib/action_view/rendering.rb#153 + def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_embdoc(tok); end + # Assign the rendered format to look up context. + # + # source://actionview//lib/action_view/rendering.rb#146 + def _process_format(format); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_embdoc_beg(tok); end + # Normalize options. + # + # source://actionview//lib/action_view/rendering.rb#177 + def _process_render_template_options(options); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_embdoc_end(tok); end + # Find and render a template based on the options given. + # + # source://actionview//lib/action_view/rendering.rb#127 + def _render_template(options); end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_embexpr_beg(tok); end +# source://actionview//lib/action_view/rendering.rb#45 +module ActionView::Rendering::ClassMethods + # source://actionview//lib/action_view/rendering.rb#49 + def _helpers; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_embexpr_end(tok); end + # source://actionview//lib/action_view/rendering.rb#46 + def _routes; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_embvar(tok); end + # source://actionview//lib/action_view/rendering.rb#59 + def build_view_context_class(klass, supports_path, routes, helpers); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_ensure(*args); end + # source://actionview//lib/action_view/rendering.rb#76 + def eager_load!; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_excessed_comma(*args); end + # @return [Boolean] + # + # source://actionview//lib/action_view/rendering.rb#52 + def inherit_view_context_class?; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_fcall(*args); end + # source://actionview//lib/action_view/rendering.rb#82 + def view_context_class; end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_field(*args); end +# = Action View Resolver +# +# source://actionview//lib/action_view/template/resolver.rb#11 +class ActionView::Resolver + # source://actionview//lib/action_view/template/resolver.rb#69 + def all_template_paths; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_float(tok); end + # source://actionview//lib/action_view/template/resolver.rb#64 + def built_templates; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_for(*args); end + # source://actionview//lib/action_view/template/resolver.rb#50 + def caching; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_gvar(tok); end + # source://actionview//lib/action_view/template/resolver.rb#50 + def caching=(val); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_hash(*args); end + # source://actionview//lib/action_view/template/resolver.rb#79 + def caching?(&_arg0); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_heredoc_beg(tok); end + # source://actionview//lib/action_view/template/resolver.rb#56 + def clear_cache; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_heredoc_dedent(*args); end + # Normalizes the arguments and passes it on to find_templates. + # + # source://actionview//lib/action_view/template/resolver.rb#60 + def find_all(name, prefix = T.unsafe(nil), partial = T.unsafe(nil), details = T.unsafe(nil), key = T.unsafe(nil), locals = T.unsafe(nil)); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_heredoc_end(tok); end + private - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_hshptn(*args); end + # source://actionview//lib/action_view/template/resolver.rb#75 + def _find_all(name, prefix, partial, details, key, locals); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_ident(tok); end + # This is what child classes implement. No defaults are needed + # because Resolver guarantees that the arguments are present and + # normalized. + # + # @raise [NotImplementedError] + # + # source://actionview//lib/action_view/template/resolver.rb#84 + def find_templates(name, prefix, partial, details, locals = T.unsafe(nil)); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_if(*args); end + class << self + # source://actionview//lib/action_view/template/resolver.rb#50 + def caching; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_if_mod(*args); end + # source://actionview//lib/action_view/template/resolver.rb#50 + def caching=(val); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_ifop(*args); end + # source://actionview//lib/action_view/template/resolver.rb#53 + def caching?; end + end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_ignored_nl(tok); end +# source://actionview//lib/action_view/template/resolver.rb#12 +class ActionView::Resolver::PathParser + # source://actionview//lib/action_view/template/resolver.rb#15 + def build_path_regex; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_ignored_sp(tok); end + # source://actionview//lib/action_view/template/resolver.rb#36 + def parse(path); end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_imaginary(tok); end +# source://actionview//lib/action_view/template/resolver.rb#13 +class ActionView::Resolver::PathParser::ParsedPath < ::Struct + # Returns the value of attribute details + # + # @return [Object] the current value of details + # + # source://actionview//lib/action_view/template/resolver.rb#13 + def details; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_in(*args); end + # Sets the attribute details + # + # @param value [Object] the value to set the attribute details to. + # @return [Object] the newly set value + # + # source://actionview//lib/action_view/template/resolver.rb#13 + def details=(_); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_int(tok); end + # Returns the value of attribute path + # + # @return [Object] the current value of path + # + # source://actionview//lib/action_view/template/resolver.rb#13 + def path; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_ivar(tok); end + # Sets the attribute path + # + # @param value [Object] the value to set the attribute path to. + # @return [Object] the newly set value + # + # source://actionview//lib/action_view/template/resolver.rb#13 + def path=(_); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_kw(tok); end + class << self + # source://actionview//lib/action_view/template/resolver.rb#13 + def [](*_arg0); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_kwrest_param(*args); end + # source://actionview//lib/action_view/template/resolver.rb#13 + def inspect; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_label(tok); end + # source://actionview//lib/action_view/template/resolver.rb#13 + def keyword_init?; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_label_end(tok); end + # source://actionview//lib/action_view/template/resolver.rb#13 + def members; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_lambda(*args); end + # source://actionview//lib/action_view/template/resolver.rb#13 + def new(*_arg0); end + end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_lbrace(tok); end +# source://actionview//lib/action_view/routing_url_for.rb#6 +module ActionView::RoutingUrlFor + include ::ActionDispatch::Routing::PolymorphicRoutes - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_lbracket(tok); end + # Returns the URL for the set of +options+ provided. This takes the + # same options as +url_for+ in Action Controller (see the + # documentation for ActionDispatch::Routing::UrlFor#url_for). Note that by default + # :only_path is true so you'll get the relative "/controller/action" + # instead of the fully qualified URL like "http://example.com/controller/action". + # + # ==== Options + # * :anchor - Specifies the anchor name to be appended to the path. + # * :only_path - If true, returns the relative URL (omitting the protocol, host name, and port) (true by default unless :host is specified). + # * :trailing_slash - If true, adds a trailing slash, as in "/archive/2005/". Note that this + # is currently not recommended since it breaks caching. + # * :host - Overrides the default (current) host if provided. + # * :protocol - Overrides the default (current) protocol if provided. + # * :user - Inline HTTP authentication (only plucked out if :password is also present). + # * :password - Inline HTTP authentication (only plucked out if :user is also present). + # + # ==== Relying on named routes + # + # Passing a record (like an Active Record) instead of a hash as the options parameter will + # trigger the named route for that record. The lookup will happen on the name of the class. So passing a + # Workshop object will attempt to use the +workshop_path+ route. If you have a nested route, such as + # +admin_workshop_path+ you'll have to call that explicitly (it's impossible for +url_for+ to guess that route). + # + # ==== Implicit Controller Namespacing + # + # Controllers passed in using the +:controller+ option will retain their namespace unless it is an absolute one. + # + # ==== Examples + # <%= url_for(action: 'index') %> + # # => /blogs/ + # + # <%= url_for(action: 'find', controller: 'books') %> + # # => /books/find + # + # <%= url_for(action: 'login', controller: 'members', only_path: false, protocol: 'https') %> + # # => https://www.example.com/members/login/ + # + # <%= url_for(action: 'play', anchor: 'player') %> + # # => /messages/play/#player + # + # <%= url_for(action: 'jump', anchor: 'tax&ship') %> + # # => /testing/jump/#tax&ship + # + # <%= url_for(Workshop) %> + # # => /workshops + # + # <%= url_for(Workshop.new) %> + # # relies on Workshop answering a persisted? call (and in this case returning false) + # # => /workshops + # + # <%= url_for(@workshop) %> + # # calls @workshop.to_param which by default returns the id + # # => /workshops/5 + # + # # to_param can be re-defined in a model to provide different URL names: + # # => /workshops/1-workshop-name + # + # <%= url_for("http://www.example.com") %> + # # => http://www.example.com + # + # <%= url_for(:back) %> + # # if request.env["HTTP_REFERER"] is set to "http://www.example.com" + # # => http://www.example.com + # + # <%= url_for(:back) %> + # # if request.env["HTTP_REFERER"] is not set or is blank + # # => javascript:history.back() + # + # <%= url_for(action: 'index', controller: 'users') %> + # # Assuming an "admin" namespace + # # => /admin/users + # + # <%= url_for(action: 'index', controller: '/users') %> + # # Specify absolute path with beginning slash + # # => /users + # + # source://actionview//lib/action_view/routing_url_for.rb#82 + def url_for(options = T.unsafe(nil)); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_lparen(tok); end + # source://actionview//lib/action_view/routing_url_for.rb#124 + def url_options; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_magic_comment(*args); end + private - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_massign(*args); end + # source://actionview//lib/action_view/routing_url_for.rb#139 + def _generate_paths_by_default; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_method_add_arg(list, item); end + # source://actionview//lib/action_view/routing_url_for.rb#130 + def _routes_context; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_method_add_block(list, item); end + # source://actionview//lib/action_view/routing_url_for.rb#143 + def ensure_only_path_option(options); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_mlhs_add(list, item); end + # @return [Boolean] + # + # source://actionview//lib/action_view/routing_url_for.rb#134 + def optimize_routes_generation?; end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_mlhs_add_post(list, item); end +# source://actionview//lib/action_view/buffers.rb#108 +class ActionView::StreamingBuffer + # @return [StreamingBuffer] a new instance of StreamingBuffer + # + # source://actionview//lib/action_view/buffers.rb#109 + def initialize(block); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_mlhs_add_star(list, item); end + # source://actionview//lib/action_view/buffers.rb#113 + def <<(value); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#116 - def on_mlhs_new(*args); end + # source://actionview//lib/action_view/buffers.rb#119 + def append=(value); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_mlhs_paren(*args); end + # Returns the value of attribute block. + # + # source://actionview//lib/action_view/buffers.rb#147 + def block; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_module(*args); end + # source://actionview//lib/action_view/buffers.rb#126 + def capture; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_mrhs_add(list, item); end + # source://actionview//lib/action_view/buffers.rb#118 + def concat(value); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_mrhs_add_star(list, item); end + # source://actionview//lib/action_view/buffers.rb#139 + def html_safe; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#116 - def on_mrhs_new(*args); end + # @return [Boolean] + # + # source://actionview//lib/action_view/buffers.rb#135 + def html_safe?; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_mrhs_new_from_args(*args); end + # source://actionview//lib/action_view/buffers.rb#143 + def raw; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_next(*args); end + # source://actionview//lib/action_view/buffers.rb#124 + def safe_append=(value); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_nl(tok); end + # source://actionview//lib/action_view/buffers.rb#121 + def safe_concat(value); end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_nokw_param(*args); end +# source://actionview//lib/action_view/flows.rb#30 +class ActionView::StreamingFlow < ::ActionView::OutputFlow + # @return [StreamingFlow] a new instance of StreamingFlow + # + # source://actionview//lib/action_view/flows.rb#31 + def initialize(view, fiber); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_op(tok); end + # Appends the contents for the given key. This is called + # by providing and resuming back to the fiber, + # if that's the key it's waiting for. + # + # source://actionview//lib/action_view/flows.rb#65 + def append!(key, value); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_opassign(*args); end + # Try to get stored content. If the content + # is not available and we're inside the layout fiber, + # then it will begin waiting for the given key and yield. + # + # source://actionview//lib/action_view/flows.rb#43 + def get(key); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_operator_ambiguous(*args); end + private - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_param_error(*args); end + # @return [Boolean] + # + # source://actionview//lib/action_view/flows.rb#71 + def inside_fiber?; end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_params(*args); end +# == TODO +# +# * Support streaming from child templates, partials and so on. +# * Rack::Cache needs to support streaming bodies +# +# source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#12 +class ActionView::StreamingTemplateRenderer < ::ActionView::TemplateRenderer + # 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 + # that knows how to render the template. + # + # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#51 + def render_template(view, template, layout_name = T.unsafe(nil), locals = T.unsafe(nil)); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_paren(*args); end + private - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_parse_error(*args); end + # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#63 + def delayed_render(buffer, template, layout, view, locals); end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_period(tok); end +# A valid Rack::Body (i.e. it responds to each). +# It is initialized with a block that, when called, starts +# rendering the template. +# +# source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#13 +class ActionView::StreamingTemplateRenderer::Body + # @return [Body] a new instance of Body + # + # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#14 + def initialize(&start); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_program(*args); end + # Returns the complete body as a string. + # + # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#29 + def body; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_qsymbols_add(list, item); end + # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#18 + def each(&block); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_qsymbols_beg(tok); end + private - # source://actionview//lib/action_view/ripper_ast_parser.rb#116 - def on_qsymbols_new(*args); end + # This is the same logging logic as in ShowExceptions middleware. + # + # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#37 + def log_error(exception); end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_qwords_add(list, item); end +# source://actionview//lib/action_view/template/error.rb#30 +class ActionView::StrictLocalsError < ::ArgumentError + # @return [StrictLocalsError] a new instance of StrictLocalsError + # + # source://actionview//lib/action_view/template/error.rb#31 + def initialize(argument_error, template); end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_qwords_beg(tok); end +# source://actionview//lib/action_view/structured_event_subscriber.rb#6 +class ActionView::StructuredEventSubscriber < ::ActiveSupport::StructuredEventSubscriber + include ::ActionView::StructuredEventSubscriber::Utils - # source://actionview//lib/action_view/ripper_ast_parser.rb#116 - def on_qwords_new(*args); end + # @return [StructuredEventSubscriber] a new instance of StructuredEventSubscriber + # + # source://actionview//lib/action_view/structured_event_subscriber.rb#9 + def initialize; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_rational(tok); end + # source://actionview//lib/action_view/structured_event_subscriber.rb#44 + def render_collection(event); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_rbrace(tok); end + # source://actionview//lib/action_view/structured_event_subscriber.rb#35 + def render_layout(event); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_rbracket(tok); end + # source://actionview//lib/action_view/structured_event_subscriber.rb#24 + def render_partial(event); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_redo(*args); end + # source://actionview//lib/action_view/structured_event_subscriber.rb#14 + def render_template(event); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_regexp_add(list, item); end + class << self + # source://actionview//lib/action_view/structured_event_subscriber.rb#88 + def attach_to(*_arg0); end + end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_regexp_beg(tok); end +# source://actionview//lib/action_view/structured_event_subscriber.rb#73 +class ActionView::StructuredEventSubscriber::Start + include ::ActionView::StructuredEventSubscriber::Utils - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_regexp_end(tok); end + # source://actionview//lib/action_view/structured_event_subscriber.rb#84 + def finish(name, id, payload); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_regexp_literal(*args); end + # source://actionview//lib/action_view/structured_event_subscriber.rb#76 + def start(name, id, payload); end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#116 - def on_regexp_new(*args); end +# source://actionview//lib/action_view/structured_event_subscriber.rb#56 +module ActionView::StructuredEventSubscriber::Utils + private - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_rescue(*args); end + # source://actionview//lib/action_view/structured_event_subscriber.rb#58 + def from_rails_root(string); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_rescue_mod(*args); end + # source://actionview//lib/action_view/structured_event_subscriber.rb#66 + def rails_root; end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_rest_param(*args); end +# source://actionview//lib/action_view/structured_event_subscriber.rb#7 +ActionView::StructuredEventSubscriber::VIEWS_PATTERN = T.let(T.unsafe(nil), Regexp) - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_retry(*args); end +# source://actionview//lib/action_view/template/error.rb#256 +class ActionView::SyntaxErrorInTemplate < ::ActionView::Template::Error + # @return [SyntaxErrorInTemplate] a new instance of SyntaxErrorInTemplate + # + # source://actionview//lib/action_view/template/error.rb#257 + def initialize(template, offending_code_string); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_return(*args); end + # source://actionview//lib/action_view/template/error.rb#272 + def annotated_source_code; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_return0(*args); end + # source://actionview//lib/action_view/template/error.rb#262 + def message; end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_rparen(tok); end +# = Action View \Template +# +# source://actionview//lib/action_view/template.rb#7 +class ActionView::Template + extend ::ActiveSupport::Autoload + extend ::ActionView::Template::Handlers - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_sclass(*args); end + # @return [Template] a new instance of Template + # + # source://actionview//lib/action_view/template.rb#199 + def initialize(source, identifier, handler, locals:, format: T.unsafe(nil), variant: T.unsafe(nil), virtual_path: T.unsafe(nil)); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_semicolon(tok); end + # This method is responsible for properly setting the encoding of the + # source. Until this point, we assume that the source is BINARY data. + # If no additional information is supplied, we assume the encoding is + # the same as Encoding.default_external. + # + # The user can also specify the encoding via a comment on the first + # with any template engine, as we process out the encoding comment + # before passing the source on to the template engine, leaving a + # blank line in its stead. + # + # source://actionview//lib/action_view/template.rb#321 + def encode!; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_sp(tok); end + # Returns the value of attribute format. + # + # source://actionview//lib/action_view/template.rb#195 + def format; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_stmts_add(list, item); end + # Returns the value of attribute handler. + # + # source://actionview//lib/action_view/template.rb#194 + def handler; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#116 - def on_stmts_new(*args); end + # Returns the value of attribute identifier. + # + # source://actionview//lib/action_view/template.rb#194 + def identifier; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_string_add(list, item); end + # source://actionview//lib/action_view/template.rb#300 + def inspect; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_string_concat(*args); end + # The locals this template has been or will be compiled for, or nil if this + # is a strict locals template. + # + # source://actionview//lib/action_view/template.rb#223 + def locals; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_string_content(*args); end + # Exceptions are marshalled when using the parallel test runner with DRb, so we need + # to ensure that references to the template object can be marshalled as well. This means forgoing + # the marshalling of the compiler mutex and instantiating that again on unmarshalling. + # + # source://actionview//lib/action_view/template.rb#387 + def marshal_dump; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_string_dvar(*args); end + # source://actionview//lib/action_view/template.rb#391 + def marshal_load(array); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_string_embexpr(*args); end + # source://actionview//lib/action_view/template.rb#396 + def method_name; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_string_literal(*args); end + # Render a template. If the template was not compiled yet, it is done + # exactly before rendering. + # + # This method is instrumented as "!render_template.action_view". Notice that + # we use a bang in this instrumentation because you don't want to + # consume this in production. This is only slow if it's being listened to. + # + # source://actionview//lib/action_view/template.rb#271 + def render(view, locals, buffer = T.unsafe(nil), implicit_locals: T.unsafe(nil), add_to_stack: T.unsafe(nil), &block); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_super(*args); end + # source://actionview//lib/action_view/template.rb#296 + def short_identifier; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_symbeg(tok); end + # source://actionview//lib/action_view/template.rb#304 + def source; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_symbol(*args); end + # source://actionview//lib/action_view/template.rb#231 + def spot(location); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_symbol_literal(*args); end + # This method is responsible for marking a template as having strict locals + # which means the template can only accept the locals defined in a magic + # comment. For example, if your template accepts the locals +title+ and + # +comment_count+, add the following to your template file: + # + # <%# locals: (title: "Default title", comment_count: 0) %> + # + # Strict locals are useful for validating template arguments and for + # specifying defaults. + # + # source://actionview//lib/action_view/template.rb#366 + def strict_locals!; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_symbols_add(list, item); end + # Returns whether a template is using strict locals. + # + # @return [Boolean] + # + # source://actionview//lib/action_view/template.rb#380 + def strict_locals?; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_symbols_beg(tok); end + # Returns whether the underlying handler supports streaming. If so, + # a streaming buffer *may* be passed when it starts rendering. + # + # @return [Boolean] + # + # source://actionview//lib/action_view/template.rb#261 + def supports_streaming?; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#116 - def on_symbols_new(*args); end + # Translate an error location returned by ErrorHighlight to the correct + # source location inside the template. + # + # source://actionview//lib/action_view/template.rb#251 + def translate_location(backtrace_location, spot); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_tlambda(tok); end + # source://actionview//lib/action_view/template.rb#292 + def type; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_tlambeg(tok); end + # Returns the value of attribute variable. + # + # source://actionview//lib/action_view/template.rb#195 + def variable; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_top_const_field(*args); end + # Returns the value of attribute variant. + # + # source://actionview//lib/action_view/template.rb#195 + def variant; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_top_const_ref(*args); end + # Returns the value of attribute virtual_path. + # + # source://actionview//lib/action_view/template.rb#195 + def virtual_path; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_tstring_beg(tok); end + private - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_tstring_content(tok); end + # Among other things, this method is responsible for properly setting + # the encoding of the compiled template. + # + # If the template engine handles encodings, we send the encoded + # String to the engine without further processing. This allows + # the template engine to support additional mechanisms for + # + # Otherwise, after we figure out the correct encoding, we then + # encode the source into Encoding.default_internal. + # In general, this means that templates will be UTF-8 inside of Rails, + # regardless of the original source encoding. + # + # source://actionview//lib/action_view/template.rb#500 + def compile(mod); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_tstring_end(tok); end + # Compile a template. This method ensures a template is compiled + # just once and removes the source after it is compiled. + # + # source://actionview//lib/action_view/template.rb#418 + def compile!(view); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_unary(*args); end + # This method compiles the source of the template. The compilation of templates + # involves setting strict_locals! if applicable, encoding the template, and setting + # frozen string literal. + # + # source://actionview//lib/action_view/template.rb#443 + def compiled_source; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_undef(*args); end + # source://actionview//lib/action_view/template.rb#405 + def find_node_by_id(node, node_id); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_unless(*args); end + # source://actionview//lib/action_view/template.rb#549 + def handle_render_error(view, e); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_unless_mod(*args); end + # source://actionview//lib/action_view/template.rb#574 + def identifier_method_name; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_until(*args); end + # source://actionview//lib/action_view/template.rb#578 + def instrument(action, &block); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_until_mod(*args); end + # source://actionview//lib/action_view/template.rb#586 + def instrument_payload; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_var_alias(*args); end + # source://actionview//lib/action_view/template.rb#582 + def instrument_render_template(&block); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_var_field(*args); end + # source://actionview//lib/action_view/template.rb#561 + def locals_code; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_var_ref(*args); end + # source://actionview//lib/action_view/template.rb#541 + def offset; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_vcall(*args); end + class << self + # source://actionview//lib/action_view/template.rb#180 + def frozen_string_literal; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_void_stmt(*args); end + # source://actionview//lib/action_view/template.rb#180 + def frozen_string_literal=(_arg0); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_when(*args); end + # source://actionview//lib/action_view/template.rb#184 + def mime_types_implementation=(implementation); end + end +end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_while(*args); end +# 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 +# precise exception message. +# +# source://actionview//lib/action_view/template/error.rb#165 +class ActionView::Template::Error < ::ActionView::ActionViewError + # @return [Error] a new instance of Error + # + # source://actionview//lib/action_view/template/error.rb#173 + def initialize(template); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_while_mod(*args); end + # source://actionview//lib/action_view/template/error.rb#231 + def annotated_source_code; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_word_add(list, item); end + # source://actionview//lib/action_view/template/error.rb#182 + def backtrace; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#116 - def on_word_new(*args); end + # source://actionview//lib/action_view/template/error.rb#186 + def backtrace_locations; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_words_add(list, item); end + # Override to prevent #cause resetting during re-raise. + # + # source://actionview//lib/action_view/template/error.rb#169 + def cause; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_words_beg(tok); end + # source://actionview//lib/action_view/template/error.rb#190 + def file_name; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#116 - def on_words_new(*args); end + # source://actionview//lib/action_view/template/error.rb#223 + def line_number; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#140 - def on_words_sep(tok); end + # source://actionview//lib/action_view/template/error.rb#203 + def source_extract(indentation = T.unsafe(nil)); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#123 - def on_xstring_add(list, item); end + # source://actionview//lib/action_view/template/error.rb#194 + def sub_template_message; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_xstring_literal(*args); end + # source://actionview//lib/action_view/template/error.rb#218 + def sub_template_of(template_path); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#116 - def on_xstring_new(*args); end + # Returns the value of attribute template. + # + # source://actionview//lib/action_view/template/error.rb#171 + def template; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_yield(*args); end + private - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_yield0(*args); end + # source://actionview//lib/action_view/template/error.rb#244 + def formatted_code_for(source_code, line_counter, indent); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#131 - def on_zsuper(*args); end + # source://actionview//lib/action_view/template/error.rb#236 + def source_location; end end -# source://actionview//lib/action_view/ripper_ast_parser.rb#147 -class ActionView::RenderParser::RipperASTParser::RenderCallExtractor < ::ActionView::RenderParser::RipperASTParser::NodeParser - # @return [RenderCallExtractor] a new instance of RenderCallExtractor - # - # source://actionview//lib/action_view/ripper_ast_parser.rb#152 - def initialize(*args); end +# source://actionview//lib/action_view/template/error.rb#166 +ActionView::Template::Error::SOURCE_CODE_RADIUS = T.let(T.unsafe(nil), Integer) - # Returns the value of attribute render_calls. +# = Action View HTML Template +# +# source://actionview//lib/action_view/template/html.rb#6 +class ActionView::Template::HTML + # @return [HTML] a new instance of HTML # - # source://actionview//lib/action_view/ripper_ast_parser.rb#148 - def render_calls; end + # source://actionview//lib/action_view/template/html.rb#9 + def initialize(string, type); end - private + # source://actionview//lib/action_view/template/html.rb#28 + def format; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#177 - def on_arg_paren(content); end + # source://actionview//lib/action_view/template/html.rb#14 + def identifier; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#163 - def on_command(name, *args); end + # source://actionview//lib/action_view/template/html.rb#18 + def inspect; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#159 - def on_fcall(name, *args); end + # source://actionview//lib/action_view/template/html.rb#24 + def render(*args); end - # source://actionview//lib/action_view/ripper_ast_parser.rb#181 - def on_paren(content); end + # source://actionview//lib/action_view/template/html.rb#20 + def to_str; end - # source://actionview//lib/action_view/ripper_ast_parser.rb#167 - def on_render_call(node); end + # source://actionview//lib/action_view/template/html.rb#7 + def type; end end -# source://actionview//lib/action_view/ripper_ast_parser.rb#150 -ActionView::RenderParser::RipperASTParser::RenderCallExtractor::METHODS_TO_PARSE = T.let(T.unsafe(nil), Array) - -# This is the main entry point for rendering. It basically delegates -# to other objects like TemplateRenderer and PartialRenderer which -# actually renders the template. +# = Action View Template Handlers # -# The Renderer will parse the options from the +render+ or +render_body+ -# method and render a partial or a template based on the options. The -# +TemplateRenderer+ and +PartialRenderer+ objects are wrappers which do all -# the setup and logic necessary to render a view and a new object is created -# each time +render+ is called. -# -# source://actionview//lib/action_view/renderer/renderer.rb#13 -class ActionView::Renderer - # @return [Renderer] a new instance of Renderer - # - # source://actionview//lib/action_view/renderer/renderer.rb#16 - def initialize(lookup_context); end - - # source://actionview//lib/action_view/renderer/renderer.rb#56 - def cache_hits; end +# source://actionview//lib/action_view/template/handlers.rb#6 +module ActionView::Template::Handlers + # source://actionview//lib/action_view/template/handlers.rb#61 + def handler_for_extension(extension); end - # Returns the value of attribute lookup_context. - # - # source://actionview//lib/action_view/renderer/renderer.rb#14 - def lookup_context; end + # source://actionview//lib/action_view/template/handlers.rb#56 + def register_default_template_handler(extension, klass); end - # Sets the attribute lookup_context + # Register an object that knows how to handle template files with the given + # extensions. This can be used to implement new template types. + # The handler must respond to +:call+, which will be passed the template + # and should return the rendered template as a String. # - # @param value the value to set the attribute lookup_context to. + # @raise [ArgumentError] # - # source://actionview//lib/action_view/renderer/renderer.rb#14 - def lookup_context=(_arg0); end + # source://actionview//lib/action_view/template/handlers.rb#31 + def register_template_handler(*extensions, handler); end - # Main render entry point shared by Action View and Action Controller. - # - # source://actionview//lib/action_view/renderer/renderer.rb#21 - def render(context, options); end + # source://actionview//lib/action_view/template/handlers.rb#52 + def registered_template_handler(extension); end - # Render but returns a valid Rack body. If fibers are defined, we return - # a streaming body that renders the template piece by piece. - # - # Note that partials are not supported to be rendered with streaming, - # so in such cases, we just wrap them in an array. - # - # source://actionview//lib/action_view/renderer/renderer.rb#38 - def render_body(context, options); end + # source://actionview//lib/action_view/template/handlers.rb#48 + def template_handler_extensions; end - # Direct access to partial rendering. + # Opposite to register_template_handler. # - # source://actionview//lib/action_view/renderer/renderer.rb#52 - def render_partial(context, options, &block); end - - # source://actionview//lib/action_view/renderer/renderer.rb#64 - def render_partial_to_object(context, options, &block); end + # source://actionview//lib/action_view/template/handlers.rb#40 + def unregister_template_handler(*extensions); end - # Direct access to template rendering. - # - # source://actionview//lib/action_view/renderer/renderer.rb#47 - def render_template(context, options); end + class << self + # @private + # + # source://actionview//lib/action_view/template/handlers.rb#12 + def extended(base); end - # source://actionview//lib/action_view/renderer/renderer.rb#60 - def render_template_to_object(context, options); end + # source://actionview//lib/action_view/template/handlers.rb#23 + def extensions; end + end +end - # source://actionview//lib/action_view/renderer/renderer.rb#25 - def render_to_object(context, options); end +# source://actionview//lib/action_view/template/handlers/builder.rb#5 +class ActionView::Template::Handlers::Builder + # source://actionview//lib/action_view/template/handlers/builder.rb#8 + def call(template, source); end - private + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def default_format; end - # source://actionview//lib/action_view/renderer/renderer.rb#107 - def collection_from_object(object); end + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def default_format=(_arg0); end - # source://actionview//lib/action_view/renderer/renderer.rb#100 - def collection_from_options(options); end -end + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def default_format?; end -# source://actionview//lib/action_view/rendering.rb#25 -module ActionView::Rendering - extend ::ActiveSupport::Concern - include ::ActionView::ViewPaths + private - mixes_in_class_methods ::ActionView::ViewPaths::ClassMethods - mixes_in_class_methods ::ActionView::Rendering::ClassMethods + # source://actionview//lib/action_view/template/handlers/builder.rb#17 + def require_engine; end - # source://actionview//lib/action_view/rendering.rb#31 - def initialize; end + class << self + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def default_format; end - # Override process to set up I18n proxy. - # - # source://actionview//lib/action_view/rendering.rb#37 - def process(*_arg0, &_arg1); end + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def default_format=(value); end - # source://actionview//lib/action_view/rendering.rb#101 - def render_to_body(options = T.unsafe(nil)); end + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def default_format?; end - # Returns the value of attribute rendered_format. - # - # source://actionview//lib/action_view/rendering.rb#29 - def rendered_format; end + private - # An instance of a view class. The default view class is ActionView::Base. - # - # The view class must have the following methods: - # - # * View.new(lookup_context, assigns, controller) — Create a new - # ActionView instance for a controller and we can also pass the arguments. - # - # * View#render(option) — Returns String with the rendered template. - # - # Override this method in a module to change the default behavior. - # - # source://actionview//lib/action_view/rendering.rb#91 - def view_context; end + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def __class_attr_default_format; end - # source://actionview//lib/action_view/rendering.rb#77 - def view_context_class; end + # source://actionview//lib/action_view/template/handlers/builder.rb#6 + def __class_attr_default_format=(new_value); end + end +end - # Returns an object that is able to render templates. - # - # source://actionview//lib/action_view/rendering.rb#96 - def view_renderer; end +# source://actionview//lib/action_view/template/handlers/erb.rb#9 +class ActionView::Template::Handlers::ERB + # source://actionview//lib/action_view/template/handlers/erb.rb#65 + def call(template, source); end - private + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def erb_implementation; end - # Normalize args by converting render "foo" to render :action => "foo" and - # render "foo/bar" to render :template => "foo/bar". - # - # source://actionview//lib/action_view/rendering.rb#134 - def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def erb_implementation=(_arg0); end - # Normalize options. - # - # source://actionview//lib/action_view/rendering.rb#158 - def _normalize_options(options); end + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def erb_implementation?; end - # Assign the rendered format to look up context. - # - # source://actionview//lib/action_view/rendering.rb#127 - def _process_format(format); end + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def erb_trim_mode; end - # Find and render a template based on the options given. - # - # source://actionview//lib/action_view/rendering.rb#108 - def _render_template(options); end -end + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def erb_trim_mode=(_arg0); end -# source://actionview//lib/action_view/rendering.rb#44 -module ActionView::Rendering::ClassMethods - # source://actionview//lib/action_view/rendering.rb#48 - def _helpers; end + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def erb_trim_mode?; end - # source://actionview//lib/action_view/rendering.rb#45 - def _routes; end + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def escape_ignore_list; end - # source://actionview//lib/action_view/rendering.rb#51 - def build_view_context_class(klass, supports_path, routes, helpers); end + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def escape_ignore_list=(_arg0); end - # source://actionview//lib/action_view/rendering.rb#64 - def view_context_class; end -end + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def escape_ignore_list?; end -# = Action View Resolver -# -# source://actionview//lib/action_view/template/resolver.rb#12 -class ActionView::Resolver - # source://actionview//lib/action_view/template/resolver.rb#66 - def all_template_paths; end + # @return [Boolean] + # + # source://actionview//lib/action_view/template/handlers/erb.rb#37 + def handles_encoding?; end - # source://actionview//lib/action_view/template/resolver.rb#52 - def caching; end + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def strip_trailing_newlines; end - # source://actionview//lib/action_view/template/resolver.rb#52 - def caching=(val); end + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def strip_trailing_newlines=(_arg0); end - # source://actionview//lib/action_view/template/resolver.rb#76 - def caching?(*_arg0, &_arg1); end + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def strip_trailing_newlines?; end - # source://actionview//lib/action_view/template/resolver.rb#58 - def clear_cache; end + # @return [Boolean] + # + # source://actionview//lib/action_view/template/handlers/erb.rb#33 + def supports_streaming?; end - # Normalizes the arguments and passes it on to find_templates. + # Translate an error location returned by ErrorHighlight to the correct + # source location inside the template. # - # source://actionview//lib/action_view/template/resolver.rb#62 - def find_all(name, prefix = T.unsafe(nil), partial = T.unsafe(nil), details = T.unsafe(nil), key = T.unsafe(nil), locals = T.unsafe(nil)); end + # source://actionview//lib/action_view/template/handlers/erb.rb#43 + def translate_location(spot, _backtrace_location, source); end private - # source://actionview//lib/action_view/template/resolver.rb#72 - def _find_all(name, prefix, partial, details, key, locals); end + # Return the offset between the error lineno and the source lineno. + # Searches in reverse from the backtrace lineno so we have a better + # chance of finding the correct line + # + # The compiled template is likely to be longer than the source. + # Use the difference between the compiled and source sizes to + # determine the earliest line that could contain the highlight. + # + # @raise [LocationParsingError] + # + # source://actionview//lib/action_view/template/handlers/erb.rb#119 + def find_lineno_offset(compiled, source_lines, highlight, error_lineno); end - # This is what child classes implement. No defaults are needed - # because Resolver guarantees that the arguments are present and - # normalized. + # Find which token in the source template spans the byte range that + # contains the error_column, then return the offset compared to the + # original source template. # - # @raise [NotImplementedError] + # Iterate consecutive pairs of CODE or TEXT tokens, requiring + # a match of the first token before matching either token. # - # source://actionview//lib/action_view/template/resolver.rb#81 - def find_templates(name, prefix, partial, details, locals = T.unsafe(nil)); end + # For example, if we want to find tokens A, B, C, we do the following: + # 1. Find a match for A: test error_column or advance scanner. + # 2. Find a match for B or A: + # a. If B: start over with next token set (B, C). + # b. If A: test error_column or advance scanner. + # c. Otherwise: Advance 1 byte + # + # Prioritize matching the next token over the current token once + # a match for the current token has been found. This is to prevent + # the current token from looping past the next token if they both + # match (i.e. if the current token is a single space character). + # + # @raise [LocationParsingError] + # + # source://actionview//lib/action_view/template/handlers/erb.rb#152 + def find_offset(compiled, source_tokens, error_column); end - class << self - # source://actionview//lib/action_view/template/resolver.rb#52 - def caching; end + # source://actionview//lib/action_view/template/handlers/erb.rb#177 + def offset_source_tokens(source_tokens); end - # source://actionview//lib/action_view/template/resolver.rb#52 - def caching=(val); end + # @raise [WrongEncodingError] + # + # source://actionview//lib/action_view/template/handlers/erb.rb#97 + def valid_encoding(string, encoding); end - # source://actionview//lib/action_view/template/resolver.rb#52 - def caching?; end - end -end + class << self + # source://actionview//lib/action_view/template/handlers/erb.rb#29 + def call(template, source); end -# source://actionview//lib/action_view/template/resolver.rb#13 -ActionView::Resolver::Path = ActionView::TemplatePath + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def erb_implementation; end -# source://actionview//lib/action_view/template/resolver.rb#16 -class ActionView::Resolver::PathParser - # source://actionview//lib/action_view/template/resolver.rb#19 - def build_path_regex; end + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def erb_implementation=(value); end - # source://actionview//lib/action_view/template/resolver.rb#38 - def parse(path); end -end + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def erb_implementation?; end -# source://actionview//lib/action_view/template/resolver.rb#17 -class ActionView::Resolver::PathParser::ParsedPath < ::Struct - # Returns the value of attribute details - # - # @return [Object] the current value of details - def details; end + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def erb_trim_mode; end - # Sets the attribute details - # - # @param value [Object] the value to set the attribute details to. - # @return [Object] the newly set value - # - # source://actionview//lib/action_view/template/resolver.rb#17 - def details=(_); end + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def erb_trim_mode=(value); end - # Returns the value of attribute path - # - # @return [Object] the current value of path - def path; end + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def erb_trim_mode?; end - # Sets the attribute path - # - # @param value [Object] the value to set the attribute path to. - # @return [Object] the newly set value - # - # source://actionview//lib/action_view/template/resolver.rb#17 - def path=(_); end + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def escape_ignore_list; end - class << self - def [](*_arg0); end - def inspect; end - def members; end - def new(*_arg0); end - end -end + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def escape_ignore_list=(value); end -# source://actionview//lib/action_view/buffers.rb#41 -class ActionView::StreamingBuffer - # @return [StreamingBuffer] a new instance of StreamingBuffer - # - # source://actionview//lib/action_view/buffers.rb#42 - def initialize(block); end + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def escape_ignore_list?; end - # source://actionview//lib/action_view/buffers.rb#46 - def <<(value); end + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def strip_trailing_newlines; end - # source://actionview//lib/action_view/buffers.rb#46 - def append=(value); end + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def strip_trailing_newlines=(value); end - # source://actionview//lib/action_view/buffers.rb#46 - def concat(value); end + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def strip_trailing_newlines?; end - # source://actionview//lib/action_view/buffers.rb#63 - def html_safe; end + private - # @return [Boolean] - # - # source://actionview//lib/action_view/buffers.rb#59 - def html_safe?; end + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def __class_attr_erb_implementation; end - # source://actionview//lib/action_view/buffers.rb#54 - def safe_append=(value); end + # source://actionview//lib/action_view/template/handlers/erb.rb#17 + def __class_attr_erb_implementation=(new_value); end - # source://actionview//lib/action_view/buffers.rb#54 - def safe_concat(value); end -end + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def __class_attr_erb_trim_mode; end -# source://actionview//lib/action_view/flows.rb#30 -class ActionView::StreamingFlow < ::ActionView::OutputFlow - # @return [StreamingFlow] a new instance of StreamingFlow - # - # source://actionview//lib/action_view/flows.rb#31 - def initialize(view, fiber); end + # source://actionview//lib/action_view/template/handlers/erb.rb#14 + def __class_attr_erb_trim_mode=(new_value); end - # Appends the contents for the given key. This is called - # by providing and resuming back to the fiber, - # if that's the key it's waiting for. - # - # source://actionview//lib/action_view/flows.rb#65 - def append!(key, value); end + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def __class_attr_escape_ignore_list; end - # Try to get stored content. If the content - # is not available and we're inside the layout fiber, - # then it will begin waiting for the given key and yield. - # - # source://actionview//lib/action_view/flows.rb#43 - def get(key); end + # source://actionview//lib/action_view/template/handlers/erb.rb#20 + def __class_attr_escape_ignore_list=(new_value); end - private + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def __class_attr_strip_trailing_newlines; end - # @return [Boolean] - # - # source://actionview//lib/action_view/flows.rb#71 - def inside_fiber?; end + # source://actionview//lib/action_view/template/handlers/erb.rb#23 + def __class_attr_strip_trailing_newlines=(new_value); end + end end -# == TODO -# -# * Support streaming from child templates, partials and so on. -# * Rack::Cache needs to support streaming bodies -# -# source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#13 -class ActionView::StreamingTemplateRenderer < ::ActionView::TemplateRenderer - # 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 - # that knows how to render the template. +# source://actionview//lib/action_view/template/handlers/erb.rb#25 +ActionView::Template::Handlers::ERB::ENCODING_TAG = T.let(T.unsafe(nil), Regexp) + +# source://actionview//lib/action_view/template/handlers/erb/erubi.rb#9 +class ActionView::Template::Handlers::ERB::Erubi < ::Erubi::Engine + # @return [Erubi] a new instance of Erubi # - # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#45 - def render_template(view, template, layout_name = T.unsafe(nil), locals = T.unsafe(nil)); end + # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#11 + def initialize(input, properties = T.unsafe(nil)); end private - # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#57 - def delayed_render(buffer, template, layout, view, locals); end -end + # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#65 + def add_code(code); end -# A valid Rack::Body (i.e. it responds to each). -# It is initialized with a block that, when called, starts -# rendering the template. -# -# source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#14 -class ActionView::StreamingTemplateRenderer::Body - # @return [Body] a new instance of Body - # - # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#15 - def initialize(&start); end + # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#47 + def add_expression(indicator, code); end - # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#19 - def each(&block); end + # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#70 + def add_postamble(_); end - private + # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#30 + def add_text(text); end - # This is the same logging logic as in ShowExceptions middleware. - # - # source://actionview//lib/action_view/renderer/streaming_template_renderer.rb#31 - def log_error(exception); end + # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#75 + def flush_newline_if_pending(src); end end -# source://actionview//lib/action_view/template/error.rb#232 -class ActionView::SyntaxErrorInTemplate < ::ActionView::Template::Error - # @return [SyntaxErrorInTemplate] a new instance of SyntaxErrorInTemplate - # - # source://actionview//lib/action_view/template/error.rb#233 - def initialize(template, offending_code_string); end +# source://actionview//lib/action_view/template/handlers/erb/erubi.rb#45 +ActionView::Template::Handlers::ERB::Erubi::BLOCK_EXPR = T.let(T.unsafe(nil), Regexp) - # source://actionview//lib/action_view/template/error.rb#244 - def annotated_source_code; end +# source://actionview//lib/action_view/template/handlers/erb.rb#27 +class ActionView::Template::Handlers::ERB::LocationParsingError < ::StandardError; end - # source://actionview//lib/action_view/template/error.rb#238 - def message; end +# source://actionview//lib/action_view/template/handlers/html.rb#5 +class ActionView::Template::Handlers::Html < ::ActionView::Template::Handlers::Raw + # source://actionview//lib/action_view/template/handlers/html.rb#6 + def call(template, source); end end -# = Action View Renderable Template for objects that respond to #render_in -# -# source://actionview//lib/action_view/template.rb#8 -class ActionView::Template - extend ::ActiveSupport::Autoload - extend ::ActionView::Template::Handlers - - # @return [Template] a new instance of Template - # - # source://actionview//lib/action_view/template.rb#123 - def initialize(source, identifier, handler, locals:, format: T.unsafe(nil), variant: T.unsafe(nil), virtual_path: T.unsafe(nil)); end - - # This method is responsible for properly setting the encoding of the - # source. Until this point, we assume that the source is BINARY data. - # If no additional information is supplied, we assume the encoding is - # the same as Encoding.default_external. - # - # The user can also specify the encoding via a comment on the first - # with any template engine, as we process out the encoding comment - # before passing the source on to the template engine, leaving a - # blank line in its stead. - # - # source://actionview//lib/action_view/template.rb#189 - def encode!; end +# source://actionview//lib/action_view/template/handlers/raw.rb#5 +class ActionView::Template::Handlers::Raw + # source://actionview//lib/action_view/template/handlers/raw.rb#6 + def call(template, source); end +end - # Returns the value of attribute format. - # - # source://actionview//lib/action_view/template.rb#121 - def format; end +# source://actionview//lib/action_view/template/inline.rb#7 +class ActionView::Template::Inline < ::ActionView::Template + # source://actionview//lib/action_view/template/inline.rb#16 + def compile(mod); end +end - # Returns the value of attribute handler. - # - # source://actionview//lib/action_view/template.rb#120 - def handler; end +# This finalizer is needed (and exactly with a proc inside another proc) +# otherwise templates leak in development. +# +# source://actionview//lib/action_view/template/inline.rb#8 +ActionView::Template::Inline::Finalizer = T.let(T.unsafe(nil), Proc) - # Returns the value of attribute identifier. - # - # source://actionview//lib/action_view/template.rb#120 - def identifier; end +# source://actionview//lib/action_view/template.rb#308 +ActionView::Template::LEADING_ENCODING_REGEXP = T.let(T.unsafe(nil), Regexp) - # source://actionview//lib/action_view/template.rb#171 - def inspect; end +# source://actionview//lib/action_view/template.rb#197 +ActionView::Template::NONE = T.let(T.unsafe(nil), Object) - # Returns the value of attribute locals. - # - # source://actionview//lib/action_view/template.rb#121 - def locals; end +# source://actionview//lib/action_view/template.rb#558 +ActionView::Template::RUBY_RESERVED_KEYWORDS = T.let(T.unsafe(nil), Array) - # Exceptions are marshalled when using the parallel test runner with DRb, so we need - # to ensure that references to the template object can be marshalled as well. This means forgoing - # the marshalling of the compiler mutex and instantiating that again on unmarshalling. +# = Action View RawFile Template +# +# source://actionview//lib/action_view/template/raw_file.rb#6 +class ActionView::Template::RawFile + # @return [RawFile] a new instance of RawFile # - # source://actionview//lib/action_view/template.rb#229 - def marshal_dump; end + # source://actionview//lib/action_view/template/raw_file.rb#9 + def initialize(filename); end - # source://actionview//lib/action_view/template.rb#233 - def marshal_load(array); end + # source://actionview//lib/action_view/template/raw_file.rb#7 + def format; end - # Render a template. If the template was not compiled yet, it is done - # exactly before rendering. - # - # This method is instrumented as "!render_template.action_view". Notice that - # we use a bang in this instrumentation because you don't want to - # consume this in production. This is only slow if it's being listened to. - # - # source://actionview//lib/action_view/template.rb#154 - def render(view, locals, buffer = T.unsafe(nil), add_to_stack: T.unsafe(nil), &block); end + # source://actionview//lib/action_view/template/raw_file.rb#7 + def format=(_arg0); end - # source://actionview//lib/action_view/template.rb#167 - def short_identifier; end + # source://actionview//lib/action_view/template/raw_file.rb#16 + def identifier; end - # source://actionview//lib/action_view/template.rb#175 - def source; end + # source://actionview//lib/action_view/template/raw_file.rb#20 + def render(*args); end - # Returns whether the underlying handler supports streaming. If so, - # a streaming buffer *may* be passed when it starts rendering. - # # @return [Boolean] # - # source://actionview//lib/action_view/template.rb#144 + # source://actionview//lib/action_view/template/raw_file.rb#24 def supports_streaming?; end - # source://actionview//lib/action_view/template.rb#163 + # source://actionview//lib/action_view/template/raw_file.rb#7 def type; end - # Returns the value of attribute variable. - # - # source://actionview//lib/action_view/template.rb#121 - def variable; end - - # Returns the value of attribute variant. - # - # source://actionview//lib/action_view/template.rb#121 - def variant; end - - # Returns the value of attribute virtual_path. - # - # source://actionview//lib/action_view/template.rb#121 - def virtual_path; end - - private - - # Among other things, this method is responsible for properly setting - # the encoding of the compiled template. - # - # If the template engine handles encodings, we send the encoded - # String to the engine without further processing. This allows - # the template engine to support additional mechanisms for - # - # Otherwise, after we figure out the correct encoding, we then - # encode the source into Encoding.default_internal. - # In general, this means that templates will be UTF-8 inside of Rails, - # regardless of the original source encoding. - # - # source://actionview//lib/action_view/template.rb#275 - def compile(mod); end + # source://actionview//lib/action_view/template/raw_file.rb#7 + def type=(_arg0); end +end - # Compile a template. This method ensures a template is compiled - # just once and removes the source after it is compiled. +# = Action View Renderable Template for objects that respond to #render_in +# +# source://actionview//lib/action_view/template/renderable.rb#6 +class ActionView::Template::Renderable + # @return [Renderable] a new instance of Renderable # - # source://actionview//lib/action_view/template.rb#241 - def compile!(view); end - - # source://actionview//lib/action_view/template.rb#316 - def handle_render_error(view, e); end - - # source://actionview//lib/action_view/template.rb#352 - def identifier_method_name; end - - # source://actionview//lib/action_view/template.rb#356 - def instrument(action, &block); end - - # source://actionview//lib/action_view/template.rb#364 - def instrument_payload; end - - # source://actionview//lib/action_view/template.rb#360 - def instrument_render_template(&block); end - - # source://actionview//lib/action_view/template.rb#325 - def locals_code; end + # source://actionview//lib/action_view/template/renderable.rb#7 + def initialize(renderable); end - # source://actionview//lib/action_view/template.rb#344 - def method_name; end + # source://actionview//lib/action_view/template/renderable.rb#25 + def format; end - class << self - # source://actionview//lib/action_view/template.rb#117 - def frozen_string_literal; end + # source://actionview//lib/action_view/template/renderable.rb#11 + def identifier; end - # source://actionview//lib/action_view/template.rb#117 - def frozen_string_literal=(_arg0); end - end + # source://actionview//lib/action_view/template/renderable.rb#15 + def render(context, *args); end end -# 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 -# precise exception message. +# source://actionview//lib/action_view/template.rb#10 +ActionView::Template::STRICT_LOCALS_REGEX = T.let(T.unsafe(nil), Regexp) + +# SimpleType is mostly just a stub implementation for when Action View +# is used without Action Dispatch. # -# source://actionview//lib/action_view/template/error.rb#153 -class ActionView::Template::Error < ::ActionView::ActionViewError - # @return [Error] a new instance of Error +# source://actionview//lib/action_view/template/types.rb#9 +class ActionView::Template::SimpleType + # @return [SimpleType] a new instance of SimpleType # - # source://actionview//lib/action_view/template/error.rb#159 - def initialize(template); end + # source://actionview//lib/action_view/template/types.rb#29 + def initialize(symbol); end - # source://actionview//lib/action_view/template/error.rb#207 - def annotated_source_code; end + # source://actionview//lib/action_view/template/types.rb#43 + def ==(type); end - # Override to prevent #cause resetting during re-raise. - # - # source://actionview//lib/action_view/template/error.rb#157 - def cause; end + # source://actionview//lib/action_view/template/types.rb#38 + def ref; end - # source://actionview//lib/action_view/template/error.rb#166 - def file_name; end + # Returns the value of attribute symbol. + # + # source://actionview//lib/action_view/template/types.rb#27 + def symbol; end - # source://actionview//lib/action_view/template/error.rb#199 - def line_number; end + # source://actionview//lib/action_view/template/types.rb#33 + def to_s; end - # source://actionview//lib/action_view/template/error.rb#179 - def source_extract(indentation = T.unsafe(nil)); end + # source://actionview//lib/action_view/template/types.rb#36 + def to_str; end - # source://actionview//lib/action_view/template/error.rb#170 - def sub_template_message; end + # source://actionview//lib/action_view/template/types.rb#41 + def to_sym; end - # source://actionview//lib/action_view/template/error.rb#194 - def sub_template_of(template_path); end + class << self + # source://actionview//lib/action_view/template/types.rb#14 + def [](type); end - private + # Returns the value of attribute symbols. + # + # source://actionview//lib/action_view/template/types.rb#12 + def symbols; end - # source://actionview//lib/action_view/template/error.rb#220 - def formatted_code_for(source_code, line_counter, indent); end + # :nodoc + # + # @return [Boolean] + # + # source://actionview//lib/action_view/template/types.rb#22 + def valid_symbols?(symbols); end + end +end - # source://actionview//lib/action_view/template/error.rb#212 - def source_location; end +# source://actionview//lib/action_view/template/sources.rb#5 +module ActionView::Template::Sources + extend ::ActiveSupport::Autoload end -# source://actionview//lib/action_view/template/error.rb#154 -ActionView::Template::Error::SOURCE_CODE_RADIUS = T.let(T.unsafe(nil), Integer) +# source://actionview//lib/action_view/template/sources/file.rb#6 +class ActionView::Template::Sources::File + # @return [File] a new instance of File + # + # source://actionview//lib/action_view/template/sources/file.rb#7 + def initialize(filename); end -# source://actionview//lib/action_view/template/html.rb#6 -class ActionView::Template::HTML - # @return [HTML] a new instance of HTML + # source://actionview//lib/action_view/template/sources/file.rb#11 + def to_s; end +end + +# = Action View Text Template +# +# source://actionview//lib/action_view/template/text.rb#6 +class ActionView::Template::Text + # @return [Text] a new instance of Text # - # source://actionview//lib/action_view/template/html.rb#9 - def initialize(string, type); end + # source://actionview//lib/action_view/template/text.rb#9 + def initialize(string); end - # source://actionview//lib/action_view/template/html.rb#28 + # source://actionview//lib/action_view/template/text.rb#27 def format; end - # source://actionview//lib/action_view/template/html.rb#14 + # source://actionview//lib/action_view/template/text.rb#13 def identifier; end - # source://actionview//lib/action_view/template/html.rb#14 + # source://actionview//lib/action_view/template/text.rb#17 def inspect; end - # source://actionview//lib/action_view/template/html.rb#24 + # source://actionview//lib/action_view/template/text.rb#23 def render(*args); end - # source://actionview//lib/action_view/template/html.rb#20 + # source://actionview//lib/action_view/template/text.rb#19 def to_str; end - # source://actionview//lib/action_view/template/html.rb#7 + # source://actionview//lib/action_view/template/text.rb#7 def type; end + + # source://actionview//lib/action_view/template/text.rb#7 + def type=(_arg0); end end -# source://actionview//lib/action_view/template/handlers.rb#6 -module ActionView::Template::Handlers - # source://actionview//lib/action_view/template/handlers.rb#61 - def handler_for_extension(extension); end +# source://actionview//lib/action_view/template.rb#189 +ActionView::Template::Types = Mime - # source://actionview//lib/action_view/template/handlers.rb#56 - def register_default_template_handler(extension, klass); end +# source://actionview//lib/action_view/template_details.rb#4 +class ActionView::TemplateDetails + # @return [TemplateDetails] a new instance of TemplateDetails + # + # source://actionview//lib/action_view/template_details.rb#35 + def initialize(locale, handler, format, variant); end - # Register an object that knows how to handle template files with the given - # extensions. This can be used to implement new template types. - # The handler must respond to +:call+, which will be passed the template - # and should return the rendered template as a String. + # Returns the value of attribute format. # - # @raise [ArgumentError] + # source://actionview//lib/action_view/template_details.rb#33 + def format; end + + # source://actionview//lib/action_view/template_details.rb#62 + def format_or_default; end + + # Returns the value of attribute handler. # - # source://actionview//lib/action_view/template/handlers.rb#31 - def register_template_handler(*extensions, handler); end + # source://actionview//lib/action_view/template_details.rb#33 + def handler; end - # source://actionview//lib/action_view/template/handlers.rb#52 - def registered_template_handler(extension); end + # source://actionview//lib/action_view/template_details.rb#58 + def handler_class; end - # source://actionview//lib/action_view/template/handlers.rb#48 - def template_handler_extensions; end + # Returns the value of attribute locale. + # + # source://actionview//lib/action_view/template_details.rb#33 + def locale; end - # Opposite to register_template_handler. + # @return [Boolean] # - # source://actionview//lib/action_view/template/handlers.rb#40 - def unregister_template_handler(*extensions); end + # source://actionview//lib/action_view/template_details.rb#42 + def matches?(requested); end - class << self - # @private - # - # source://actionview//lib/action_view/template/handlers.rb#12 - def extended(base); end + # source://actionview//lib/action_view/template_details.rb#49 + def sort_key_for(requested); end - # source://actionview//lib/action_view/template/handlers.rb#23 - def extensions; end - end + # Returns the value of attribute variant. + # + # source://actionview//lib/action_view/template_details.rb#33 + def variant; end end -# source://actionview//lib/action_view/template/handlers/builder.rb#5 -class ActionView::Template::Handlers::Builder - # source://actionview//lib/action_view/template/handlers/builder.rb#8 - def call(template, source); end - - # source://actionview//lib/action_view/template/handlers/builder.rb#6 - def default_format; end +# source://actionview//lib/action_view/template_details.rb#5 +class ActionView::TemplateDetails::Requested + # @return [Requested] a new instance of Requested + # + # source://actionview//lib/action_view/template_details.rb#11 + def initialize(locale:, handlers:, formats:, variants:); end - # source://actionview//lib/action_view/template/handlers/builder.rb#6 - def default_format=(_arg0); end + # Returns the value of attribute formats. + # + # source://actionview//lib/action_view/template_details.rb#6 + def formats; end - # source://actionview//lib/action_view/template/handlers/builder.rb#6 - def default_format?; end + # Returns the value of attribute formats_idx. + # + # source://actionview//lib/action_view/template_details.rb#7 + def formats_idx; end - private + # Returns the value of attribute handlers. + # + # source://actionview//lib/action_view/template_details.rb#6 + def handlers; end - # source://actionview//lib/action_view/template/handlers/builder.rb#17 - def require_engine; end + # Returns the value of attribute handlers_idx. + # + # source://actionview//lib/action_view/template_details.rb#7 + def handlers_idx; end - class << self - # source://actionview//lib/action_view/template/handlers/builder.rb#6 - def default_format; end + # Returns the value of attribute locale. + # + # source://actionview//lib/action_view/template_details.rb#6 + def locale; end - # source://actionview//lib/action_view/template/handlers/builder.rb#6 - def default_format=(value); end + # Returns the value of attribute locale_idx. + # + # source://actionview//lib/action_view/template_details.rb#7 + def locale_idx; end - # source://actionview//lib/action_view/template/handlers/builder.rb#6 - def default_format?; end - end -end + # Returns the value of attribute variants. + # + # source://actionview//lib/action_view/template_details.rb#6 + def variants; end -# source://actionview//lib/action_view/template/handlers/erb.rb#6 -class ActionView::Template::Handlers::ERB - # source://actionview//lib/action_view/template/handlers/erb.rb#36 - def call(template, source); end + # Returns the value of attribute variants_idx. + # + # source://actionview//lib/action_view/template_details.rb#7 + def variants_idx; end - # source://actionview//lib/action_view/template/handlers/erb.rb#14 - def erb_implementation; end + private - # source://actionview//lib/action_view/template/handlers/erb.rb#14 - def erb_implementation=(_arg0); end + # source://actionview//lib/action_view/template_details.rb#28 + def build_idx_hash(arr); end +end - # source://actionview//lib/action_view/template/handlers/erb.rb#14 - def erb_implementation?; end +# source://actionview//lib/action_view/template_details.rb#9 +ActionView::TemplateDetails::Requested::ANY_HASH = T.let(T.unsafe(nil), Hash) - # source://actionview//lib/action_view/template/handlers/erb.rb#11 - def erb_trim_mode; end +# source://actionview//lib/action_view/template/error.rb#254 +ActionView::TemplateError = ActionView::Template::Error - # source://actionview//lib/action_view/template/handlers/erb.rb#11 - def erb_trim_mode=(_arg0); end +# = Action View \TemplatePath +# +# Represents a template path within ActionView's lookup and rendering system, +# like "users/show" +# +# TemplatePath makes it convenient to convert between separate name, prefix, +# partial arguments and the virtual path. +# +# source://actionview//lib/action_view/template_path.rb#11 +class ActionView::TemplatePath + # @return [TemplatePath] a new instance of TemplatePath + # + # source://actionview//lib/action_view/template_path.rb#47 + def initialize(name, prefix, partial, virtual); end - # source://actionview//lib/action_view/template/handlers/erb.rb#11 - def erb_trim_mode?; end + # @return [Boolean] + # + # source://actionview//lib/action_view/template_path.rb#64 + def ==(other); end - # source://actionview//lib/action_view/template/handlers/erb.rb#17 - def escape_ignore_list; end + # @return [Boolean] + # + # source://actionview//lib/action_view/template_path.rb#61 + def eql?(other); end - # source://actionview//lib/action_view/template/handlers/erb.rb#17 - def escape_ignore_list=(_arg0); end + # source://actionview//lib/action_view/template_path.rb#57 + def hash; end - # source://actionview//lib/action_view/template/handlers/erb.rb#17 - def escape_ignore_list?; end + # Returns the value of attribute name. + # + # source://actionview//lib/action_view/template_path.rb#12 + def name; end - # @return [Boolean] + # Returns the value of attribute partial. # - # source://actionview//lib/action_view/template/handlers/erb.rb#32 - def handles_encoding?; end + # source://actionview//lib/action_view/template_path.rb#12 + def partial; end - # source://actionview//lib/action_view/template/handlers/erb.rb#20 - def strip_trailing_newlines; end + # Returns the value of attribute partial. + # + # source://actionview//lib/action_view/template_path.rb#13 + def partial?; end - # source://actionview//lib/action_view/template/handlers/erb.rb#20 - def strip_trailing_newlines=(_arg0); end + # Returns the value of attribute prefix. + # + # source://actionview//lib/action_view/template_path.rb#12 + def prefix; end - # source://actionview//lib/action_view/template/handlers/erb.rb#20 - def strip_trailing_newlines?; end + # Returns the value of attribute virtual. + # + # source://actionview//lib/action_view/template_path.rb#55 + def to_s; end - # @return [Boolean] + # Returns the value of attribute virtual. # - # source://actionview//lib/action_view/template/handlers/erb.rb#28 - def supports_streaming?; end + # source://actionview//lib/action_view/template_path.rb#54 + def to_str; end - private + # Returns the value of attribute virtual. + # + # source://actionview//lib/action_view/template_path.rb#12 + def virtual; end - # @raise [WrongEncodingError] + # Returns the value of attribute virtual. # - # source://actionview//lib/action_view/template/handlers/erb.rb#68 - def valid_encoding(string, encoding); end + # source://actionview//lib/action_view/template_path.rb#14 + def virtual_path; end class << self - # source://actionview//lib/action_view/template/handlers/erb.rb#24 - def call(template, source); end - - # source://actionview//lib/action_view/template/handlers/erb.rb#14 - def erb_implementation; end + # Convert name, prefix, and partial into a TemplatePath + # + # source://actionview//lib/action_view/template_path.rb#43 + def build(name, prefix, partial); end - # source://actionview//lib/action_view/template/handlers/erb.rb#14 - def erb_implementation=(value); end + # Build a TemplatePath form a virtual path + # + # source://actionview//lib/action_view/template_path.rb#28 + def parse(virtual); end - # source://actionview//lib/action_view/template/handlers/erb.rb#14 - def erb_implementation?; end + # Convert name, prefix, and partial into a virtual path string + # + # source://actionview//lib/action_view/template_path.rb#17 + def virtual(name, prefix, partial); end + end +end - # source://actionview//lib/action_view/template/handlers/erb.rb#11 - def erb_trim_mode; end +# source://actionview//lib/action_view/renderer/template_renderer.rb#4 +class ActionView::TemplateRenderer < ::ActionView::AbstractRenderer + # source://actionview//lib/action_view/renderer/template_renderer.rb#5 + def render(context, options); end - # source://actionview//lib/action_view/template/handlers/erb.rb#11 - def erb_trim_mode=(value); end + private - # source://actionview//lib/action_view/template/handlers/erb.rb#11 - def erb_trim_mode?; end + # Determine the template to be rendered using the given options. + # + # source://actionview//lib/action_view/renderer/template_renderer.rb#16 + def determine_template(options); end - # source://actionview//lib/action_view/template/handlers/erb.rb#17 - def escape_ignore_list; end + # This is the method which actually finds the layout using details in the lookup + # context object. If no layout is found, it checks if at least a layout with + # the given name exists across all details before raising the error. + # + # source://actionview//lib/action_view/renderer/template_renderer.rb#88 + def find_layout(layout, keys, formats); end - # source://actionview//lib/action_view/template/handlers/erb.rb#17 - def escape_ignore_list=(value); end + # Renders the given template. A string representing the layout can be + # supplied as well. + # + # source://actionview//lib/action_view/renderer/template_renderer.rb#58 + def render_template(view, template, layout_name, locals); end - # source://actionview//lib/action_view/template/handlers/erb.rb#17 - def escape_ignore_list?; end + # source://actionview//lib/action_view/renderer/template_renderer.rb#71 + def render_with_layout(view, template, path, locals); end - # source://actionview//lib/action_view/template/handlers/erb.rb#20 - def strip_trailing_newlines; end + # source://actionview//lib/action_view/renderer/template_renderer.rb#92 + def resolve_layout(layout, keys, formats); end +end - # source://actionview//lib/action_view/template/handlers/erb.rb#20 - def strip_trailing_newlines=(value); end +# = Action View Test Case +# +# Read more about ActionView::TestCase in {Testing Rails Applications}[https://guides.rubyonrails.org/testing.html#testing-view-partials] +# in the guides. +# +# source://actionview//lib/action_view/test_case.rb#15 +class ActionView::TestCase < ::ActiveSupport::TestCase + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions::ResponseAssertions + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionDispatch::Assertions + include ::AbstractController::Helpers + include ::ActiveSupport::Benchmarkable + include ::ActionView::Helpers::ActiveModelHelper + include ::ActionView::Helpers::AssetUrlHelper + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + include ::ActionView::Helpers::TagHelper + include ::ActionView::Helpers::AssetTagHelper + include ::ActionView::Helpers::AtomFeedHelper + include ::ActionView::Helpers::CacheHelper + include ::ActionView::Helpers::ContentExfiltrationPreventionHelper + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::ControllerHelper + include ::ActionView::Helpers::CspHelper + include ::ActionView::Helpers::CsrfHelper + include ::ActionView::Helpers::DateHelper + include ::ActionView::Helpers::DebugHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionController::TemplateAssertions + include ::ActionView::Context + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionView::ModelNaming + include ::ActionView::RecordIdentifier + include ::ActionView::Helpers::FormHelper + include ::ActionView::Helpers::TranslationHelper + include ::ActionView::Helpers::FormOptionsHelper + include ::ActionView::Helpers::JavaScriptHelper + include ::ActionView::Helpers::NumberHelper + include ::ActionView::Helpers::RenderingHelper + include ::ActionView::Helpers + include ::ActiveSupport::Testing::ConstantLookup + include ::ActionDispatch::Routing::UrlFor + include ::ActionView::RoutingUrlFor + include ::ActionView::TestCase::Behavior + extend ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + extend ::AbstractController::Helpers::Resolution + extend ::AbstractController::Helpers::ClassMethods + extend ::ActionView::Helpers::UrlHelper::ClassMethods + extend ::ActionView::Helpers::SanitizeHelper::ClassMethods + extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods + extend ::ActionView::TestCase::Behavior::ClassMethods - # source://actionview//lib/action_view/template/handlers/erb.rb#20 - def strip_trailing_newlines?; end - end -end + # source://actionview//lib/action_view/test_case.rb#444 + def _helper_methods; end -# source://actionview//lib/action_view/template/handlers/erb.rb#22 -ActionView::Template::Handlers::ERB::ENCODING_TAG = T.let(T.unsafe(nil), Regexp) + # source://actionview//lib/action_view/test_case.rb#444 + def _helper_methods=(_arg0); end -# source://actionview//lib/action_view/template/handlers/erb/erubi.rb#10 -class ActionView::Template::Handlers::ERB::Erubi < ::Erubi::Engine - # @return [Erubi] a new instance of Erubi - # - # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#11 - def initialize(input, properties = T.unsafe(nil)); end + # source://actionview//lib/action_view/test_case.rb#444 + def _helper_methods?; end - # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#26 - def evaluate(action_view_erb_handler_context); end + # source://actionview//lib/action_view/test_case.rb#251 + def _run_setup_callbacks(&block); end - private + # source://actionview//lib/action_view/test_case.rb#444 + def debug_missing_translation; end - # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#69 - def add_code(code); end + # source://actionview//lib/action_view/test_case.rb#444 + def debug_missing_translation=(val); end - # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#53 - def add_expression(indicator, code); end + class << self + # source://actionview//lib/action_view/test_case.rb#444 + def _helper_methods; end - # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#74 - def add_postamble(_); end + # source://actionview//lib/action_view/test_case.rb#444 + def _helper_methods=(value); end - # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#36 - def add_text(text); end + # source://actionview//lib/action_view/test_case.rb#444 + def _helper_methods?; end - # source://actionview//lib/action_view/template/handlers/erb/erubi.rb#79 - def flush_newline_if_pending(src); end -end + # source://actionview//lib/action_view/test_case.rb#444 + def _helpers; end -# source://actionview//lib/action_view/template/handlers/erb/erubi.rb#51 -ActionView::Template::Handlers::ERB::Erubi::BLOCK_EXPR = T.let(T.unsafe(nil), Regexp) + # source://actionview//lib/action_view/test_case.rb#249 + def content_class; end -# source://actionview//lib/action_view/template/handlers/html.rb#5 -class ActionView::Template::Handlers::Html < ::ActionView::Template::Handlers::Raw - # source://actionview//lib/action_view/template/handlers/html.rb#6 - def call(template, source); end -end + # source://actionview//lib/action_view/test_case.rb#249 + def content_class=(value); end -# source://actionview//lib/action_view/template/handlers/raw.rb#5 -class ActionView::Template::Handlers::Raw - # source://actionview//lib/action_view/template/handlers/raw.rb#6 - def call(template, source); end -end + # source://actionview//lib/action_view/test_case.rb#249 + def content_class?; end -# source://actionview//lib/action_view/template/inline.rb#7 -class ActionView::Template::Inline < ::ActionView::Template - # source://actionview//lib/action_view/template/inline.rb#16 - def compile(mod); end -end + # source://actionview//lib/action_view/test_case.rb#444 + def debug_missing_translation; end -# This finalizer is needed (and exactly with a proc inside another proc) -# otherwise templates leak in development. -# -# source://actionview//lib/action_view/template/inline.rb#8 -ActionView::Template::Inline::Finalizer = T.let(T.unsafe(nil), Proc) + # source://actionview//lib/action_view/test_case.rb#444 + def debug_missing_translation=(val); end -# source://actionview//lib/action_view/template/raw_file.rb#6 -class ActionView::Template::RawFile - # @return [RawFile] a new instance of RawFile - # - # source://actionview//lib/action_view/template/raw_file.rb#9 - def initialize(filename); end + private - # source://actionview//lib/action_view/template/raw_file.rb#7 - def format; end + # source://actionview//lib/action_view/test_case.rb#251 + def __class_attr___callbacks; end - # source://actionview//lib/action_view/template/raw_file.rb#7 - def format=(_arg0); end + # source://actionview//lib/action_view/test_case.rb#251 + def __class_attr___callbacks=(new_value); end - # source://actionview//lib/action_view/template/raw_file.rb#16 - def identifier; end + # source://actionview//lib/action_view/test_case.rb#444 + def __class_attr__helper_methods; end - # source://actionview//lib/action_view/template/raw_file.rb#20 - def render(*args); end + # source://actionview//lib/action_view/test_case.rb#444 + def __class_attr__helper_methods=(new_value); end - # source://actionview//lib/action_view/template/raw_file.rb#7 - def type; end + # source://actionview//lib/action_view/test_case.rb#249 + def __class_attr_content_class; end - # source://actionview//lib/action_view/template/raw_file.rb#7 - def type=(_arg0); end + # source://actionview//lib/action_view/test_case.rb#249 + def __class_attr_content_class=(new_value); end + end end -# source://actionview//lib/action_view/template/renderable.rb#6 -class ActionView::Template::Renderable - # @return [Renderable] a new instance of Renderable - # - # source://actionview//lib/action_view/template/renderable.rb#7 - def initialize(renderable); end - - # source://actionview//lib/action_view/template/renderable.rb#19 - def format; end +# source://actionview//lib/action_view/test_case.rb#45 +module ActionView::TestCase::Behavior + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + include ::Rails::Dom::Testing::Assertions::DomAssertions + include ::Rails::Dom::Testing::Assertions::SelectorAssertions + include ::Rails::Dom::Testing::Assertions + include ::ActionController::TemplateAssertions + include ::ActionView::Context + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionView::ModelNaming + include ::ActionView::RecordIdentifier + include ::ActionDispatch::Routing::UrlFor + include ::ActionView::RoutingUrlFor + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Assertions::RoutingAssertions + include ::ActionDispatch::Assertions + include ::AbstractController::Helpers + include ::ActionView::Helpers::UrlHelper + include ::ActionView::Helpers::SanitizeHelper + include ::ActionView::Helpers::TextHelper + include ::ActionView::Helpers::FormTagHelper + include ::ActionView::Helpers::FormHelper + include ::ActionView::Helpers::TranslationHelper + include ::ActionView::Helpers + include ::ActiveSupport::Testing::ConstantLookup - # source://actionview//lib/action_view/template/renderable.rb#11 - def identifier; end + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionDispatch::Assertions::RoutingAssertions::ClassMethods + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods + mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods + mixes_in_class_methods ::ActionView::TestCase::Behavior::ClassMethods - # source://actionview//lib/action_view/template/renderable.rb#15 - def render(context, *args); end -end + # source://actionview//lib/action_view/test_case.rb#295 + def _routes; end -# source://actionview//lib/action_view/template/sources.rb#5 -module ActionView::Template::Sources - extend ::ActiveSupport::Autoload -end + # source://actionview//lib/action_view/test_case.rb#281 + def config; end -# source://actionview//lib/action_view/template/sources/file.rb#6 -class ActionView::Template::Sources::File - # @return [File] a new instance of File + # Returns the value of attribute controller. # - # source://actionview//lib/action_view/template/sources/file.rb#7 - def initialize(filename); end - - # source://actionview//lib/action_view/template/sources/file.rb#11 - def to_s; end -end + # source://actionview//lib/action_view/test_case.rb#63 + def controller; end -# source://actionview//lib/action_view/template/text.rb#6 -class ActionView::Template::Text - # @return [Text] a new instance of Text + # Sets the attribute controller # - # source://actionview//lib/action_view/template/text.rb#9 - def initialize(string); end + # @param value the value to set the attribute controller to. + # + # source://actionview//lib/action_view/test_case.rb#63 + def controller=(_arg0); end - # source://actionview//lib/action_view/template/text.rb#27 - def format; end + # source://actionview//lib/action_view/test_case.rb#62 + def lookup_context(*_arg0, **_arg1, &_arg2); end - # source://actionview//lib/action_view/template/text.rb#13 - def identifier; end + # Returns the value of attribute output_buffer. + # + # source://actionview//lib/action_view/test_case.rb#63 + def output_buffer; end - # source://actionview//lib/action_view/template/text.rb#13 - def inspect; end + # Sets the attribute output_buffer + # + # @param value the value to set the attribute output_buffer to. + # + # source://actionview//lib/action_view/test_case.rb#63 + def output_buffer=(_arg0); end - # source://actionview//lib/action_view/template/text.rb#23 - def render(*args); end + # source://actionview//lib/action_view/test_case.rb#285 + def render(options = T.unsafe(nil), local_assigns = T.unsafe(nil), &block); end - # source://actionview//lib/action_view/template/text.rb#19 - def to_str; end + # Returns the content rendered by the last +render+ call. + # + # The returned object behaves like a string but also exposes a number of methods + # that allows you to parse the content string in formats registered using + # .register_parser. + # + # By default includes the following parsers: + # + # +.html+ + # + # Parse the rendered content String into HTML. By default, this means + # a Nokogiri::XML::Node. + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.html.at("main h1") => { content: "Hello, world" } } + # end + # + # To parse the rendered content into a Capybara::Simple::Node, + # re-register an :html parser with a call to + # Capybara.string: + # + # register_parser :html, -> rendered { Capybara.string(rendered) } + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: article + # + # rendered.html.assert_css "h1", text: "Hello, world" + # end + # + # +.json+ + # + # Parse the rendered content String into JSON. By default, this means + # a ActiveSupport::HashWithIndifferentAccess. + # + # test "renders JSON" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :json, partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.json => { title: "Hello, world" } } + # end + # + # source://actionview//lib/action_view/test_case.rb#112 + def rendered; end - # source://actionview//lib/action_view/template/text.rb#7 - def type; end + # Returns the content rendered by the last +render+ call. + # + # The returned object behaves like a string but also exposes a number of methods + # that allows you to parse the content string in formats registered using + # .register_parser. + # + # By default includes the following parsers: + # + # +.html+ + # + # Parse the rendered content String into HTML. By default, this means + # a Nokogiri::XML::Node. + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.html.at("main h1") => { content: "Hello, world" } } + # end + # + # To parse the rendered content into a Capybara::Simple::Node, + # re-register an :html parser with a call to + # Capybara.string: + # + # register_parser :html, -> rendered { Capybara.string(rendered) } + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: article + # + # rendered.html.assert_css "h1", text: "Hello, world" + # end + # + # +.json+ + # + # Parse the rendered content String into JSON. By default, this means + # a ActiveSupport::HashWithIndifferentAccess. + # + # test "renders JSON" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :json, partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.json => { title: "Hello, world" } } + # end + # + # source://actionview//lib/action_view/test_case.rb#112 + def rendered=(_arg0); end - # source://actionview//lib/action_view/template/text.rb#7 - def type=(_arg0); end -end + # source://actionview//lib/action_view/test_case.rb#291 + def rendered_views; end -# source://actionview//lib/action_view/template/types.rb#7 -module ActionView::Template::Types - class << self - # source://actionview//lib/action_view/template/types.rb#47 - def [](type); end + # Returns the value of attribute request. + # + # source://actionview//lib/action_view/test_case.rb#63 + def request; end - # source://actionview//lib/action_view/template/types.rb#43 - def delegate_to(klass); end + # Sets the attribute request + # + # @param value the value to set the attribute request to. + # + # source://actionview//lib/action_view/test_case.rb#63 + def request=(_arg0); end - # source://actionview//lib/action_view/template/types.rb#51 - def symbols; end + # source://actionview//lib/action_view/test_case.rb#269 + def setup_with_controller; end - # Returns the value of attribute type_klass. - # - # source://actionview//lib/action_view/template/types.rb#41 - def type_klass; end + private - # Sets the attribute type_klass - # - # @param value the value to set the attribute type_klass to. - # - # source://actionview//lib/action_view/template/types.rb#41 - def type_klass=(_arg0); end - end -end + # source://actionview//lib/action_view/test_case.rb#401 + def _user_defined_ivars; end -# source://actionview//lib/action_view/template/types.rb#8 -class ActionView::Template::Types::Type - # @return [Type] a new instance of Type + # The instance of ActionView::Base that is used by +render+. # - # source://actionview//lib/action_view/template/types.rb#21 - def initialize(symbol); end + # source://actionview//lib/action_view/test_case.rb#364 + def _view; end - # source://actionview//lib/action_view/template/types.rb#35 - def ==(type); end + # Need to experiment if this priority is the best one: rendered => output_buffer + # + # source://actionview//lib/action_view/test_case.rb#329 + def document_root_element; end - # source://actionview//lib/action_view/template/types.rb#30 - def ref; end + # source://actionview//lib/action_view/test_case.rb#415 + def method_missing(selector, *_arg1, **_arg2, &_arg3); end - # Returns the value of attribute symbol. + # @return [Boolean] # - # source://actionview//lib/action_view/template/types.rb#19 - def symbol; end + # source://actionview//lib/action_view/test_case.rb#431 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end - # source://actionview//lib/action_view/template/types.rb#25 - def to_s; end + # The instance of ActionView::Base that is used by +render+. + # + # source://actionview//lib/action_view/test_case.rb#353 + def view; end - # source://actionview//lib/action_view/template/types.rb#25 - def to_str; end + # Returns a Hash of instance variables and their values, as defined by + # the user in the test case, which are then assigned to the view being + # rendered. This is generally intended for internal use and extension + # frameworks. + # + # source://actionview//lib/action_view/test_case.rb#409 + def view_assigns; end - # source://actionview//lib/action_view/template/types.rb#30 - def to_sym; end + module GeneratedClassMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + def content_class; end + def content_class=(value); end + def content_class?; end + end - class << self - # source://actionview//lib/action_view/template/types.rb#11 - def [](type); end + module GeneratedInstanceMethods + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end end end -# source://actionview//lib/action_view/template/types.rb#9 -ActionView::Template::Types::Type::SET = T.let(T.unsafe(nil), T.untyped) +# source://actionview//lib/action_view/test_case.rb#114 +module ActionView::TestCase::Behavior::ClassMethods + # source://actionview//lib/action_view/test_case.rb#213 + def determine_default_helper_class(name); end -# source://actionview//lib/action_view/template_details.rb#4 -class ActionView::TemplateDetails - # @return [TemplateDetails] a new instance of TemplateDetails - # - # source://actionview//lib/action_view/template_details.rb#35 - def initialize(locale, handler, format, variant); end + # source://actionview//lib/action_view/test_case.rb#232 + def helper_class; end - # Returns the value of attribute format. + # Sets the attribute helper_class # - # source://actionview//lib/action_view/template_details.rb#33 - def format; end + # @param value the value to set the attribute helper_class to. + # + # source://actionview//lib/action_view/test_case.rb#230 + def helper_class=(_arg0); end - # source://actionview//lib/action_view/template_details.rb#62 - def format_or_default; end + # source://actionview//lib/action_view/test_case.rb#219 + def helper_method(*methods); end - # Returns the value of attribute handler. - # - # source://actionview//lib/action_view/template_details.rb#33 - def handler; end + # source://actionview//lib/action_view/test_case.rb#115 + def inherited(descendant); end - # source://actionview//lib/action_view/template_details.rb#58 - def handler_class; end + # source://actionview//lib/action_view/test_case.rb#236 + def new(*_arg0); end - # Returns the value of attribute locale. + # Register a callable to parse rendered content for a given template + # format. # - # source://actionview//lib/action_view/template_details.rb#33 - def locale; end - - # @return [Boolean] + # Each registered parser will also define a +#rendered.[FORMAT]+ helper + # method, where +[FORMAT]+ corresponds to the value of the + # +format+ argument. # - # source://actionview//lib/action_view/template_details.rb#42 - def matches?(requested); end - - # source://actionview//lib/action_view/template_details.rb#49 - def sort_key_for(requested); end - - # Returns the value of attribute variant. + # By default, ActionView::TestCase defines parsers for: # - # source://actionview//lib/action_view/template_details.rb#33 - def variant; end -end - -# source://actionview//lib/action_view/template_details.rb#5 -class ActionView::TemplateDetails::Requested - # @return [Requested] a new instance of Requested + # * +:html+ - returns an instance of +Nokogiri::XML::Node+ + # * +:json+ - returns an instance of ActiveSupport::HashWithIndifferentAccess # - # source://actionview//lib/action_view/template_details.rb#11 - def initialize(locale:, handlers:, formats:, variants:); end - - # Returns the value of attribute formats. + # These pre-registered parsers also define corresponding helpers: # - # source://actionview//lib/action_view/template_details.rb#6 - def formats; end - - # Returns the value of attribute formats_idx. + # * +:html+ - defines +rendered.html+ + # * +:json+ - defines +rendered.json+ # - # source://actionview//lib/action_view/template_details.rb#7 - def formats_idx; end - - # Returns the value of attribute handlers. + # ==== Parameters # - # source://actionview//lib/action_view/template_details.rb#6 - def handlers; end - - # Returns the value of attribute handlers_idx. + # [+format+] + # The name (as a +Symbol+) of the format used to render the content. # - # source://actionview//lib/action_view/template_details.rb#7 - def handlers_idx; end - - # Returns the value of attribute locale. + # [+callable+] + # The parser. A callable object that accepts the rendered string as + # its sole argument. Alternatively, the parser can be specified as a + # block. # - # source://actionview//lib/action_view/template_details.rb#6 - def locale; end - - # Returns the value of attribute locale_idx. + # ==== Examples # - # source://actionview//lib/action_view/template_details.rb#7 - def locale_idx; end - - # Returns the value of attribute variants. + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") # - # source://actionview//lib/action_view/template_details.rb#6 - def variants; end - - # Returns the value of attribute variants_idx. + # render partial: "articles/article", locals: { article: article } # - # source://actionview//lib/action_view/template_details.rb#7 - def variants_idx; end + # assert_pattern { rendered.html.at("main h1") => { content: "Hello, world" } } + # end + # + # test "renders JSON" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :json, partial: "articles/article", locals: { article: article } + # + # assert_pattern { rendered.json => { title: "Hello, world" } } + # end + # + # To parse the rendered content into RSS, register a call to +RSS::Parser.parse+: + # + # register_parser :rss, -> rendered { RSS::Parser.parse(rendered) } + # + # test "renders RSS" do + # article = Article.create!(title: "Hello, world") + # + # render formats: :rss, partial: article + # + # assert_equal "Hello, world", rendered.rss.items.last.title + # end + # + # To parse the rendered content into a +Capybara::Simple::Node+, + # re-register an +:html+ parser with a call to +Capybara.string+: + # + # register_parser :html, -> rendered { Capybara.string(rendered) } + # + # test "renders HTML" do + # article = Article.create!(title: "Hello, world") + # + # render partial: article + # + # rendered.html.assert_css "h1", text: "Hello, world" + # end + # + # source://actionview//lib/action_view/test_case.rb#197 + def register_parser(format, callable = T.unsafe(nil), &block); end + + # source://actionview//lib/action_view/test_case.rb#204 + def tests(helper_class); end private - # source://actionview//lib/action_view/template_details.rb#28 - def build_idx_hash(arr); end + # source://actionview//lib/action_view/test_case.rb#242 + def include_helper_modules!; end end -# source://actionview//lib/action_view/template_details.rb#9 -ActionView::TemplateDetails::Requested::ANY_HASH = T.let(T.unsafe(nil), Hash) +# source://actionview//lib/action_view/test_case.rb#366 +ActionView::TestCase::Behavior::INTERNAL_IVARS = T.let(T.unsafe(nil), Array) -# source://actionview//lib/action_view/template/error.rb#230 -ActionView::TemplateError = ActionView::Template::Error +# source://actionview//lib/action_view/test_case.rb#333 +module ActionView::TestCase::Behavior::Locals + # source://actionview//lib/action_view/test_case.rb#336 + def render(options = T.unsafe(nil), local_assigns = T.unsafe(nil)); end -# Represents a template path within ActionView's lookup and rendering system, -# like "users/show" -# -# TemplatePath makes it convenient to convert between separate name, prefix, -# partial arguments and the virtual path. -# -# source://actionview//lib/action_view/template_path.rb#9 -class ActionView::TemplatePath - # @return [TemplatePath] a new instance of TemplatePath + # Returns the value of attribute rendered_views. # - # source://actionview//lib/action_view/template_path.rb#45 - def initialize(name, prefix, partial, virtual); end + # source://actionview//lib/action_view/test_case.rb#334 + def rendered_views; end - # @return [Boolean] + # Sets the attribute rendered_views # - # source://actionview//lib/action_view/template_path.rb#59 - def ==(other); end + # @param value the value to set the attribute rendered_views to. + # + # source://actionview//lib/action_view/test_case.rb#334 + def rendered_views=(_arg0); end +end - # @return [Boolean] +# source://actionview//lib/action_view/test_case.rb#299 +class ActionView::TestCase::Behavior::RenderedViewContent < ::String + # source://actionview//lib/action_view/test_case.rb#199 + def html; end + + # source://actionview//lib/action_view/test_case.rb#199 + def json; end +end + +# source://actionview//lib/action_view/test_case.rb#302 +class ActionView::TestCase::Behavior::RenderedViewsCollection + # @return [RenderedViewsCollection] a new instance of RenderedViewsCollection # - # source://actionview//lib/action_view/template_path.rb#59 - def eql?(other); end + # source://actionview//lib/action_view/test_case.rb#303 + def initialize; end - # source://actionview//lib/action_view/template_path.rb#55 - def hash; end + # source://actionview//lib/action_view/test_case.rb#307 + def add(view, locals); end - # Returns the value of attribute name. + # source://actionview//lib/action_view/test_case.rb#312 + def locals_for(view); end + + # source://actionview//lib/action_view/test_case.rb#316 + def rendered_views; end + + # @return [Boolean] # - # source://actionview//lib/action_view/template_path.rb#10 - def name; end + # source://actionview//lib/action_view/test_case.rb#320 + def view_rendered?(view, expected_locals); end +end - # Returns the value of attribute partial. +# source://actionview//lib/action_view/test_case.rb#444 +module ActionView::TestCase::HelperMethods + # source://actionview//lib/action_view/test_case.rb#263 + def _test_case; end + + # source://actionview//lib/action_view/test_case.rb#259 + def protect_against_forgery?; end +end + +# source://actionview//lib/action_view/test_case.rb#16 +class ActionView::TestCase::TestController < ::ActionController::Base + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + + # @return [TestController] a new instance of TestController # - # source://actionview//lib/action_view/template_path.rb#10 - def partial; end + # source://actionview//lib/action_view/test_case.rb#34 + def initialize; end - # Returns the value of attribute partial. + # source://actionview//lib/action_view/test_case.rb#26 + def controller_path=(path); end + + # Returns the value of attribute params. # - # source://actionview//lib/action_view/template_path.rb#10 - def partial?; end + # source://actionview//lib/action_view/test_case.rb#19 + def params; end - # Returns the value of attribute prefix. + # Sets the attribute params # - # source://actionview//lib/action_view/template_path.rb#10 - def prefix; end + # @param value the value to set the attribute params to. + # + # source://actionview//lib/action_view/test_case.rb#19 + def params=(_arg0); end - # Returns the value of attribute virtual. + # Returns the value of attribute request. # - # source://actionview//lib/action_view/template_path.rb#10 - def to_s; end + # source://actionview//lib/action_view/test_case.rb#19 + def request; end - # Returns the value of attribute virtual. + # Sets the attribute request # - # source://actionview//lib/action_view/template_path.rb#10 - def to_str; end + # @param value the value to set the attribute request to. + # + # source://actionview//lib/action_view/test_case.rb#19 + def request=(_arg0); end - # Returns the value of attribute virtual. + # Returns the value of attribute response. # - # source://actionview//lib/action_view/template_path.rb#10 - def virtual; end + # source://actionview//lib/action_view/test_case.rb#19 + def response; end - # Returns the value of attribute virtual. + # Sets the attribute response # - # source://actionview//lib/action_view/template_path.rb#10 - def virtual_path; end + # @param value the value to set the attribute response to. + # + # source://actionview//lib/action_view/test_case.rb#19 + def response=(_arg0); end + + private + + # source://actionview//lib/action_view/test_case.rb#16 + def _layout(lookup_context, formats, keys); end class << self - # Convert name, prefix, and partial into a TemplatePath - # - # source://actionview//lib/action_view/template_path.rb#41 - def build(name, prefix, partial); end + # source://actionview//lib/action_view/test_case.rb#30 + def controller_name; end - # Build a TemplatePath form a virtual path + # Overrides AbstractController::Base#controller_path # - # source://actionview//lib/action_view/template_path.rb#26 - def parse(virtual); end + # source://actionview//lib/action_view/test_case.rb#23 + def controller_path; end - # Convert name, prefix, and partial into a virtual path string + # Overrides AbstractController::Base#controller_path # - # source://actionview//lib/action_view/template_path.rb#15 - def virtual(name, prefix, partial); end - end -end - -# source://actionview//lib/action_view/renderer/template_renderer.rb#4 -class ActionView::TemplateRenderer < ::ActionView::AbstractRenderer - # source://actionview//lib/action_view/renderer/template_renderer.rb#5 - def render(context, options); end + # source://actionview//lib/action_view/test_case.rb#23 + def controller_path=(_arg0); end - private - - # Determine the template to be rendered using the given options. - # - # source://actionview//lib/action_view/renderer/template_renderer.rb#16 - def determine_template(options); end + private - # This is the method which actually finds the layout using details in the lookup - # context object. If no layout is found, it checks if at least a layout with - # the given name exists across all details before raising the error. - # - # source://actionview//lib/action_view/renderer/template_renderer.rb#87 - def find_layout(layout, keys, formats); end + # source://actionview//lib/action_view/test_case.rb#16 + def __class_attr_config; end - # Renders the given template. A string representing the layout can be - # supplied as well. - # - # source://actionview//lib/action_view/renderer/template_renderer.rb#58 - def render_template(view, template, layout_name, locals); end + # source://actionview//lib/action_view/test_case.rb#16 + def __class_attr_config=(new_value); end - # source://actionview//lib/action_view/renderer/template_renderer.rb#70 - def render_with_layout(view, template, path, locals); end + # source://actionview//lib/action_view/test_case.rb#16 + def __class_attr_middleware_stack; end - # source://actionview//lib/action_view/renderer/template_renderer.rb#91 - def resolve_layout(layout, keys, formats); end + # source://actionview//lib/action_view/test_case.rb#16 + def __class_attr_middleware_stack=(new_value); end + end end # source://actionview//lib/action_view/unbound_template.rb#6 @@ -14244,22 +15848,25 @@ class ActionView::UnboundTemplate # source://actionview//lib/action_view/unbound_template.rb#20 def bind_locals(locals); end + # source://actionview//lib/action_view/unbound_template.rb#44 + def built_templates; end + # Returns the value of attribute details. # # source://actionview//lib/action_view/unbound_template.rb#7 def details; end # source://actionview//lib/action_view/unbound_template.rb#8 - def format(*_arg0, &_arg1); end + def format(*_arg0, **_arg1, &_arg2); end # source://actionview//lib/action_view/unbound_template.rb#8 - def handler(*_arg0, &_arg1); end + def handler(*_arg0, **_arg1, &_arg2); end # source://actionview//lib/action_view/unbound_template.rb#8 - def locale(*_arg0, &_arg1); end + def locale(*_arg0, **_arg1, &_arg2); end # source://actionview//lib/action_view/unbound_template.rb#8 - def variant(*_arg0, &_arg1); end + def variant(*_arg0, **_arg1, &_arg2); end # Returns the value of attribute virtual_path. # @@ -14268,10 +15875,10 @@ class ActionView::UnboundTemplate private - # source://actionview//lib/action_view/unbound_template.rb#39 + # source://actionview//lib/action_view/unbound_template.rb#49 def build_template(locals); end - # source://actionview//lib/action_view/unbound_template.rb#53 + # source://actionview//lib/action_view/unbound_template.rb#63 def normalize_locals(locals); end end @@ -14301,11 +15908,11 @@ module ActionView::ViewPaths # The prefixes used in render "foo" shortcuts. # - # source://actionview//lib/action_view/view_paths.rb#90 + # source://actionview//lib/action_view/view_paths.rb#81 def _prefixes; end # source://actionview//lib/action_view/view_paths.rb#11 - def any_templates?(*_arg0, &_arg1); end + def any_templates?(*_arg0, **_arg1, &_arg2); end # Append a path to the list of view paths for the current LookupContext. # @@ -14314,20 +15921,20 @@ module ActionView::ViewPaths # the default view path. You may also provide a custom view path # (see ActionView::PathSet for more information) # - # source://actionview//lib/action_view/view_paths.rb#112 + # source://actionview//lib/action_view/view_paths.rb#103 def append_view_path(path); end - # source://actionview//lib/action_view/view_paths.rb#102 + # source://actionview//lib/action_view/view_paths.rb#93 def details_for_lookup; end # source://actionview//lib/action_view/view_paths.rb#11 - def formats(*_arg0, &_arg1); end + def formats(*_arg0, **_arg1, &_arg2); end # source://actionview//lib/action_view/view_paths.rb#11 def formats=(arg); end # source://actionview//lib/action_view/view_paths.rb#11 - def locale(*_arg0, &_arg1); end + def locale(*_arg0, **_arg1, &_arg2); end # source://actionview//lib/action_view/view_paths.rb#11 def locale=(arg); end @@ -14336,7 +15943,7 @@ module ActionView::ViewPaths # information required for looking up templates, i.e. view paths and # details. Check ActionView::LookupContext for more information. # - # source://actionview//lib/action_view/view_paths.rb#97 + # source://actionview//lib/action_view/view_paths.rb#88 def lookup_context; end # Prepend a path to the list of view paths for the current LookupContext. @@ -14346,29 +15953,21 @@ module ActionView::ViewPaths # the default view path. You may also provide a custom view path # (see ActionView::PathSet for more information) # - # source://actionview//lib/action_view/view_paths.rb#122 + # source://actionview//lib/action_view/view_paths.rb#113 def prepend_view_path(path); end # source://actionview//lib/action_view/view_paths.rb#11 - def template_exists?(*_arg0, &_arg1); end + def template_exists?(*_arg0, **_arg1, &_arg2); end # source://actionview//lib/action_view/view_paths.rb#11 - def view_paths(*_arg0, &_arg1); end - - class << self - # source://actionview//lib/action_view/view_paths.rb#84 - def all_view_paths; end - - # source://actionview//lib/action_view/view_paths.rb#76 - def get_view_paths(klass); end - - # source://actionview//lib/action_view/view_paths.rb#80 - def set_view_paths(klass, paths); end - end + def view_paths(*_arg0, **_arg1, &_arg2); end end # source://actionview//lib/action_view/view_paths.rb#14 module ActionView::ViewPaths::ClassMethods + # source://actionview//lib/action_view/view_paths.rb#31 + def _build_view_paths(paths); end + # source://actionview//lib/action_view/view_paths.rb#23 def _prefixes; end @@ -14385,7 +15984,7 @@ module ActionView::ViewPaths::ClassMethods # the default view path. You may also provide a custom view path # (see ActionView::PathSet for more information) # - # source://actionview//lib/action_view/view_paths.rb#37 + # source://actionview//lib/action_view/view_paths.rb#44 def append_view_path(path); end # Prepend a path to the list of view paths for this controller. @@ -14395,12 +15994,12 @@ module ActionView::ViewPaths::ClassMethods # the default view path. You may also provide a custom view path # (see ActionView::PathSet for more information) # - # source://actionview//lib/action_view/view_paths.rb#47 + # source://actionview//lib/action_view/view_paths.rb#54 def prepend_view_path(path); end # A list of all of the default view paths for this controller. # - # source://actionview//lib/action_view/view_paths.rb#52 + # source://actionview//lib/action_view/view_paths.rb#59 def view_paths; end # Set the view paths. @@ -14409,7 +16008,7 @@ module ActionView::ViewPaths::ClassMethods # * paths - If a PathSet is provided, use that; # otherwise, process the parameter into a PathSet. # - # source://actionview//lib/action_view/view_paths.rb#61 + # source://actionview//lib/action_view/view_paths.rb#68 def view_paths=(paths); end private @@ -14417,17 +16016,19 @@ module ActionView::ViewPaths::ClassMethods # Override this method in your controller if you want to change paths prefixes for finding views. # Prefixes defined here will still be added to parents' ._prefixes. # - # source://actionview//lib/action_view/view_paths.rb#68 + # source://actionview//lib/action_view/view_paths.rb#75 def local_prefixes; end end -# source://actionview//lib/action_view/template/error.rb#13 +# source://actionview//lib/action_view/template/error.rb#14 class ActionView::WrongEncodingError < ::ActionView::EncodingError # @return [WrongEncodingError] a new instance of WrongEncodingError # - # source://actionview//lib/action_view/template/error.rb#14 + # source://actionview//lib/action_view/template/error.rb#15 def initialize(string, encoding); end - # source://actionview//lib/action_view/template/error.rb#18 + # source://actionview//lib/action_view/template/error.rb#19 def message; end end + +module ERB::Escape; end diff --git a/sorbet/rbi/gems/activejob@7.0.4.rbi b/sorbet/rbi/gems/activejob@7.0.4.rbi deleted file mode 100644 index 7a79a72..0000000 --- a/sorbet/rbi/gems/activejob@7.0.4.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `activejob` gem. -# Please instead update this file by running `bin/tapioca gem activejob`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/activemodel@7.0.4.rbi b/sorbet/rbi/gems/activemodel@7.0.4.rbi deleted file mode 100644 index 8ba1b8c..0000000 --- a/sorbet/rbi/gems/activemodel@7.0.4.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `activemodel` gem. -# Please instead update this file by running `bin/tapioca gem activemodel`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/activerecord@7.0.4.rbi b/sorbet/rbi/gems/activerecord@7.0.4.rbi deleted file mode 100644 index 14527c0..0000000 --- a/sorbet/rbi/gems/activerecord@7.0.4.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `activerecord` gem. -# Please instead update this file by running `bin/tapioca gem activerecord`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/activestorage@7.0.4.rbi b/sorbet/rbi/gems/activestorage@7.0.4.rbi deleted file mode 100644 index 811f2d0..0000000 --- a/sorbet/rbi/gems/activestorage@7.0.4.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `activestorage` gem. -# Please instead update this file by running `bin/tapioca gem activestorage`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/activesupport@7.0.4.rbi b/sorbet/rbi/gems/activesupport@8.1.2.rbi similarity index 67% rename from sorbet/rbi/gems/activesupport@7.0.4.rbi rename to sorbet/rbi/gems/activesupport@8.1.2.rbi index 52ab848..ae7ec95 100644 --- a/sorbet/rbi/gems/activesupport@7.0.4.rbi +++ b/sorbet/rbi/gems/activesupport@8.1.2.rbi @@ -4,124 +4,162 @@ # This is an autogenerated file for types exported from the `activesupport` gem. # Please instead update this file by running `bin/tapioca gem activesupport`. -# source://yard/0.9.28/lib/yard.rb#61 -::RUBY18 = T.let(T.unsafe(nil), FalseClass) -# source://yard/0.9.28/lib/yard.rb#62 -::RUBY19 = T.let(T.unsafe(nil), TrueClass) - -# source://activesupport//lib/active_support/lazy_load_hooks.rb#3 +# :include: ../README.rdoc +# +# source://activesupport//lib/active_support/delegation.rb#3 module ActiveSupport extend ::ActiveSupport::LazyLoadHooks extend ::ActiveSupport::Autoload + # source://activesupport//lib/active_support.rb#114 + def filter_parameters; end + + # source://activesupport//lib/active_support.rb#114 + def filter_parameters=(val); end + + # source://activesupport//lib/active_support.rb#106 + def parallelize_test_databases; end + + # source://activesupport//lib/active_support.rb#106 + def parallelize_test_databases=(val); end + # source://activesupport//lib/active_support/json/decoding.rb#9 def parse_json_times; end # source://activesupport//lib/active_support/json/decoding.rb#9 def parse_json_times=(val); end - # source://activesupport//lib/active_support.rb#94 + # source://activesupport//lib/active_support.rb#104 def test_order; end - # source://activesupport//lib/active_support.rb#94 + # source://activesupport//lib/active_support.rb#104 def test_order=(val); end - # source://activesupport//lib/active_support.rb#95 + # source://activesupport//lib/active_support.rb#105 def test_parallelization_threshold; end - # source://activesupport//lib/active_support.rb#95 + # source://activesupport//lib/active_support.rb#105 def test_parallelization_threshold=(val); end class << self - # source://activesupport//lib/active_support.rb#99 + # source://activesupport//lib/active_support.rb#116 def cache_format_version; end - # source://activesupport//lib/active_support.rb#103 + # source://activesupport//lib/active_support.rb#120 def cache_format_version=(value); end - # source://activesupport//lib/active_support.rb#88 + # source://activesupport//lib/active_support/deprecator.rb#4 + def deprecator; end + + # source://activesupport//lib/active_support.rb#98 def eager_load!; end - # source://activesupport//lib/active_support.rb#97 + # source://activesupport//lib/active_support.rb#109 def error_reporter; end - # source://activesupport//lib/active_support.rb#97 + # source://activesupport//lib/active_support.rb#109 def error_reporter=(_arg0); end # source://activesupport//lib/active_support/json/encoding.rb#8 - def escape_html_entities_in_json(*_arg0, &_arg1); end + def escape_html_entities_in_json(*_arg0, **_arg1, &_arg2); end # source://activesupport//lib/active_support/json/encoding.rb#8 def escape_html_entities_in_json=(arg); end - # Returns the currently loaded version of Active Support as a Gem::Version. + # source://activesupport//lib/active_support/json/encoding.rb#8 + def escape_js_separators_in_json(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/json/encoding.rb#8 + def escape_js_separators_in_json=(arg); end + + # source://activesupport//lib/active_support.rb#112 + def event_reporter; end + + # source://activesupport//lib/active_support.rb#112 + def event_reporter=(_arg0); end + + # source://activesupport//lib/active_support.rb#114 + def filter_parameters; end + + # source://activesupport//lib/active_support.rb#114 + def filter_parameters=(val); end + + # Returns the currently loaded version of Active Support as a +Gem::Version+. # # source://activesupport//lib/active_support/gem_version.rb#5 def gem_version; end # source://activesupport//lib/active_support/json/encoding.rb#8 - def json_encoder(*_arg0, &_arg1); end + def json_encoder(*_arg0, **_arg1, &_arg2); end # source://activesupport//lib/active_support/json/encoding.rb#8 def json_encoder=(arg); end + # source://activesupport//lib/active_support.rb#106 + def parallelize_test_databases; end + + # source://activesupport//lib/active_support.rb#106 + def parallelize_test_databases=(val); end + # source://activesupport//lib/active_support/json/decoding.rb#9 def parse_json_times; end # source://activesupport//lib/active_support/json/decoding.rb#9 def parse_json_times=(val); end - # source://activesupport//lib/active_support.rb#94 + # source://activesupport//lib/active_support.rb#104 def test_order; end - # source://activesupport//lib/active_support.rb#94 + # source://activesupport//lib/active_support.rb#104 def test_order=(val); end - # source://activesupport//lib/active_support.rb#95 + # source://activesupport//lib/active_support.rb#105 def test_parallelization_threshold; end - # source://activesupport//lib/active_support.rb#95 + # source://activesupport//lib/active_support.rb#105 def test_parallelization_threshold=(val); end # source://activesupport//lib/active_support/json/encoding.rb#8 - def time_precision(*_arg0, &_arg1); end + def time_precision(*_arg0, **_arg1, &_arg2); end # source://activesupport//lib/active_support/json/encoding.rb#8 def time_precision=(arg); end - # source://activesupport//lib/active_support.rb#107 + # source://activesupport//lib/active_support.rb#124 def to_time_preserves_timezone; end - # source://activesupport//lib/active_support.rb#111 + # source://activesupport//lib/active_support.rb#131 def to_time_preserves_timezone=(value); end # source://activesupport//lib/active_support/json/encoding.rb#8 - def use_standard_json_time_format(*_arg0, &_arg1); end + def use_standard_json_time_format(*_arg0, **_arg1, &_arg2); end # source://activesupport//lib/active_support/json/encoding.rb#8 def use_standard_json_time_format=(arg); end - # source://activesupport//lib/active_support.rb#115 + # source://activesupport//lib/active_support.rb#139 def utc_to_local_returns_utc_offset_times; end - # source://activesupport//lib/active_support.rb#119 + # source://activesupport//lib/active_support.rb#143 def utc_to_local_returns_utc_offset_times=(value); end - # Returns the currently loaded version of Active Support as a Gem::Version. + # Returns the currently loaded version of Active Support as a +Gem::Version+. # # source://activesupport//lib/active_support/version.rb#7 def version; end end end +# = Actionable Errors +# # Actionable errors lets you define actions to resolve an error. # -# To make an error actionable, include the ActiveSupport::ActionableError +# To make an error actionable, include the +ActiveSupport::ActionableError+ # module and invoke the +action+ class macro to define the action. An action # needs a name and a block to execute. # -# source://activesupport//lib/active_support/actionable_error.rb#9 +# source://activesupport//lib/active_support/actionable_error.rb#11 module ActiveSupport::ActionableError extend ::ActiveSupport::Concern include GeneratedInstanceMethods @@ -130,10 +168,10 @@ module ActiveSupport::ActionableError mixes_in_class_methods ::ActiveSupport::ActionableError::ClassMethods class << self - # source://activesupport//lib/active_support/actionable_error.rb#18 + # source://activesupport//lib/active_support/actionable_error.rb#20 def actions(error); end - # source://activesupport//lib/active_support/actionable_error.rb#27 + # source://activesupport//lib/active_support/actionable_error.rb#29 def dispatch(error, name); end end @@ -150,7 +188,7 @@ module ActiveSupport::ActionableError end end -# source://activesupport//lib/active_support/actionable_error.rb#33 +# source://activesupport//lib/active_support/actionable_error.rb#35 module ActiveSupport::ActionableError::ClassMethods # Defines an action that can resolve the error. # @@ -162,13 +200,15 @@ module ActiveSupport::ActionableError::ClassMethods # end # end # - # source://activesupport//lib/active_support/actionable_error.rb#43 + # source://activesupport//lib/active_support/actionable_error.rb#45 def action(name, &block); end end -# source://activesupport//lib/active_support/actionable_error.rb#12 +# source://activesupport//lib/active_support/actionable_error.rb#14 class ActiveSupport::ActionableError::NonActionable < ::StandardError; end +# = \Array Inquirer +# # Wrapping an array in an +ArrayInquirer+ gives a friendlier way to check # its string-like contents: # @@ -178,7 +218,7 @@ class ActiveSupport::ActionableError::NonActionable < ::StandardError; end # variants.tablet? # => true # variants.desktop? # => false # -# source://activesupport//lib/active_support/array_inquirer.rb#24 +# source://activesupport//lib/active_support/array_inquirer.rb#14 class ActiveSupport::ArrayInquirer < ::Array # Passes each element of +candidates+ collection to ArrayInquirer collection. # The method returns true if any element from the ArrayInquirer collection @@ -195,24 +235,26 @@ class ActiveSupport::ArrayInquirer < ::Array # # @return [Boolean] # - # source://activesupport//lib/active_support/array_inquirer.rb#25 + # source://activesupport//lib/active_support/array_inquirer.rb#27 def any?(*candidates); end private - # source://activesupport//lib/active_support/array_inquirer.rb#40 - def method_missing(name, *args); end + # source://activesupport//lib/active_support/array_inquirer.rb#42 + def method_missing(name, *_arg1, **_arg2, &_arg3); end # @return [Boolean] # - # source://activesupport//lib/active_support/array_inquirer.rb#36 + # source://activesupport//lib/active_support/array_inquirer.rb#38 def respond_to_missing?(name, include_private = T.unsafe(nil)); end end +# = Active Support \Autoload +# # Autoload and eager load conveniences for your library. # # This module allows you to define autoloads based on -# Rails conventions (i.e. no need to define the path +# \Rails conventions (i.e. no need to define the path # it is automatically guessed based on the filename) # and also define a set of constants that needs to be # eager loaded: @@ -231,32 +273,26 @@ end # # MyLib.eager_load! # -# source://activesupport//lib/active_support/dependencies/autoload.rb#27 +# source://activesupport//lib/active_support/dependencies/autoload.rb#29 module ActiveSupport::Autoload - # source://activesupport//lib/active_support/dependencies/autoload.rb#37 + # source://activesupport//lib/active_support/dependencies/autoload.rb#30 def autoload(const_name, path = T.unsafe(nil)); end - # source://activesupport//lib/active_support/dependencies/autoload.rb#57 + # source://activesupport//lib/active_support/dependencies/autoload.rb#51 def autoload_at(path); end - # source://activesupport//lib/active_support/dependencies/autoload.rb#50 + # source://activesupport//lib/active_support/dependencies/autoload.rb#44 def autoload_under(path); end - # source://activesupport//lib/active_support/dependencies/autoload.rb#75 - def autoloads; end - - # source://activesupport//lib/active_support/dependencies/autoload.rb#64 + # source://activesupport//lib/active_support/dependencies/autoload.rb#58 def eager_autoload; end - # source://activesupport//lib/active_support/dependencies/autoload.rb#71 + # source://activesupport//lib/active_support/dependencies/autoload.rb#65 def eager_load!; end - - class << self - # source://activesupport//lib/active_support/dependencies/autoload.rb#28 - def extended(base); end - end end +# = Backtrace Cleaner +# # Backtraces often include many lines that are not relevant for the context # under review. This makes it hard to find the signal amongst the backtrace # noise, and adds debugging time. With a BacktraceCleaner, filters and @@ -271,11 +307,12 @@ end # can focus on the rest. # # bc = ActiveSupport::BacktraceCleaner.new -# bc.add_filter { |line| line.gsub(Rails.root.to_s, '') } # strip the Rails.root prefix +# root = "#{Rails.root}/" +# bc.add_filter { |line| line.delete_prefix(root) } # strip the Rails.root prefix # bc.add_silencer { |line| /puma|rubygems/.match?(line) } # skip any lines from puma or rubygems # bc.clean(exception.backtrace) # perform the cleanup # -# To reconfigure an existing BacktraceCleaner (like the default one in Rails) +# To reconfigure an existing BacktraceCleaner (like the default one in \Rails) # and show as much data as possible, you can always call # BacktraceCleaner#remove_silencers!, which will restore the # backtrace to a pristine state. If you need to reconfigure an existing @@ -285,20 +322,21 @@ end # # Inspired by the Quiet Backtrace gem by thoughtbot. # -# source://activesupport//lib/active_support/backtrace_cleaner.rb#31 +# source://activesupport//lib/active_support/backtrace_cleaner.rb#34 class ActiveSupport::BacktraceCleaner # @return [BacktraceCleaner] a new instance of BacktraceCleaner # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#32 + # source://activesupport//lib/active_support/backtrace_cleaner.rb#35 def initialize; end # Adds a filter from the block provided. Each line in the backtrace will be # mapped against this filter. # - # # Will turn "/my/rails/root/app/models/person.rb" into "/app/models/person.rb" - # backtrace_cleaner.add_filter { |line| line.gsub(Rails.root, '') } + # # Will turn "/my/rails/root/app/models/person.rb" into "app/models/person.rb" + # root = "#{Rails.root}/" + # backtrace_cleaner.add_filter { |line| line.delete_prefix(root) } # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#60 + # source://activesupport//lib/active_support/backtrace_cleaner.rb#154 def add_filter(&block); end # Adds a silencer from the block provided. If the silencer returns +true+ @@ -307,59 +345,120 @@ class ActiveSupport::BacktraceCleaner # # Will reject all lines that include the word "puma", like "/gems/puma/server.rb" or "/app/my_puma_server/rb" # backtrace_cleaner.add_silencer { |line| /puma/.match?(line) } # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#69 + # source://activesupport//lib/active_support/backtrace_cleaner.rb#163 def add_silencer(&block); end # Returns the backtrace after all filters and silencers have been run # against it. Filters run first, then silencers. # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#41 + # source://activesupport//lib/active_support/backtrace_cleaner.rb#45 def clean(backtrace, kind = T.unsafe(nil)); end + # Returns the frame with all filters applied. + # returns +nil+ if the frame was silenced. + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#73 + def clean_frame(frame, kind = T.unsafe(nil)); end + + # Given an array of Thread::Backtrace::Location objects, returns an array + # with the clean ones: + # + # clean_locations = backtrace_cleaner.clean_locations(caller_locations) + # + # Filters and silencers receive strings as usual. However, the +path+ + # attributes of the locations in the returned array are the original, + # unfiltered ones, since locations are immutable. + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#67 + def clean_locations(locations, kind = T.unsafe(nil)); end + # Returns the backtrace after all filters and silencers have been run # against it. Filters run first, then silencers. # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#41 + # source://activesupport//lib/active_support/backtrace_cleaner.rb#57 def filter(backtrace, kind = T.unsafe(nil)); end + # Returns the first clean frame of the caller's backtrace, or +nil+. + # + # Frames are strings. + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#129 + def first_clean_frame(kind = T.unsafe(nil)); end + + # Returns the first clean location of the caller's call stack, or +nil+. + # + # Locations are Thread::Backtrace::Location objects. Since they are + # immutable, their +path+ attributes are the original ones, but filters + # are applied internally so silencers can still rely on them. + # + # source://activesupport//lib/active_support/backtrace_cleaner.rb#141 + def first_clean_location(kind = T.unsafe(nil)); end + # Removes all filters, but leaves in the silencers. Useful if you suddenly # need to see entire filepaths in the backtrace that you had already # filtered out. # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#83 + # source://activesupport//lib/active_support/backtrace_cleaner.rb#177 def remove_filters!; end # Removes all silencers, but leaves in the filters. Useful if your # context of debugging suddenly expands as you suspect a bug in one of # the libraries you use. # - # source://activesupport//lib/active_support/backtrace_cleaner.rb#76 + # source://activesupport//lib/active_support/backtrace_cleaner.rb#170 def remove_silencers!; end private - # source://activesupport//lib/active_support/backtrace_cleaner.rb#90 + # source://activesupport//lib/active_support/backtrace_cleaner.rb#198 + def add_core_silencer; end + + # source://activesupport//lib/active_support/backtrace_cleaner.rb#189 def add_gem_filter; end - # source://activesupport//lib/active_support/backtrace_cleaner.rb#99 + # source://activesupport//lib/active_support/backtrace_cleaner.rb#202 def add_gem_silencer; end - # source://activesupport//lib/active_support/backtrace_cleaner.rb#103 + # source://activesupport//lib/active_support/backtrace_cleaner.rb#206 def add_stdlib_silencer; end - # source://activesupport//lib/active_support/backtrace_cleaner.rb#107 + # source://activesupport//lib/active_support/backtrace_cleaner.rb#210 def filter_backtrace(backtrace); end - # source://activesupport//lib/active_support/backtrace_cleaner.rb#123 + # source://activesupport//lib/active_support/backtrace_cleaner.rb#184 + def initialize_copy(_other); end + + # source://activesupport//lib/active_support/backtrace_cleaner.rb#226 def noise(backtrace); end - # source://activesupport//lib/active_support/backtrace_cleaner.rb#115 + # source://activesupport//lib/active_support/backtrace_cleaner.rb#218 def silence(backtrace); end end -# source://activesupport//lib/active_support/backtrace_cleaner.rb#88 +# source://activesupport//lib/active_support/backtrace_cleaner.rb#182 ActiveSupport::BacktraceCleaner::FORMATTED_GEMS_PATTERN = T.let(T.unsafe(nil), Regexp) +# source://activesupport//lib/active_support/benchmark.rb#4 +module ActiveSupport::Benchmark + class << self + # Benchmark realtime in the specified time unit. By default, + # the returned unit is in seconds. + # + # ActiveSupport::Benchmark.realtime { sleep 0.1 } + # # => 0.10007 + # + # ActiveSupport::Benchmark.realtime(:float_millisecond) { sleep 0.1 } + # # => 100.07 + # + # `unit` can be any of the values accepted by Ruby's `Process.clock_gettime`. + # + # source://activesupport//lib/active_support/benchmark.rb#15 + def realtime(unit = T.unsafe(nil), &block); end + end +end + +# = \Benchmarkable +# # source://activesupport//lib/active_support/benchmarkable.rb#7 module ActiveSupport::Benchmarkable # Allows you to measure the execution time of a block in a template and @@ -402,9 +501,278 @@ module ActiveSupport::BigDecimalWithDefaultFormat def to_s(format = T.unsafe(nil)); end end +# = Active Support Broadcast Logger +# +# The Broadcast logger is a logger used to write messages to multiple IO. It is commonly used +# in development to display messages on STDOUT and also write them to a file (development.log). +# With the Broadcast logger, you can broadcast your logs to a unlimited number of sinks. +# +# The BroadcastLogger acts as a standard logger and all methods you are used to are available. +# However, all the methods on this logger will propagate and be delegated to the other loggers +# that are part of the broadcast. +# +# Broadcasting your logs. +# +# stdout_logger = Logger.new(STDOUT) +# file_logger = Logger.new("development.log") +# broadcast = BroadcastLogger.new(stdout_logger, file_logger) +# +# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file. +# +# Add a logger to the broadcast. +# +# stdout_logger = Logger.new(STDOUT) +# broadcast = BroadcastLogger.new(stdout_logger) +# file_logger = Logger.new("development.log") +# broadcast.broadcast_to(file_logger) +# +# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file. +# +# Modifying the log level for all broadcasted loggers. +# +# stdout_logger = Logger.new(STDOUT) +# file_logger = Logger.new("development.log") +# broadcast = BroadcastLogger.new(stdout_logger, file_logger) +# +# broadcast.level = Logger::FATAL # Modify the log level for the whole broadcast. +# +# Stop broadcasting log to a sink. +# +# stdout_logger = Logger.new(STDOUT) +# file_logger = Logger.new("development.log") +# broadcast = BroadcastLogger.new(stdout_logger, file_logger) +# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file. +# +# broadcast.stop_broadcasting_to(file_logger) +# broadcast.info("Hello world!") # Writes the log *only* to STDOUT. +# +# At least one sink has to be part of the broadcast. Otherwise, your logs will not +# be written anywhere. For instance: +# +# broadcast = BroadcastLogger.new +# broadcast.info("Hello world") # The log message will appear nowhere. +# +# If you are adding a custom logger with custom methods to the broadcast, +# the `BroadcastLogger` will proxy them and return the raw value, or an array +# of raw values, depending on how many loggers in the broadcasts responded to +# the method: +# +# class MyLogger < ::Logger +# def loggable? +# true +# end +# end +# +# logger = BroadcastLogger.new +# logger.loggable? # => A NoMethodError exception is raised because no loggers in the broadcasts could respond. +# +# logger.broadcast_to(MyLogger.new(STDOUT)) +# logger.loggable? # => true +# logger.broadcast_to(MyLogger.new(STDOUT)) +# puts logger.broadcasts # => [MyLogger, MyLogger] +# logger.loggable? # [true, true] +# +# source://activesupport//lib/active_support/broadcast_logger.rb#74 +class ActiveSupport::BroadcastLogger + include ::ActiveSupport::LoggerSilence + include ::ActiveSupport::LoggerThreadSafeLevel + + # @return [BroadcastLogger] a new instance of BroadcastLogger + # + # source://activesupport//lib/active_support/broadcast_logger.rb#81 + def initialize(*loggers); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def <<(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def add(*_arg0, **_arg1, &_arg2); end + + # Add logger(s) to the broadcast. + # + # broadcast_logger = ActiveSupport::BroadcastLogger.new + # broadcast_logger.broadcast_to(Logger.new(STDOUT), Logger.new(STDERR)) + # + # source://activesupport//lib/active_support/broadcast_logger.rb#92 + def broadcast_to(*loggers); end + + # Returns all the logger that are part of this broadcast. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#78 + def broadcasts; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def close(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def debug(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::DEBUG+ for the whole broadcast. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#146 + def debug!; end + + # True if the log level allows entries with severity +Logger::DEBUG+ to be written + # to at least one broadcast. False otherwise. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/broadcast_logger.rb#141 + def debug?; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def error(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::ERROR+ for the whole broadcast. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#179 + def error!; end + + # True if the log level allows entries with severity +Logger::ERROR+ to be written + # to at least one broadcast. False otherwise. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/broadcast_logger.rb#174 + def error?; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def fatal(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::FATAL+ for the whole broadcast. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#190 + def fatal!; end + + # True if the log level allows entries with severity +Logger::FATAL+ to be written + # to at least one broadcast. False otherwise. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/broadcast_logger.rb#185 + def fatal?; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def formatter(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def formatter=(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def info(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::INFO+ for the whole broadcast. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#157 + def info!; end + + # True if the log level allows entries with severity +Logger::INFO+ to be written + # to at least one broadcast. False otherwise. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/broadcast_logger.rb#152 + def info?; end + + # Returns the lowest level of all the loggers in the broadcast. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#135 + def level; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def level=(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#113 + def local_level; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#107 + def local_level=(level); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def log(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute progname. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#79 + def progname; end + + # Sets the attribute progname + # + # @param value the value to set the attribute progname to. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#79 + def progname=(_arg0); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def sev_threshold=(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#75 + def silencer; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#75 + def silencer=(val); end + + # Remove a logger from the broadcast. When a logger is removed, messages sent to + # the broadcast will no longer be written to its sink. + # + # sink = Logger.new(STDOUT) + # broadcast_logger = ActiveSupport::BroadcastLogger.new + # + # broadcast_logger.stop_broadcasting_to(sink) + # + # source://activesupport//lib/active_support/broadcast_logger.rb#103 + def stop_broadcasting_to(logger); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def unknown(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#127 + def warn(*_arg0, **_arg1, &_arg2); end + + # Sets the log level to +Logger::WARN+ for the whole broadcast. + # + # source://activesupport//lib/active_support/broadcast_logger.rb#168 + def warn!; end + + # True if the log level allows entries with severity +Logger::WARN+ to be written + # to at least one broadcast. False otherwise. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/broadcast_logger.rb#163 + def warn?; end + + private + + # source://activesupport//lib/active_support/broadcast_logger.rb#202 + def dispatch(method, *args, **kwargs, &block); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#194 + def initialize_copy(other); end + + # source://activesupport//lib/active_support/broadcast_logger.rb#222 + def method_missing(name, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/broadcast_logger.rb#234 + def respond_to_missing?(method, include_all); end + + class << self + # source://activesupport//lib/active_support/broadcast_logger.rb#75 + def silencer; end + + # source://activesupport//lib/active_support/broadcast_logger.rb#75 + def silencer=(val); end + end +end + +# source://activesupport//lib/active_support/broadcast_logger.rb#121 +ActiveSupport::BroadcastLogger::LOGGER_METHODS = T.let(T.unsafe(nil), Array) + # See ActiveSupport::Cache::Store for documentation. # -# source://activesupport//lib/active_support/cache.rb#16 +# source://activesupport//lib/active_support/cache/entry.rb#6 module ActiveSupport::Cache class << self # Expands out the +key+ argument into a key that can be used for the @@ -420,19 +788,19 @@ module ActiveSupport::Cache # # The +key+ argument can also respond to +cache_key+ or +to_param+. # - # source://activesupport//lib/active_support/cache.rb#100 + # source://activesupport//lib/active_support/cache.rb#113 def expand_cache_key(key, namespace = T.unsafe(nil)); end # Returns the value of attribute format_version. # - # source://activesupport//lib/active_support/cache.rb#41 + # source://activesupport//lib/active_support/cache.rb#60 def format_version; end # Sets the attribute format_version # # @param value the value to set the attribute format_version to. # - # source://activesupport//lib/active_support/cache.rb#41 + # source://activesupport//lib/active_support/cache.rb#60 def format_version=(_arg0); end # Creates a new Store object according to the given options. @@ -461,78 +829,127 @@ module ActiveSupport::Cache # ActiveSupport::Cache.lookup_store(MyOwnCacheStore.new) # # => returns MyOwnCacheStore.new # - # source://activesupport//lib/active_support/cache.rb#68 + # source://activesupport//lib/active_support/cache.rb#87 def lookup_store(store = T.unsafe(nil), *parameters); end private - # source://activesupport//lib/active_support/cache.rb#112 + # source://activesupport//lib/active_support/cache.rb#125 def retrieve_cache_key(key); end # Obtains the specified cache store class, given the name of the +store+. # Raises an error when the store class cannot be found. # - # source://activesupport//lib/active_support/cache.rb#124 + # source://activesupport//lib/active_support/cache.rb#137 def retrieve_store_class(store); end end end -# source://activesupport//lib/active_support/cache.rb#833 -module ActiveSupport::Cache::Coders - class << self - # source://activesupport//lib/active_support/cache.rb#839 - def [](version); end - end +# source://activesupport//lib/active_support/cache/coder.rb#7 +class ActiveSupport::Cache::Coder + # @return [Coder] a new instance of Coder + # + # source://activesupport//lib/active_support/cache/coder.rb#8 + def initialize(serializer, compressor, legacy_serializer: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/cache/coder.rb#14 + def dump(entry); end + + # source://activesupport//lib/active_support/cache/coder.rb#20 + def dump_compressed(entry, threshold); end + + # source://activesupport//lib/active_support/cache/coder.rb#48 + def load(dumped); end + + private + + # source://activesupport//lib/active_support/cache/coder.rb#136 + def dump_version(version); end + + # source://activesupport//lib/active_support/cache/coder.rb#144 + def load_version(dumped_version); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/coder.rb#121 + def signature?(dumped); end + + # source://activesupport//lib/active_support/cache/coder.rb#129 + def try_compress(string, threshold); end + + # source://activesupport//lib/active_support/cache/coder.rb#125 + def type_for_string(value); end end -# source://activesupport//lib/active_support/cache.rb#851 -module ActiveSupport::Cache::Coders::Loader - extend ::ActiveSupport::Cache::Coders::Loader +# source://activesupport//lib/active_support/cache/coder.rb#76 +ActiveSupport::Cache::Coder::COMPRESSED_FLAG = T.let(T.unsafe(nil), Integer) - # source://activesupport//lib/active_support/cache.rb#854 - def load(payload); end +# source://activesupport//lib/active_support/cache/coder.rb#98 +class ActiveSupport::Cache::Coder::LazyEntry < ::ActiveSupport::Cache::Entry + # @return [LazyEntry] a new instance of LazyEntry + # + # source://activesupport//lib/active_support/cache/coder.rb#99 + def initialize(serializer, compressor, payload, **options); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/coder.rb#114 + def mismatched?(version); end + + # source://activesupport//lib/active_support/cache/coder.rb#106 + def value; end end -# The one set by Marshal. -# -# source://activesupport//lib/active_support/cache.rb#834 -ActiveSupport::Cache::Coders::MARK_61 = T.let(T.unsafe(nil), String) +# source://activesupport//lib/active_support/cache/coder.rb#84 +ActiveSupport::Cache::Coder::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/cache.rb#836 -ActiveSupport::Cache::Coders::MARK_70_COMPRESSED = T.let(T.unsafe(nil), String) +# source://activesupport//lib/active_support/cache/coder.rb#68 +ActiveSupport::Cache::Coder::OBJECT_DUMP_TYPE = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/cache.rb#835 -ActiveSupport::Cache::Coders::MARK_70_UNCOMPRESSED = T.let(T.unsafe(nil), String) +# source://activesupport//lib/active_support/cache/coder.rb#80 +ActiveSupport::Cache::Coder::PACKED_EXPIRES_AT_TEMPLATE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/cache.rb#874 -module ActiveSupport::Cache::Coders::Rails61Coder - include ::ActiveSupport::Cache::Coders::Loader - extend ::ActiveSupport::Cache::Coders::Loader - extend ::ActiveSupport::Cache::Coders::Rails61Coder +# source://activesupport//lib/active_support/cache/coder.rb#78 +ActiveSupport::Cache::Coder::PACKED_TEMPLATE = T.let(T.unsafe(nil), String) - # source://activesupport//lib/active_support/cache.rb#878 - def dump(entry); end +# source://activesupport//lib/active_support/cache/coder.rb#79 +ActiveSupport::Cache::Coder::PACKED_TYPE_TEMPLATE = T.let(T.unsafe(nil), String) - # source://activesupport//lib/active_support/cache.rb#882 - def dump_compressed(entry, threshold); end -end +# source://activesupport//lib/active_support/cache/coder.rb#82 +ActiveSupport::Cache::Coder::PACKED_VERSION_INDEX = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/cache.rb#887 -module ActiveSupport::Cache::Coders::Rails70Coder - include ::ActiveSupport::Cache::Coders::Loader - extend ::ActiveSupport::Cache::Coders::Loader - extend ::ActiveSupport::Cache::Coders::Rails70Coder +# source://activesupport//lib/active_support/cache/coder.rb#81 +ActiveSupport::Cache::Coder::PACKED_VERSION_LENGTH_TEMPLATE = T.let(T.unsafe(nil), String) - # source://activesupport//lib/active_support/cache.rb#891 - def dump(entry); end +# source://activesupport//lib/active_support/cache/coder.rb#66 +ActiveSupport::Cache::Coder::SIGNATURE = T.let(T.unsafe(nil), String) - # source://activesupport//lib/active_support/cache.rb#895 - def dump_compressed(entry, threshold); end +# source://activesupport//lib/active_support/cache/coder.rb#96 +ActiveSupport::Cache::Coder::STRING_DESERIALIZERS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/cache/coder.rb#70 +ActiveSupport::Cache::Coder::STRING_ENCODINGS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/cache/coder.rb#86 +class ActiveSupport::Cache::Coder::StringDeserializer + # @return [StringDeserializer] a new instance of StringDeserializer + # + # source://activesupport//lib/active_support/cache/coder.rb#87 + def initialize(encoding); end + + # source://activesupport//lib/active_support/cache/coder.rb#91 + def load(payload); end end -# source://activesupport//lib/active_support/cache.rb#27 +# source://activesupport//lib/active_support/cache.rb#47 ActiveSupport::Cache::DEFAULT_COMPRESS_LIMIT = T.let(T.unsafe(nil), Integer) +# Raised by coders when the cache entry can't be deserialized. +# This error is treated as a cache miss. +# +# source://activesupport//lib/active_support/cache.rb#51 +class ActiveSupport::Cache::DeserializationError < ::StandardError; end + # This class is used to represent cache entries. Cache entries have a value, an optional # expiration time, and an optional version. The expiration time is used to support the :race_condition_ttl option # on the cache. The version is used to support the :version option on the cache for rejecting @@ -541,34 +958,34 @@ ActiveSupport::Cache::DEFAULT_COMPRESS_LIMIT = T.let(T.unsafe(nil), Integer) # Since cache entries in most instances will be serialized, the internals of this class are highly optimized # using short instance variable names that are lazily defined. # -# source://activesupport//lib/active_support/cache.rb#916 +# source://activesupport//lib/active_support/cache/entry.rb#14 class ActiveSupport::Cache::Entry # Creates a new cache entry for the specified value. Options supported are # +:compressed+, +:version+, +:expires_at+ and +:expires_in+. # # @return [Entry] a new instance of Entry # - # source://activesupport//lib/active_support/cache.rb#927 + # source://activesupport//lib/active_support/cache/entry.rb#25 def initialize(value, compressed: T.unsafe(nil), version: T.unsafe(nil), expires_in: T.unsafe(nil), expires_at: T.unsafe(nil), **_arg5); end # Returns the size of the cached value. This could be less than # value.bytesize if the data is compressed. # - # source://activesupport//lib/active_support/cache.rb#963 + # source://activesupport//lib/active_support/cache/entry.rb#61 def bytesize; end - # source://activesupport//lib/active_support/cache.rb#978 + # source://activesupport//lib/active_support/cache/entry.rb#76 def compressed(compress_threshold); end # @return [Boolean] # - # source://activesupport//lib/active_support/cache.rb#974 + # source://activesupport//lib/active_support/cache/entry.rb#72 def compressed?; end # Duplicates the value in a class. This is used by cache implementations that don't natively # serialize entries to protect against accidental cache modifications. # - # source://activesupport//lib/active_support/cache.rb#1008 + # source://activesupport//lib/active_support/cache/entry.rb#106 def dup_value!; end # Checks if the entry is expired. The +expires_in+ parameter can override @@ -576,140 +993,162 @@ class ActiveSupport::Cache::Entry # # @return [Boolean] # - # source://activesupport//lib/active_support/cache.rb#945 + # source://activesupport//lib/active_support/cache/entry.rb#43 def expired?; end - # source://activesupport//lib/active_support/cache.rb#949 + # source://activesupport//lib/active_support/cache/entry.rb#47 def expires_at; end - # source://activesupport//lib/active_support/cache.rb#953 + # source://activesupport//lib/active_support/cache/entry.rb#51 def expires_at=(value); end # @return [Boolean] # - # source://activesupport//lib/active_support/cache.rb#1002 + # source://activesupport//lib/active_support/cache/entry.rb#100 def local?; end # @return [Boolean] # - # source://activesupport//lib/active_support/cache.rb#939 + # source://activesupport//lib/active_support/cache/entry.rb#37 def mismatched?(version); end - # source://activesupport//lib/active_support/cache.rb#1018 + # source://activesupport//lib/active_support/cache/entry.rb#116 def pack; end - # source://activesupport//lib/active_support/cache.rb#935 + # source://activesupport//lib/active_support/cache/entry.rb#33 def value; end # Returns the value of attribute version. # - # source://activesupport//lib/active_support/cache.rb#923 + # source://activesupport//lib/active_support/cache/entry.rb#21 def version; end private - # source://activesupport//lib/active_support/cache.rb#1025 + # source://activesupport//lib/active_support/cache/entry.rb#127 + def marshal_load(payload); end + + # source://activesupport//lib/active_support/cache/entry.rb#123 def uncompress(value); end class << self - # source://activesupport//lib/active_support/cache.rb#918 + # source://activesupport//lib/active_support/cache/entry.rb#16 def unpack(members); end end end -# A cache store implementation which stores everything on the filesystem. +# = \File \Cache \Store # -# FileStore implements the Strategy::LocalCache strategy which implements -# an in-memory cache inside of a block. +# A cache store implementation which stores everything on the filesystem. # -# source://activesupport//lib/active_support/cache/file_store.rb#13 +# source://activesupport//lib/active_support/cache/file_store.rb#12 class ActiveSupport::Cache::FileStore < ::ActiveSupport::Cache::Store # @return [FileStore] a new instance of FileStore # - # source://activesupport//lib/active_support/cache/file_store.rb#21 + # source://activesupport//lib/active_support/cache/file_store.rb#20 def initialize(cache_path, **options); end # Returns the value of attribute cache_path. # - # source://activesupport//lib/active_support/cache/file_store.rb#14 + # source://activesupport//lib/active_support/cache/file_store.rb#13 def cache_path; end # Preemptively iterates through all stored keys and removes the ones which have expired. # - # source://activesupport//lib/active_support/cache/file_store.rb#41 + # source://activesupport//lib/active_support/cache/file_store.rb#40 def cleanup(options = T.unsafe(nil)); end # Deletes all items from the cache. In this case it deletes all the entries in the specified # file store directory except for .keep or .gitkeep. Be careful which directory is specified in your # config file when using +FileStore+ because everything in that directory will be deleted. # - # source://activesupport//lib/active_support/cache/file_store.rb#34 + # source://activesupport//lib/active_support/cache/file_store.rb#33 def clear(options = T.unsafe(nil)); end - # Decrements an already existing integer value that is stored in the cache. - # If the key is not found nothing is done. + # Decrement a cached integer value. Returns the updated value. # - # source://activesupport//lib/active_support/cache/file_store.rb#57 - def decrement(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + # If the key is unset, it will be set to +-amount+. + # + # cache.decrement("foo") # => -1 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.decrement("baz") # => 4 + # + # source://activesupport//lib/active_support/cache/file_store.rb#80 + def decrement(name, amount = T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/cache/file_store.rb#61 + # source://activesupport//lib/active_support/cache/file_store.rb#89 def delete_matched(matcher, options = T.unsafe(nil)); end - # Increments an already existing integer value that is stored in the cache. - # If the key is not found nothing is done. + # Increment a cached integer value. Returns the updated value. # - # source://activesupport//lib/active_support/cache/file_store.rb#51 - def increment(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + # If the key is unset, it starts from +0+: + # + # cache.increment("foo") # => 1 + # cache.increment("bar", 100) # => 100 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.increment("baz") # => 6 + # + # source://activesupport//lib/active_support/cache/file_store.rb#60 + def increment(name, amount = T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/cache/file_store.rb#101 + def inspect; end private # Delete empty directories in the cache. # - # source://activesupport//lib/active_support/cache/file_store.rb#160 + # source://activesupport//lib/active_support/cache/file_store.rb#195 def delete_empty_directories(dir); end - # source://activesupport//lib/active_support/cache/file_store.rb#98 + # source://activesupport//lib/active_support/cache/file_store.rb#131 def delete_entry(key, **options); end # Make sure a file path's directories exist. # - # source://activesupport//lib/active_support/cache/file_store.rb#169 + # source://activesupport//lib/active_support/cache/file_store.rb#204 def ensure_cache_path(path); end # Translate a file path into a key. # - # source://activesupport//lib/active_support/cache/file_store.rb#154 + # source://activesupport//lib/active_support/cache/file_store.rb#189 def file_path_key(path); end # Lock a file for a block so only one process can modify it at a time. # - # source://activesupport//lib/active_support/cache/file_store.rb#113 + # source://activesupport//lib/active_support/cache/file_store.rb#148 def lock_file(file_name, &block); end - # Modifies the amount of an already existing integer value that is stored in the cache. - # If the key is not found nothing is done. + # Modifies the amount of an integer value that is stored in the cache. + # If the key is not found it is created and set to +amount+. # - # source://activesupport//lib/active_support/cache/file_store.rb#187 + # source://activesupport//lib/active_support/cache/file_store.rb#222 def modify_value(name, amount, options); end # Translate a key into a file path. # - # source://activesupport//lib/active_support/cache/file_store.rb#127 + # source://activesupport//lib/active_support/cache/file_store.rb#162 def normalize_key(key, options); end - # source://activesupport//lib/active_support/cache/file_store.rb#73 + # source://activesupport//lib/active_support/cache/file_store.rb#106 def read_entry(key, **options); end - # source://activesupport//lib/active_support/cache/file_store.rb#80 + # source://activesupport//lib/active_support/cache/file_store.rb#113 def read_serialized_entry(key, **_arg1); end - # source://activesupport//lib/active_support/cache/file_store.rb#173 + # source://activesupport//lib/active_support/cache/file_store.rb#208 def search_dir(dir, &callback); end - # source://activesupport//lib/active_support/cache/file_store.rb#87 + # source://activesupport//lib/active_support/cache/file_store.rb#120 def write_entry(key, entry, **options); end - # source://activesupport//lib/active_support/cache/file_store.rb#91 + # source://activesupport//lib/active_support/cache/file_store.rb#124 def write_serialized_entry(key, payload, **options); end class << self @@ -717,31 +1156,33 @@ class ActiveSupport::Cache::FileStore < ::ActiveSupport::Cache::Store # # @return [Boolean] # - # source://activesupport//lib/active_support/cache/file_store.rb#27 + # source://activesupport//lib/active_support/cache/file_store.rb#26 def supports_cache_versioning?; end end end -# source://activesupport//lib/active_support/cache/file_store.rb#16 +# source://activesupport//lib/active_support/cache/file_store.rb#15 ActiveSupport::Cache::FileStore::DIR_FORMATTER = T.let(T.unsafe(nil), String) # max filename size on file system is 255, minus room for timestamp, pid, and random characters appended by Tempfile (used by atomic write) # -# source://activesupport//lib/active_support/cache/file_store.rb#17 +# source://activesupport//lib/active_support/cache/file_store.rb#16 ActiveSupport::Cache::FileStore::FILENAME_MAX_SIZE = T.let(T.unsafe(nil), Integer) # max is 1024, plus some room # -# source://activesupport//lib/active_support/cache/file_store.rb#18 +# source://activesupport//lib/active_support/cache/file_store.rb#17 ActiveSupport::Cache::FileStore::FILEPATH_MAX_SIZE = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/cache/file_store.rb#19 +# source://activesupport//lib/active_support/cache/file_store.rb#18 ActiveSupport::Cache::FileStore::GITKEEP_FILES = T.let(T.unsafe(nil), Array) +# = Memory \Cache \Store +# # A cache store implementation which stores everything into memory in the -# same process. If you're running multiple Ruby on Rails server processes +# same process. If you're running multiple Ruby on \Rails server processes # (which is the case if you're using Phusion Passenger or puma clustered mode), -# then this means that Rails server process instances won't be able +# then this means that \Rails server process instances won't be able # to share cache data with each other and this may not be the most # appropriate cache in that scenario. # @@ -750,86 +1191,107 @@ ActiveSupport::Cache::FileStore::GITKEEP_FILES = T.let(T.unsafe(nil), Array) # a cleanup will occur which tries to prune the cache down to three quarters # of the maximum size by removing the least recently used entries. # -# Unlike other Cache store implementations, MemoryStore does not compress -# values by default. MemoryStore does not benefit from compression as much +# Unlike other Cache store implementations, +MemoryStore+ does not compress +# values by default. +MemoryStore+ does not benefit from compression as much # as other Store implementations, as it does not send data over a network. # However, when compression is enabled, it still pays the full cost of # compression in terms of cpu use. # -# MemoryStore is thread-safe. +# +MemoryStore+ is thread-safe. # -# source://activesupport//lib/active_support/cache/memory_store.rb#26 +# source://activesupport//lib/active_support/cache/memory_store.rb#28 class ActiveSupport::Cache::MemoryStore < ::ActiveSupport::Cache::Store + include ::ActiveSupport::Cache::Strategy::LocalCache + # @return [MemoryStore] a new instance of MemoryStore # - # source://activesupport//lib/active_support/cache/memory_store.rb#48 + # source://activesupport//lib/active_support/cache/memory_store.rb#75 def initialize(options = T.unsafe(nil)); end # Preemptively iterates through all stored keys and removes the ones which have expired. # - # source://activesupport//lib/active_support/cache/memory_store.rb#75 + # source://activesupport//lib/active_support/cache/memory_store.rb#103 def cleanup(options = T.unsafe(nil)); end # Delete all data stored in a given cache store. # - # source://activesupport//lib/active_support/cache/memory_store.rb#67 + # source://activesupport//lib/active_support/cache/memory_store.rb#95 def clear(options = T.unsafe(nil)); end - # Decrement an integer value in the cache. + # Decrement a cached integer value. Returns the updated value. # - # source://activesupport//lib/active_support/cache/memory_store.rb#117 - def decrement(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + # If the key is unset or has expired, it will be set to +-amount+. + # + # cache.decrement("foo") # => -1 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.decrement("baz") # => 4 + # + # source://activesupport//lib/active_support/cache/memory_store.rb#168 + def decrement(name, amount = T.unsafe(nil), **options); end # Deletes cache entries if the cache key matches a given pattern. # - # source://activesupport//lib/active_support/cache/memory_store.rb#122 + # source://activesupport//lib/active_support/cache/memory_store.rb#175 def delete_matched(matcher, options = T.unsafe(nil)); end - # Increment an integer value in the cache. + # Increment a cached integer value. Returns the updated value. # - # source://activesupport//lib/active_support/cache/memory_store.rb#112 - def increment(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + # If the key is unset, it will be set to +amount+: + # + # cache.increment("foo") # => 1 + # cache.increment("bar", 100) # => 100 + # + # To set a specific value, call #write: + # + # cache.write("baz", 5) + # cache.increment("baz") # => 6 + # + # source://activesupport//lib/active_support/cache/memory_store.rb#151 + def increment(name, amount = T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/cache/memory_store.rb#133 + # source://activesupport//lib/active_support/cache/memory_store.rb#187 def inspect; end # To ensure entries fit within the specified memory prune the cache by removing the least # recently accessed entries. # - # source://activesupport//lib/active_support/cache/memory_store.rb#88 + # source://activesupport//lib/active_support/cache/memory_store.rb#116 def prune(target_size, max_time = T.unsafe(nil)); end # Returns true if the cache is currently being pruned. # # @return [Boolean] # - # source://activesupport//lib/active_support/cache/memory_store.rb#107 + # source://activesupport//lib/active_support/cache/memory_store.rb#135 def pruning?; end # Synchronize calls to the cache. This should be called wherever the underlying cache implementation # is not thread safe. # - # source://activesupport//lib/active_support/cache/memory_store.rb#139 + # source://activesupport//lib/active_support/cache/memory_store.rb#193 def synchronize(&block); end private - # source://activesupport//lib/active_support/cache/memory_store.rb#150 + # source://activesupport//lib/active_support/cache/memory_store.rb#200 def cached_size(key, payload); end - # source://activesupport//lib/active_support/cache/memory_store.rb#146 - def default_coder; end - - # source://activesupport//lib/active_support/cache/memory_store.rb#183 - def delete_entry(key, **options); end + # source://activesupport//lib/active_support/cache/memory_store.rb#233 + def delete_entry(key, **_arg1); end - # source://activesupport//lib/active_support/cache/memory_store.rb#191 - def modify_value(name, amount, options); end + # Modifies the amount of an integer value that is stored in the cache. + # If the key is not found it is created and set to +amount+. + # + # source://activesupport//lib/active_support/cache/memory_store.rb#243 + def modify_value(name, amount, **options); end - # source://activesupport//lib/active_support/cache/memory_store.rb#154 + # source://activesupport//lib/active_support/cache/memory_store.rb#204 def read_entry(key, **options); end - # source://activesupport//lib/active_support/cache/memory_store.rb#166 + # source://activesupport//lib/active_support/cache/memory_store.rb#216 def write_entry(key, entry, **options); end class << self @@ -837,42 +1299,41 @@ class ActiveSupport::Cache::MemoryStore < ::ActiveSupport::Cache::Store # # @return [Boolean] # - # source://activesupport//lib/active_support/cache/memory_store.rb#62 + # source://activesupport//lib/active_support/cache/memory_store.rb#90 def supports_cache_versioning?; end end end -# source://activesupport//lib/active_support/cache/memory_store.rb#27 +# source://activesupport//lib/active_support/cache/memory_store.rb#31 module ActiveSupport::Cache::MemoryStore::DupCoder extend ::ActiveSupport::Cache::MemoryStore::DupCoder - # source://activesupport//lib/active_support/cache/memory_store.rb#30 + # source://activesupport//lib/active_support/cache/memory_store.rb#34 def dump(entry); end - # source://activesupport//lib/active_support/cache/memory_store.rb#35 + # source://activesupport//lib/active_support/cache/memory_store.rb#42 def dump_compressed(entry, threshold); end - # source://activesupport//lib/active_support/cache/memory_store.rb#41 + # source://activesupport//lib/active_support/cache/memory_store.rb#47 def load(entry); end -end -# source://activesupport//lib/active_support/cache/memory_store.rb#144 -ActiveSupport::Cache::MemoryStore::PER_ENTRY_OVERHEAD = T.let(T.unsafe(nil), Integer) + private -# source://activesupport//lib/active_support/cache.rb#817 -module ActiveSupport::Cache::NullCoder - extend ::ActiveSupport::Cache::NullCoder + # source://activesupport//lib/active_support/cache/memory_store.rb#58 + def dump_value(value); end - # source://activesupport//lib/active_support/cache.rb#820 - def dump(entry); end + # source://activesupport//lib/active_support/cache/memory_store.rb#66 + def load_value(string); end +end - # source://activesupport//lib/active_support/cache.rb#824 - def dump_compressed(entry, threshold); end +# source://activesupport//lib/active_support/cache/memory_store.rb#56 +ActiveSupport::Cache::MemoryStore::DupCoder::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) - # source://activesupport//lib/active_support/cache.rb#828 - def load(payload); end -end +# source://activesupport//lib/active_support/cache/memory_store.rb#198 +ActiveSupport::Cache::MemoryStore::PER_ENTRY_OVERHEAD = T.let(T.unsafe(nil), Integer) +# = Null \Cache \Store +# # A cache store implementation which doesn't actually store anything. Useful in # development and test environments where you don't want caching turned on but # need to go through the caching interface. @@ -881,40 +1342,43 @@ end # be cached inside blocks that utilize this strategy. See # ActiveSupport::Cache::Strategy::LocalCache for more details. # -# source://activesupport//lib/active_support/cache/null_store.rb#12 +# source://activesupport//lib/active_support/cache/null_store.rb#14 class ActiveSupport::Cache::NullStore < ::ActiveSupport::Cache::Store include ::ActiveSupport::Cache::Strategy::LocalCache - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#81 - def cleanup(**options); end + # source://activesupport//lib/active_support/cache/null_store.rb#25 + def cleanup(options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#75 - def clear(**options); end + # source://activesupport//lib/active_support/cache/null_store.rb#22 + def clear(options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#100 + # source://activesupport//lib/active_support/cache/null_store.rb#31 def decrement(name, amount = T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#87 + # source://activesupport//lib/active_support/cache/null_store.rb#34 def delete_matched(matcher, options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#93 + # source://activesupport//lib/active_support/cache/null_store.rb#28 def increment(name, amount = T.unsafe(nil), **options); end + # source://activesupport//lib/active_support/cache/null_store.rb#37 + def inspect; end + private - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#147 + # source://activesupport//lib/active_support/cache/null_store.rb#57 def delete_entry(key, **_arg1); end - # source://activesupport//lib/active_support/cache/null_store.rb#36 + # source://activesupport//lib/active_support/cache/null_store.rb#42 def read_entry(key, **s); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#108 + # source://activesupport//lib/active_support/cache/null_store.rb#46 def read_serialized_entry(key, raw: T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/cache/null_store.rb#43 + # source://activesupport//lib/active_support/cache/null_store.rb#49 def write_entry(key, entry, **_arg2); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#138 + # source://activesupport//lib/active_support/cache/null_store.rb#53 def write_serialized_entry(key, payload, **_arg2); end class << self @@ -922,16 +1386,131 @@ class ActiveSupport::Cache::NullStore < ::ActiveSupport::Cache::Store # # @return [Boolean] # - # source://activesupport//lib/active_support/cache/null_store.rb#16 + # source://activesupport//lib/active_support/cache/null_store.rb#18 def supports_cache_versioning?; end end end # Mapping of canonical option names to aliases that a store will recognize. # -# source://activesupport//lib/active_support/cache.rb#30 +# source://activesupport//lib/active_support/cache.rb#43 ActiveSupport::Cache::OPTION_ALIASES = T.let(T.unsafe(nil), Hash) +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#8 +module ActiveSupport::Cache::SerializerWithFallback + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#17 + def load(dumped); end + + private + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#39 + def marshal_load(payload); end + + class << self + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#9 + def [](format); end + end +end + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#66 +module ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#88 + def _load(marked); end + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#73 + def dump(entry); end + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#77 + def dump_compressed(entry, threshold); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#94 + def dumped?(dumped); end +end + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#71 +ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback::MARK_COMPRESSED = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#70 +ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback::MARK_UNCOMPRESSED = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#99 +module ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#109 + def _load(dumped); end + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#105 + def dump(value); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#113 + def dumped?(dumped); end +end + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#103 +ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#118 +module ActiveSupport::Cache::SerializerWithFallback::MessagePackWithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::MessagePackWithFallback + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#126 + def _load(dumped); end + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#122 + def dump(value); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#130 + def dumped?(dumped); end + + private + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#135 + def available?; end +end + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#45 +module ActiveSupport::Cache::SerializerWithFallback::PassthroughWithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::PassthroughWithFallback + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#57 + def _load(entry); end + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#49 + def dump(entry); end + + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#53 + def dump_compressed(entry, threshold); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#61 + def dumped?(dumped); end +end + +# source://activesupport//lib/active_support/cache/serializer_with_fallback.rb#144 +ActiveSupport::Cache::SerializerWithFallback::SERIALIZERS = T.let(T.unsafe(nil), Hash) + +# = Active Support \Cache \Store +# # An abstract cache store class. There are multiple cache store # implementations, each having its own additional features. See the classes # under the ActiveSupport::Cache module, e.g. @@ -941,13 +1520,13 @@ ActiveSupport::Cache::OPTION_ALIASES = T.let(T.unsafe(nil), Hash) # Some implementations may not support all methods beyond the basic cache # methods of #fetch, #write, #read, #exist?, and #delete. # -# ActiveSupport::Cache::Store can store any Ruby object that is supported by -# its +coder+'s +dump+ and +load+ methods. +# +ActiveSupport::Cache::Store+ can store any Ruby object that is supported +# by its +coder+'s +dump+ and +load+ methods. # # cache = ActiveSupport::Cache::MemoryStore.new # # cache.read('city') # => nil -# cache.write('city', "Duckburgh") +# cache.write('city', "Duckburgh") # => true # cache.read('city') # => "Duckburgh" # # cache.write('not serializable', Proc.new {}) # => TypeError @@ -972,25 +1551,83 @@ ActiveSupport::Cache::OPTION_ALIASES = T.let(T.unsafe(nil), Hash) # cache.namespace = -> { @last_mod_time } # Set the namespace to a variable # @last_mod_time = Time.now # Invalidate the entire cache by changing namespace # -# source://activesupport//lib/active_support/cache.rb#175 +# source://activesupport//lib/active_support/cache.rb#190 class ActiveSupport::Cache::Store # Creates a new cache. # # ==== Options # - # * +:namespace+ - Sets the namespace for the cache. This option is - # especially useful if your application shares a cache with other - # applications. - # * +:coder+ - Replaces the default cache entry serialization mechanism - # with a custom one. The +coder+ must respond to +dump+ and +load+. - # Using a custom coder disables automatic compression. + # [+:namespace+] + # Sets the namespace for the cache. This option is especially useful if + # your application shares a cache with other applications. + # + # [+:serializer+] + # The serializer for cached values. Must respond to +dump+ and +load+. + # + # The default serializer depends on the cache format version (set via + # +config.active_support.cache_format_version+ when using Rails). The + # default serializer for each format version includes a fallback + # mechanism to deserialize values from any format version. This behavior + # makes it easy to migrate between format versions without invalidating + # the entire cache. + # + # You can also specify serializer: :message_pack to use a + # preconfigured serializer based on ActiveSupport::MessagePack. The + # +:message_pack+ serializer includes the same deserialization fallback + # mechanism, allowing easy migration from (or to) the default + # serializer. The +:message_pack+ serializer may improve performance, + # but it requires the +msgpack+ gem. + # + # [+:compressor+] + # The compressor for serialized cache values. Must respond to +deflate+ + # and +inflate+. + # + # The default compressor is +Zlib+. To define a new custom compressor + # that also decompresses old cache entries, you can check compressed + # values for Zlib's "\x78" signature: + # + # module MyCompressor + # def self.deflate(dumped) + # # compression logic... (make sure result does not start with "\x78"!) + # end + # + # def self.inflate(compressed) + # if compressed.start_with?("\x78") + # Zlib.inflate(compressed) + # else + # # decompression logic... + # end + # end + # end + # + # ActiveSupport::Cache.lookup_store(:redis_cache_store, compressor: MyCompressor) + # + # [+:coder+] + # The coder for serializing and (optionally) compressing cache entries. + # Must respond to +dump+ and +load+. + # + # The default coder composes the serializer and compressor, and includes + # some performance optimizations. If you only need to override the + # serializer or compressor, you should specify the +:serializer+ or + # +:compressor+ options instead. + # + # If the store can handle cache entries directly, you may also specify + # coder: nil to omit the serializer, compressor, and coder. For + # example, if you are using ActiveSupport::Cache::MemoryStore and can + # guarantee that cache values will not be mutated, you can specify + # coder: nil to avoid the overhead of safeguarding against + # mutation. + # + # The +:coder+ option is mutually exclusive with the +:serializer+ and + # +:compressor+ options. Specifying them together will raise an + # +ArgumentError+. # # Any other specified options are treated as default options for the # relevant cache operations, such as #read, #write, and #fetch. # # @return [Store] a new instance of Store # - # source://activesupport//lib/active_support/cache.rb#211 + # source://activesupport//lib/active_support/cache.rb#300 def initialize(options = T.unsafe(nil)); end # Cleans up the cache by removing expired entries. @@ -1001,7 +1638,7 @@ class ActiveSupport::Cache::Store # # @raise [NotImplementedError] # - # source://activesupport//lib/active_support/cache.rb#582 + # source://activesupport//lib/active_support/cache.rb#785 def cleanup(options = T.unsafe(nil)); end # Clears the entire cache. Be careful with this method since it could @@ -1013,7 +1650,7 @@ class ActiveSupport::Cache::Store # # @raise [NotImplementedError] # - # source://activesupport//lib/active_support/cache.rb#592 + # source://activesupport//lib/active_support/cache.rb#795 def clear(options = T.unsafe(nil)); end # Decrements an integer value in the cache. @@ -1024,14 +1661,15 @@ class ActiveSupport::Cache::Store # # @raise [NotImplementedError] # - # source://activesupport//lib/active_support/cache.rb#573 + # source://activesupport//lib/active_support/cache.rb#750 def decrement(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end - # Deletes an entry in the cache. Returns +true+ if an entry is deleted. + # Deletes an entry in the cache. Returns +true+ if an entry is deleted + # and +false+ otherwise. # # Options are passed to the underlying cache implementation. # - # source://activesupport//lib/active_support/cache.rb#514 + # source://activesupport//lib/active_support/cache.rb#686 def delete(name, options = T.unsafe(nil)); end # Deletes all entries with keys matching the pattern. @@ -1042,14 +1680,15 @@ class ActiveSupport::Cache::Store # # @raise [NotImplementedError] # - # source://activesupport//lib/active_support/cache.rb#555 + # source://activesupport//lib/active_support/cache.rb#732 def delete_matched(matcher, options = T.unsafe(nil)); end - # Deletes multiple entries in the cache. + # Deletes multiple entries in the cache. Returns the number of deleted + # entries. # # Options are passed to the underlying cache implementation. # - # source://activesupport//lib/active_support/cache.rb#525 + # source://activesupport//lib/active_support/cache.rb#699 def delete_multi(names, options = T.unsafe(nil)); end # Returns +true+ if the cache contains an entry for the given key. @@ -1058,7 +1697,7 @@ class ActiveSupport::Cache::Store # # @return [Boolean] # - # source://activesupport//lib/active_support/cache.rb#537 + # source://activesupport//lib/active_support/cache.rb#713 def exist?(name, options = T.unsafe(nil)); end # Fetches data from the cache, using the given key. If there is data in @@ -1081,8 +1720,8 @@ class ActiveSupport::Cache::Store # # ==== Options # - # Internally, +fetch+ calls #read_entry, and calls #write_entry on a cache - # miss. Thus, +fetch+ supports the same options as #read and #write. + # Internally, +fetch+ calls +read_entry+, and calls +write_entry+ on a + # cache miss. Thus, +fetch+ supports the same options as #read and #write. # Additionally, +fetch+ supports the following options: # # * force: true - Forces a cache "miss," meaning we treat the @@ -1121,34 +1760,62 @@ class ActiveSupport::Cache::Store # process can try to generate a new value after the extended time window # has elapsed. # - # # Set all values to expire after one minute. - # cache = ActiveSupport::Cache::MemoryStore.new(expires_in: 1.minute) + # # Set all values to expire after one second. + # cache = ActiveSupport::Cache::MemoryStore.new(expires_in: 1) # - # cache.write('foo', 'original value') + # cache.write("foo", "original value") # val_1 = nil # val_2 = nil - # sleep 60 + # p cache.read("foo") # => "original value" # - # Thread.new do - # val_1 = cache.fetch('foo', race_condition_ttl: 10.seconds) do + # sleep 1 # wait until the cache expires + # + # t1 = Thread.new do + # # fetch does the following: + # # 1. gets an recent expired entry + # # 2. extends the expiry by 2 seconds (race_condition_ttl) + # # 3. regenerates the new value + # val_1 = cache.fetch("foo", race_condition_ttl: 2) do # sleep 1 - # 'new value 1' + # "new value 1" # end # end # - # Thread.new do - # val_2 = cache.fetch('foo', race_condition_ttl: 10.seconds) do - # 'new value 2' - # end + # # Wait until t1 extends the expiry of the entry + # # but before generating the new value + # sleep 0.1 + # + # val_2 = cache.fetch("foo", race_condition_ttl: 2) do + # # This block won't be executed because t1 extended the expiry + # "new value 2" # end # - # cache.fetch('foo') # => "original value" - # sleep 10 # First thread extended the life of cache by another 10 seconds - # cache.fetch('foo') # => "new value 1" - # val_1 # => "new value 1" - # val_2 # => "original value" + # t1.join + # + # p val_1 # => "new value 1" + # p val_2 # => "original value" + # p cache.fetch("foo") # => "new value 1" # - # source://activesupport//lib/active_support/cache.rb#321 + # # The entry requires 3 seconds to expire (expires_in + race_condition_ttl) + # # We have waited 2 seconds already (sleep(1) + t1.join) thus we need to wait 1 + # # more second to see the entry expire. + # sleep 1 + # + # p cache.fetch("foo") # => nil + # + # ==== Dynamic Options + # + # In some cases it may be necessary to dynamically compute options based + # on the cached value. To support this, an ActiveSupport::Cache::WriteOptions + # instance is passed as the second argument to the block. For example: + # + # cache.fetch("authentication-token:#{user.id}") do |key, options| + # token = authenticate_to_service + # options.expires_at = token.expires_at + # token + # end + # + # source://activesupport//lib/active_support/cache.rb#452 def fetch(name, options = T.unsafe(nil), &block); end # Fetches data from the cache, using the given keys. If there is data in @@ -1168,7 +1835,8 @@ class ActiveSupport::Cache::Store # # => { "bim" => "bam", # # "unknown_key" => "Fallback value for key: unknown_key" } # - # Options are passed to the underlying cache implementation. For example: + # You may also specify additional options via the +options+ argument. See #fetch for details. + # Other options are passed to the underlying cache implementation. For example: # # cache.fetch_multi("fizz", expires_in: 5.seconds) do |key| # "buzz" @@ -1182,7 +1850,7 @@ class ActiveSupport::Cache::Store # # @raise [ArgumentError] # - # source://activesupport//lib/active_support/cache.rb#447 + # source://activesupport//lib/active_support/cache.rb#603 def fetch_multi(*names); end # Increments an integer value in the cache. @@ -1193,28 +1861,45 @@ class ActiveSupport::Cache::Store # # @raise [NotImplementedError] # - # source://activesupport//lib/active_support/cache.rb#564 + # source://activesupport//lib/active_support/cache.rb#741 def increment(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache.rb#176 + # source://activesupport//lib/active_support/cache.rb#197 def logger; end - # source://activesupport//lib/active_support/cache.rb#176 + # source://activesupport//lib/active_support/cache.rb#197 def logger=(val); end # Silences the logger within a block. # - # source://activesupport//lib/active_support/cache.rb#227 + # source://activesupport//lib/active_support/cache.rb#330 def mute; end - # source://activesupport//lib/active_support/cache.rb#546 + # Get the current namespace + # + # source://activesupport//lib/active_support/cache.rb#800 + def namespace; end + + # Set the current namespace. Note, this will be ignored if custom + # options are passed to cache wills with a namespace key. + # + # source://activesupport//lib/active_support/cache.rb#806 + def namespace=(namespace); end + + # source://activesupport//lib/active_support/cache.rb#723 def new_entry(value, options = T.unsafe(nil)); end # Returns the value of attribute options. # - # source://activesupport//lib/active_support/cache.rb#178 + # source://activesupport//lib/active_support/cache.rb#200 def options; end + # source://activesupport//lib/active_support/cache.rb#198 + def raise_on_invalid_cache_expiration_time; end + + # source://activesupport//lib/active_support/cache.rb#198 + def raise_on_invalid_cache_expiration_time=(val); end + # Reads data from the cache, using the given key. If there is data in # the cache with the given key, then that data is returned. Otherwise, # +nil+ is returned. @@ -1225,15 +1910,28 @@ class ActiveSupport::Cache::Store # # ==== Options # + # * +:namespace+ - Replace the store namespace for this call. # * +:version+ - Specifies a version for the cache entry. If the cached # version does not match the requested version, the read will be treated # as a cache miss. This feature is used to support recyclable cache keys. # # Other options will be handled by the specific cache store implementation. # - # source://activesupport//lib/active_support/cache.rb#362 + # source://activesupport//lib/active_support/cache.rb#506 def read(name, options = T.unsafe(nil)); end + # Reads a counter that was set by #increment / #decrement. + # + # cache.write_counter("foo", 1) + # cache.read_counter("foo") # => 1 + # cache.increment("foo") + # cache.read_counter("foo") # => 2 + # + # Options are passed to the underlying cache implementation. + # + # source://activesupport//lib/active_support/cache.rb#762 + def read_counter(name, **options); end + # Reads multiple values at once from the cache. Options can be passed # in the last argument. # @@ -1241,27 +1939,30 @@ class ActiveSupport::Cache::Store # # Returns a hash mapping the names provided to the values found. # - # source://activesupport//lib/active_support/cache.rb#395 + # source://activesupport//lib/active_support/cache.rb#544 def read_multi(*names); end # Returns the value of attribute silence. # - # source://activesupport//lib/active_support/cache.rb#178 + # source://activesupport//lib/active_support/cache.rb#200 def silence; end # Silences the logger. # - # source://activesupport//lib/active_support/cache.rb#221 + # source://activesupport//lib/active_support/cache.rb#324 def silence!; end # Returns the value of attribute silence. # - # source://activesupport//lib/active_support/cache.rb#178 + # source://activesupport//lib/active_support/cache.rb#201 def silence?; end # Writes the value to the cache with the key. The value must be supported # by the +coder+'s +dump+ and +load+ methods. # + # Returns +true+ if the write succeeded, +nil+ if there was an error talking + # to the cache backend, or +false+ if the write failed for another reason. + # # By default, cache entries larger than 1kB are compressed. Compression # allows more data to be stored in the same memory footprint, leading to # fewer cache evictions and higher hit rates. @@ -1291,68 +1992,96 @@ class ActiveSupport::Cache::Store # version, the read will be treated as a cache miss. This feature is # used to support recyclable cache keys. # + # * +:unless_exist+ - Prevents overwriting an existing cache entry. + # # Other options will be handled by the specific cache store implementation. # - # source://activesupport//lib/active_support/cache.rb#502 + # source://activesupport//lib/active_support/cache.rb#672 def write(name, value, options = T.unsafe(nil)); end + # Writes a counter that can then be modified by #increment / #decrement. + # + # cache.write_counter("foo", 1) + # cache.read_counter("foo") # => 1 + # cache.increment("foo") + # cache.read_counter("foo") # => 2 + # + # Options are passed to the underlying cache implementation. + # + # source://activesupport//lib/active_support/cache.rb#775 + def write_counter(name, value, **options); end + # Cache Storage API to write multiple values at once. # - # source://activesupport//lib/active_support/cache.rb#407 + # source://activesupport//lib/active_support/cache.rb#559 def write_multi(hash, options = T.unsafe(nil)); end private - # source://activesupport//lib/active_support/cache.rb#597 - def default_coder; end + # source://activesupport//lib/active_support/cache.rb#1074 + def _instrument(operation, multi: T.unsafe(nil), options: T.unsafe(nil), **payload, &block); end + + # source://activesupport//lib/active_support/cache.rb#811 + def default_serializer; end # Deletes an entry from the cache implementation. Subclasses must # implement this method. # # @raise [NotImplementedError] # - # source://activesupport//lib/active_support/cache.rb#674 + # source://activesupport//lib/active_support/cache.rb#897 def delete_entry(key, **options); end # Deletes multiples entries in the cache implementation. Subclasses MAY # implement this method. # - # source://activesupport//lib/active_support/cache.rb#680 + # source://activesupport//lib/active_support/cache.rb#903 def delete_multi_entries(entries, **options); end - # source://activesupport//lib/active_support/cache.rb#641 - def deserialize_entry(payload); end + # source://activesupport//lib/active_support/cache.rb#862 + def deserialize_entry(payload, **_arg1); end + + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/cache.rb#984 + def expand_and_namespace_key(key, options = T.unsafe(nil)); end # Expands key to be a consistent string value. Invokes +cache_key+ if # object responds to +cache_key+. Otherwise, +to_param+ method will be # called. If the key is a Hash, then keys will be sorted alphabetically. # - # source://activesupport//lib/active_support/cache.rb#747 + # source://activesupport//lib/active_support/cache.rb#1037 def expanded_key(key); end - # source://activesupport//lib/active_support/cache.rb#768 + # source://activesupport//lib/active_support/cache.rb#1058 def expanded_version(key); end - # source://activesupport//lib/active_support/cache.rb#802 + # source://activesupport//lib/active_support/cache.rb#1111 def get_entry_value(entry, name, options); end - # source://activesupport//lib/active_support/cache.rb#786 + # source://activesupport//lib/active_support/cache.rb#1095 def handle_expired_entry(entry, key, options); end - # source://activesupport//lib/active_support/cache.rb#776 - def instrument(operation, key, options = T.unsafe(nil)); end + # source://activesupport//lib/active_support/cache.rb#937 + def handle_invalid_expires_in(message); end + + # source://activesupport//lib/active_support/cache.rb#1066 + def instrument(operation, key, options = T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/cache.rb#1070 + def instrument_multi(operation, keys, options = T.unsafe(nil), &block); end # Adds the namespace defined in the options to a pattern designed to # match keys. Implementations that support delete_matched should call # this method to translate a pattern that matches names into one that # matches namespaced keys. # - # source://activesupport//lib/active_support/cache.rb#605 + # source://activesupport//lib/active_support/cache.rb#826 def key_matcher(pattern, options); end # Merges the default options with ones specific to a method call. # - # source://activesupport//lib/active_support/cache.rb#685 + # source://activesupport//lib/active_support/cache.rb#908 def merged_options(call_options); end # Prefix the key with a namespace string: @@ -1365,21 +2094,22 @@ class ActiveSupport::Cache::Store # namespace_key 'foo', namespace: -> { 'cache' } # # => 'cache:foo' # - # source://activesupport//lib/active_support/cache.rb#725 - def namespace_key(key, options = T.unsafe(nil)); end + # source://activesupport//lib/active_support/cache.rb#1012 + def namespace_key(key, call_options = T.unsafe(nil)); end - # Expands and namespaces the cache key. May be overridden by - # cache stores to do additional normalization. + # Expands, namespaces and truncates the cache key. + # Raises an exception when the key is +nil+ or an empty string. + # May be overridden by cache stores to do additional normalization. # - # source://activesupport//lib/active_support/cache.rb#712 + # source://activesupport//lib/active_support/cache.rb#979 def normalize_key(key, options = T.unsafe(nil)); end # Normalize aliased options to their canonical form # - # source://activesupport//lib/active_support/cache.rb#699 + # source://activesupport//lib/active_support/cache.rb#948 def normalize_options(options); end - # source://activesupport//lib/active_support/cache.rb#764 + # source://activesupport//lib/active_support/cache.rb#1054 def normalize_version(key, options = T.unsafe(nil)); end # Reads an entry from the cache implementation. Subclasses must implement @@ -1387,156 +2117,194 @@ class ActiveSupport::Cache::Store # # @raise [NotImplementedError] # - # source://activesupport//lib/active_support/cache.rb#622 + # source://activesupport//lib/active_support/cache.rb#843 def read_entry(key, **options); end # Reads multiple entries from the cache implementation. Subclasses MAY # implement this method. # - # source://activesupport//lib/active_support/cache.rb#647 + # source://activesupport//lib/active_support/cache.rb#870 def read_multi_entries(names, **options); end - # source://activesupport//lib/active_support/cache.rb#807 - def save_block_result_to_cache(name, options); end + # source://activesupport//lib/active_support/cache.rb#1116 + def save_block_result_to_cache(name, key, options); end - # source://activesupport//lib/active_support/cache.rb#632 + # source://activesupport//lib/active_support/cache.rb#853 def serialize_entry(entry, **options); end + # source://activesupport//lib/active_support/cache.rb#991 + def truncate_key(key); end + + # source://activesupport//lib/active_support/cache.rb#959 + def validate_options(options); end + # Writes an entry to the cache implementation. Subclasses must implement # this method. # # @raise [NotImplementedError] # - # source://activesupport//lib/active_support/cache.rb#628 + # source://activesupport//lib/active_support/cache.rb#849 def write_entry(key, entry, **options); end # Writes multiple entries to the cache implementation. Subclasses MAY # implement this method. # - # source://activesupport//lib/active_support/cache.rb#666 + # source://activesupport//lib/active_support/cache.rb#889 def write_multi_entries(hash, **options); end class << self - # source://activesupport//lib/active_support/cache.rb#176 + # source://activesupport//lib/active_support/cache.rb#197 def logger; end - # source://activesupport//lib/active_support/cache.rb#176 + # source://activesupport//lib/active_support/cache.rb#197 def logger=(val); end - private + # source://activesupport//lib/active_support/cache.rb#198 + def raise_on_invalid_cache_expiration_time; end - # source://activesupport//lib/active_support/cache.rb#190 - def ensure_connection_pool_added!; end + # source://activesupport//lib/active_support/cache.rb#198 + def raise_on_invalid_cache_expiration_time=(val); end - # source://activesupport//lib/active_support/cache.rb#183 + private + + # source://activesupport//lib/active_support/cache.rb#205 def retrieve_pool_options(options); end end end -# source://activesupport//lib/active_support/cache.rb#34 +# Default +ConnectionPool+ options +# +# source://activesupport//lib/active_support/cache.rb#192 +ActiveSupport::Cache::Store::DEFAULT_POOL_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Keys are truncated with the Active Support digest if they exceed the limit. +# +# source://activesupport//lib/active_support/cache.rb#195 +ActiveSupport::Cache::Store::MAX_KEY_SIZE = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/cache.rb#53 module ActiveSupport::Cache::Strategy; end +# = Local \Cache \Strategy +# # Caches that implement LocalCache will be backed by an in-memory cache for the # duration of a block. Repeated calls to the cache for the same key will hit the # in-memory cache for faster access. # -# source://activesupport//lib/active_support/cache/strategy/local_cache.rb#11 +# source://activesupport//lib/active_support/cache/strategy/local_cache.rb#13 module ActiveSupport::Cache::Strategy::LocalCache - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#81 - def cleanup(**options); end + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#98 + def cleanup(options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#75 - def clear(**options); end + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#92 + def clear(options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#100 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#117 def decrement(name, amount = T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#87 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#104 def delete_matched(matcher, options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#93 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#124 + def fetch_multi(*names, &block); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#110 def increment(name, amount = T.unsafe(nil), **options); end + # The current local cache. + # + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#82 + def local_cache; end + # Middleware class can be inserted as a Rack handler to be local cache for the # duration of request. # - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#69 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#88 def middleware; end + # Set a new local cache. + # + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#72 + def new_local_cache; end + + # Unset the current local cache. + # + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#77 + def unset_local_cache; end + # Use a local cache for the duration of block. # - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#63 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#67 def with_local_cache(&block); end private - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#170 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#230 def bypass_local_cache(&block); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#147 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#211 def delete_entry(key, **_arg1); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#166 - def local_cache; end - - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#162 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#226 def local_cache_key; end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#122 - def read_multi_entries(keys, **options); end + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#173 + def read_multi_entries(names, **options); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#108 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#159 def read_serialized_entry(key, raw: T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#174 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#234 def use_temporary_local_cache(temporary_cache); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#152 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#216 def write_cache_value(name, value, **options); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#138 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#202 def write_serialized_entry(key, payload, **_arg2); end end # Class for storing and registering the local caches. # -# source://activesupport//lib/active_support/cache/strategy/local_cache.rb#15 +# source://activesupport//lib/active_support/cache/strategy/local_cache.rb#17 module ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry extend ::ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#18 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#20 def cache_for(local_cache_key); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#23 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#25 def set_cache_for(local_cache_key, value); end end +# = Local \Cache \Store +# # Simple memory backed cache. This cache is not thread safe and is intended only # for serving as a temporary memory cache for a single thread. # -# source://activesupport//lib/active_support/cache/strategy/local_cache.rb#31 +# source://activesupport//lib/active_support/cache/strategy/local_cache.rb#35 class ActiveSupport::Cache::Strategy::LocalCache::LocalStore # @return [LocalStore] a new instance of LocalStore # - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#32 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#36 def initialize; end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#36 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#40 def clear(options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#53 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#57 def delete_entry(key); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#57 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#61 def fetch_entry(key); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#40 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#44 def read_entry(key); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#44 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#48 def read_multi_entries(keys); end - # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#48 + # source://activesupport//lib/active_support/cache/strategy/local_cache.rb#52 def write_entry(key, entry); end end @@ -1548,46 +2316,98 @@ end class ActiveSupport::Cache::Strategy::LocalCache::Middleware # @return [Middleware] a new instance of Middleware # - # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#16 - def initialize(name, local_cache_key); end + # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#17 + def initialize(name, cache); end - # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#27 - def call(env); end + # Returns the value of attribute cache. + # + # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#15 + def cache; end - # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#14 - def local_cache_key; end + # Sets the attribute cache + # + # @param value the value to set the attribute cache to. + # + # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#15 + def cache=(_arg0); end + + # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#28 + def call(env); end # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#14 def name; end - # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#22 + # source://activesupport//lib/active_support/cache/strategy/local_cache_middleware.rb#23 def new(app); end end # These options mean something to all cache implementations. Individual cache # implementations may support additional options. # -# source://activesupport//lib/active_support/cache.rb#25 +# source://activesupport//lib/active_support/cache.rb#26 ActiveSupport::Cache::UNIVERSAL_OPTIONS = T.let(T.unsafe(nil), Array) +# Enables the dynamic configuration of Cache entry options while ensuring +# that conflicting options are not both set. When a block is given to +# ActiveSupport::Cache::Store#fetch, the second argument will be an +# instance of +WriteOptions+. +# +# source://activesupport//lib/active_support/cache.rb#1132 +class ActiveSupport::Cache::WriteOptions + # @return [WriteOptions] a new instance of WriteOptions + # + # source://activesupport//lib/active_support/cache.rb#1133 + def initialize(options); end + + # source://activesupport//lib/active_support/cache.rb#1157 + def expires_at; end + + # Sets the Cache entry's +expires_at+ value. If an +expires_in+ option was + # previously set, this will unset it since +expires_at+ and +expires_in+ + # cannot both be set. + # + # source://activesupport//lib/active_support/cache.rb#1164 + def expires_at=(expires_at); end + + # source://activesupport//lib/active_support/cache.rb#1145 + def expires_in; end + + # Sets the Cache entry's +expires_in+ value. If an +expires_at+ option was + # previously set, this will unset it since +expires_in+ and +expires_at+ + # cannot both be set. + # + # source://activesupport//lib/active_support/cache.rb#1152 + def expires_in=(expires_in); end + + # source://activesupport//lib/active_support/cache.rb#1137 + def version; end + + # source://activesupport//lib/active_support/cache.rb#1141 + def version=(version); end +end + +# = Caching Key Generator +# # CachingKeyGenerator is a wrapper around KeyGenerator which allows users to avoid # re-executing the key generation process when it's called using the same +salt+ and # +key_size+. # -# source://activesupport//lib/active_support/key_generator.rb#47 +# source://activesupport//lib/active_support/key_generator.rb#55 class ActiveSupport::CachingKeyGenerator # @return [CachingKeyGenerator] a new instance of CachingKeyGenerator # - # source://activesupport//lib/active_support/key_generator.rb#48 + # source://activesupport//lib/active_support/key_generator.rb#56 def initialize(key_generator); end # Returns a derived key suitable for use. # - # source://activesupport//lib/active_support/key_generator.rb#54 + # source://activesupport//lib/active_support/key_generator.rb#62 def generate_key(*args); end end -# Callbacks are code hooks that are run at key points in an object's life cycle. +# = Active Support \Callbacks +# +# \Callbacks are code hooks that are run at key points in an object's life cycle. # The typical use case is to have a base class define a set of callbacks # relevant to the other functionality it supplies, so that subclasses can # install callbacks that enhance or modify the base functionality without @@ -1639,7 +2459,7 @@ end # - save # saved # -# source://activesupport//lib/active_support/callbacks.rb#63 +# source://activesupport//lib/active_support/callbacks.rb#65 module ActiveSupport::Callbacks extend ::ActiveSupport::Concern include GeneratedInstanceMethods @@ -1671,8 +2491,8 @@ module ActiveSupport::Callbacks # smoothly through and into the supplied block, we want as little evidence # as possible that we were here. # - # source://activesupport//lib/active_support/callbacks.rb#95 - def run_callbacks(kind); end + # source://activesupport//lib/active_support/callbacks.rb#97 + def run_callbacks(kind, type = T.unsafe(nil)); end private @@ -1680,28 +2500,26 @@ module ActiveSupport::Callbacks # This can be overridden in ActiveSupport::Callbacks implementors in order # to provide better debugging/logging. # - # source://activesupport//lib/active_support/callbacks.rb#147 + # source://activesupport//lib/active_support/callbacks.rb#150 def halted_callback_hook(filter, name); end module GeneratedClassMethods def __callbacks; end def __callbacks=(value); end - def __callbacks?; end end module GeneratedInstanceMethods def __callbacks; end - def __callbacks?; end end end -# source://activesupport//lib/active_support/callbacks.rb#71 +# source://activesupport//lib/active_support/callbacks.rb#73 ActiveSupport::Callbacks::CALLBACK_FILTER_TYPES = T.let(T.unsafe(nil), Array) # A future invocation of user-supplied code (either as a callback, # or a condition filter). # -# source://activesupport//lib/active_support/callbacks.rb#375 +# source://activesupport//lib/active_support/callbacks.rb#337 module ActiveSupport::Callbacks::CallTemplate class << self # Filters support: @@ -1713,69 +2531,69 @@ module ActiveSupport::Callbacks::CallTemplate # All of these objects are converted into a CallTemplate and handled # the same after this point. # - # source://activesupport//lib/active_support/callbacks.rb#533 + # source://activesupport//lib/active_support/callbacks.rb#495 def build(filter, callback); end end end -# source://activesupport//lib/active_support/callbacks.rb#434 +# source://activesupport//lib/active_support/callbacks.rb#396 class ActiveSupport::Callbacks::CallTemplate::InstanceExec0 # @return [InstanceExec0] a new instance of InstanceExec0 # - # source://activesupport//lib/active_support/callbacks.rb#435 + # source://activesupport//lib/active_support/callbacks.rb#397 def initialize(block); end - # source://activesupport//lib/active_support/callbacks.rb#439 + # source://activesupport//lib/active_support/callbacks.rb#401 def expand(target, value, block); end - # source://activesupport//lib/active_support/callbacks.rb#449 + # source://activesupport//lib/active_support/callbacks.rb#411 def inverted_lambda; end - # source://activesupport//lib/active_support/callbacks.rb#443 + # source://activesupport//lib/active_support/callbacks.rb#405 def make_lambda; end end -# source://activesupport//lib/active_support/callbacks.rb#456 +# source://activesupport//lib/active_support/callbacks.rb#418 class ActiveSupport::Callbacks::CallTemplate::InstanceExec1 # @return [InstanceExec1] a new instance of InstanceExec1 # - # source://activesupport//lib/active_support/callbacks.rb#457 + # source://activesupport//lib/active_support/callbacks.rb#419 def initialize(block); end - # source://activesupport//lib/active_support/callbacks.rb#461 + # source://activesupport//lib/active_support/callbacks.rb#423 def expand(target, value, block); end - # source://activesupport//lib/active_support/callbacks.rb#471 + # source://activesupport//lib/active_support/callbacks.rb#433 def inverted_lambda; end - # source://activesupport//lib/active_support/callbacks.rb#465 + # source://activesupport//lib/active_support/callbacks.rb#427 def make_lambda; end end -# source://activesupport//lib/active_support/callbacks.rb#478 +# source://activesupport//lib/active_support/callbacks.rb#440 class ActiveSupport::Callbacks::CallTemplate::InstanceExec2 # @return [InstanceExec2] a new instance of InstanceExec2 # - # source://activesupport//lib/active_support/callbacks.rb#479 + # source://activesupport//lib/active_support/callbacks.rb#441 def initialize(block); end # @raise [ArgumentError] # - # source://activesupport//lib/active_support/callbacks.rb#483 + # source://activesupport//lib/active_support/callbacks.rb#445 def expand(target, value, block); end - # source://activesupport//lib/active_support/callbacks.rb#495 + # source://activesupport//lib/active_support/callbacks.rb#457 def inverted_lambda; end - # source://activesupport//lib/active_support/callbacks.rb#488 + # source://activesupport//lib/active_support/callbacks.rb#450 def make_lambda; end end -# source://activesupport//lib/active_support/callbacks.rb#376 +# source://activesupport//lib/active_support/callbacks.rb#338 class ActiveSupport::Callbacks::CallTemplate::MethodCall # @return [MethodCall] a new instance of MethodCall # - # source://activesupport//lib/active_support/callbacks.rb#377 + # source://activesupport//lib/active_support/callbacks.rb#339 def initialize(method); end # Return the parts needed to make this call, with the given @@ -1792,253 +2610,262 @@ class ActiveSupport::Callbacks::CallTemplate::MethodCall # The actual invocation is left up to the caller to minimize # call stack pollution. # - # source://activesupport//lib/active_support/callbacks.rb#394 + # source://activesupport//lib/active_support/callbacks.rb#356 def expand(target, value, block); end - # source://activesupport//lib/active_support/callbacks.rb#404 + # source://activesupport//lib/active_support/callbacks.rb#366 def inverted_lambda; end - # source://activesupport//lib/active_support/callbacks.rb#398 + # source://activesupport//lib/active_support/callbacks.rb#360 def make_lambda; end end -# source://activesupport//lib/active_support/callbacks.rb#411 +# source://activesupport//lib/active_support/callbacks.rb#373 class ActiveSupport::Callbacks::CallTemplate::ObjectCall # @return [ObjectCall] a new instance of ObjectCall # - # source://activesupport//lib/active_support/callbacks.rb#412 + # source://activesupport//lib/active_support/callbacks.rb#374 def initialize(target, method); end - # source://activesupport//lib/active_support/callbacks.rb#417 + # source://activesupport//lib/active_support/callbacks.rb#379 def expand(target, value, block); end - # source://activesupport//lib/active_support/callbacks.rb#427 + # source://activesupport//lib/active_support/callbacks.rb#389 def inverted_lambda; end - # source://activesupport//lib/active_support/callbacks.rb#421 + # source://activesupport//lib/active_support/callbacks.rb#383 def make_lambda; end end -# source://activesupport//lib/active_support/callbacks.rb#503 +# source://activesupport//lib/active_support/callbacks.rb#465 class ActiveSupport::Callbacks::CallTemplate::ProcCall # @return [ProcCall] a new instance of ProcCall # - # source://activesupport//lib/active_support/callbacks.rb#504 + # source://activesupport//lib/active_support/callbacks.rb#466 def initialize(target); end - # source://activesupport//lib/active_support/callbacks.rb#508 + # source://activesupport//lib/active_support/callbacks.rb#470 def expand(target, value, block); end - # source://activesupport//lib/active_support/callbacks.rb#518 + # source://activesupport//lib/active_support/callbacks.rb#480 def inverted_lambda; end - # source://activesupport//lib/active_support/callbacks.rb#512 + # source://activesupport//lib/active_support/callbacks.rb#474 def make_lambda; end end -# source://activesupport//lib/active_support/callbacks.rb#280 +# source://activesupport//lib/active_support/callbacks.rb#231 class ActiveSupport::Callbacks::Callback # @return [Callback] a new instance of Callback # - # source://activesupport//lib/active_support/callbacks.rb#295 + # source://activesupport//lib/active_support/callbacks.rb#246 def initialize(name, filter, kind, options, chain_config); end # Wraps code with filter # - # source://activesupport//lib/active_support/callbacks.rb#330 + # source://activesupport//lib/active_support/callbacks.rb#300 def apply(callback_sequence); end # Returns the value of attribute chain_config. # - # source://activesupport//lib/active_support/callbacks.rb#293 + # source://activesupport//lib/active_support/callbacks.rb#244 def chain_config; end - # source://activesupport//lib/active_support/callbacks.rb#344 + # source://activesupport//lib/active_support/callbacks.rb#282 + def compiled; end + + # source://activesupport//lib/active_support/callbacks.rb#304 def current_scopes; end # @return [Boolean] # - # source://activesupport//lib/active_support/callbacks.rb#320 + # source://activesupport//lib/active_support/callbacks.rb#273 def duplicates?(other); end # Returns the value of attribute filter. # - # source://activesupport//lib/active_support/callbacks.rb#293 + # source://activesupport//lib/active_support/callbacks.rb#244 def filter; end # Returns the value of attribute kind. # - # source://activesupport//lib/active_support/callbacks.rb#292 + # source://activesupport//lib/active_support/callbacks.rb#243 def kind; end # Sets the attribute kind # # @param value the value to set the attribute kind to. # - # source://activesupport//lib/active_support/callbacks.rb#292 + # source://activesupport//lib/active_support/callbacks.rb#243 def kind=(_arg0); end # @return [Boolean] # - # source://activesupport//lib/active_support/callbacks.rb#316 + # source://activesupport//lib/active_support/callbacks.rb#269 def matches?(_kind, _filter); end - # source://activesupport//lib/active_support/callbacks.rb#304 + # source://activesupport//lib/active_support/callbacks.rb#257 def merge_conditional_options(chain, if_option:, unless_option:); end # Returns the value of attribute name. # - # source://activesupport//lib/active_support/callbacks.rb#292 + # source://activesupport//lib/active_support/callbacks.rb#243 def name; end # Sets the attribute name # # @param value the value to set the attribute name to. # - # source://activesupport//lib/active_support/callbacks.rb#292 + # source://activesupport//lib/active_support/callbacks.rb#243 def name=(_arg0); end private - # source://activesupport//lib/active_support/callbacks.rb#352 + # source://activesupport//lib/active_support/callbacks.rb#312 def check_conditionals(conditionals); end - # source://activesupport//lib/active_support/callbacks.rb#367 + # source://activesupport//lib/active_support/callbacks.rb#327 def conditions_lambdas; end class << self - # source://activesupport//lib/active_support/callbacks.rb#281 + # source://activesupport//lib/active_support/callbacks.rb#232 def build(chain, filter, kind, options); end end end -# source://activesupport//lib/active_support/callbacks.rb#349 +# source://activesupport//lib/active_support/callbacks.rb#309 ActiveSupport::Callbacks::Callback::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/callbacks.rb#603 +# source://activesupport//lib/active_support/callbacks.rb#568 class ActiveSupport::Callbacks::CallbackChain include ::Enumerable # @return [CallbackChain] a new instance of CallbackChain # - # source://activesupport//lib/active_support/callbacks.rb#608 + # source://activesupport//lib/active_support/callbacks.rb#573 def initialize(name, config); end - # source://activesupport//lib/active_support/callbacks.rb#654 + # source://activesupport//lib/active_support/callbacks.rb#633 def append(*callbacks); end - # source://activesupport//lib/active_support/callbacks.rb#633 + # source://activesupport//lib/active_support/callbacks.rb#601 def clear; end - # source://activesupport//lib/active_support/callbacks.rb#645 - def compile; end + # source://activesupport//lib/active_support/callbacks.rb#615 + def compile(type); end # Returns the value of attribute config. # - # source://activesupport//lib/active_support/callbacks.rb#606 + # source://activesupport//lib/active_support/callbacks.rb#571 def config; end - # source://activesupport//lib/active_support/callbacks.rb#628 + # source://activesupport//lib/active_support/callbacks.rb#595 def delete(o); end - # source://activesupport//lib/active_support/callbacks.rb#619 + # source://activesupport//lib/active_support/callbacks.rb#585 def each(&block); end # @return [Boolean] # - # source://activesupport//lib/active_support/callbacks.rb#621 + # source://activesupport//lib/active_support/callbacks.rb#587 def empty?; end - # source://activesupport//lib/active_support/callbacks.rb#620 + # source://activesupport//lib/active_support/callbacks.rb#586 def index(o); end - # source://activesupport//lib/active_support/callbacks.rb#623 + # source://activesupport//lib/active_support/callbacks.rb#589 def insert(index, o); end # Returns the value of attribute name. # - # source://activesupport//lib/active_support/callbacks.rb#606 + # source://activesupport//lib/active_support/callbacks.rb#571 def name; end - # source://activesupport//lib/active_support/callbacks.rb#658 + # source://activesupport//lib/active_support/callbacks.rb#637 def prepend(*callbacks); end protected # Returns the value of attribute chain. # - # source://activesupport//lib/active_support/callbacks.rb#663 + # source://activesupport//lib/active_support/callbacks.rb#642 def chain; end private - # source://activesupport//lib/active_support/callbacks.rb#666 + # source://activesupport//lib/active_support/callbacks.rb#645 def append_one(callback); end - # source://activesupport//lib/active_support/callbacks.rb#683 - def default_terminator; end - - # source://activesupport//lib/active_support/callbacks.rb#639 + # source://activesupport//lib/active_support/callbacks.rb#608 def initialize_copy(other); end - # source://activesupport//lib/active_support/callbacks.rb#672 + # source://activesupport//lib/active_support/callbacks.rb#652 def prepend_one(callback); end - # source://activesupport//lib/active_support/callbacks.rb#678 + # source://activesupport//lib/active_support/callbacks.rb#659 def remove_duplicates(callback); end end +# source://activesupport//lib/active_support/callbacks.rb#675 +ActiveSupport::Callbacks::CallbackChain::DEFAULT_TERMINATOR = T.let(T.unsafe(nil), ActiveSupport::Callbacks::CallbackChain::DefaultTerminator) + +# source://activesupport//lib/active_support/callbacks.rb#665 +class ActiveSupport::Callbacks::CallbackChain::DefaultTerminator + # source://activesupport//lib/active_support/callbacks.rb#666 + def call(target, result_lambda); end +end + # Execute before and after filters in a sequence instead of # chaining them with nested lambda calls, see: # https://github.com/rails/rails/issues/18011 # -# source://activesupport//lib/active_support/callbacks.rb#556 +# source://activesupport//lib/active_support/callbacks.rb#519 class ActiveSupport::Callbacks::CallbackSequence # @return [CallbackSequence] a new instance of CallbackSequence # - # source://activesupport//lib/active_support/callbacks.rb#557 + # source://activesupport//lib/active_support/callbacks.rb#520 def initialize(nested = T.unsafe(nil), call_template = T.unsafe(nil), user_conditions = T.unsafe(nil)); end - # source://activesupport//lib/active_support/callbacks.rb#571 - def after(&after); end + # source://activesupport//lib/active_support/callbacks.rb#535 + def after(after); end - # source://activesupport//lib/active_support/callbacks.rb#576 + # source://activesupport//lib/active_support/callbacks.rb#541 def around(call_template, user_conditions); end - # source://activesupport//lib/active_support/callbacks.rb#566 - def before(&before); end + # source://activesupport//lib/active_support/callbacks.rb#529 + def before(before); end - # source://activesupport//lib/active_support/callbacks.rb#590 + # source://activesupport//lib/active_support/callbacks.rb#555 def expand_call_template(arg, block); end # @return [Boolean] # - # source://activesupport//lib/active_support/callbacks.rb#586 + # source://activesupport//lib/active_support/callbacks.rb#551 def final?; end - # source://activesupport//lib/active_support/callbacks.rb#598 + # source://activesupport//lib/active_support/callbacks.rb#563 def invoke_after(arg); end - # source://activesupport//lib/active_support/callbacks.rb#594 + # source://activesupport//lib/active_support/callbacks.rb#559 def invoke_before(arg); end # Returns the value of attribute nested. # - # source://activesupport//lib/active_support/callbacks.rb#584 + # source://activesupport//lib/active_support/callbacks.rb#549 def nested; end # @return [Boolean] # - # source://activesupport//lib/active_support/callbacks.rb#580 + # source://activesupport//lib/active_support/callbacks.rb#545 def skip?(arg); end end -# source://activesupport//lib/active_support/callbacks.rb#695 +# source://activesupport//lib/active_support/callbacks.rb#678 module ActiveSupport::Callbacks::ClassMethods # This is used internally to append, prepend and skip callbacks to the # CallbackChain. # - # source://activesupport//lib/active_support/callbacks.rb#705 + # source://activesupport//lib/active_support/callbacks.rb#688 def __update_callbacks(name); end # Define sets of events in the object life cycle that support callbacks. @@ -2118,17 +2945,17 @@ module ActiveSupport::Callbacks::ClassMethods # !, ? or =. # # Calling +define_callbacks+ multiple times with the same +names+ will - # overwrite previous callbacks registered with +set_callback+. + # overwrite previous callbacks registered with #set_callback. # - # source://activesupport//lib/active_support/callbacks.rb#917 + # source://activesupport//lib/active_support/callbacks.rb#903 def define_callbacks(*names); end - # source://activesupport//lib/active_support/callbacks.rb#696 + # source://activesupport//lib/active_support/callbacks.rb#679 def normalize_callback_params(filters, block); end # Remove all set callbacks for the given event. # - # source://activesupport//lib/active_support/callbacks.rb#827 + # source://activesupport//lib/active_support/callbacks.rb#813 def reset_callbacks(name); end # Install a callback for the given event. @@ -2145,7 +2972,7 @@ module ActiveSupport::Callbacks::ClassMethods # # The callback can be specified as a symbol naming an instance method; as a # proc, lambda, or block; or as an object that responds to a certain method - # determined by the :scope argument to +define_callbacks+. + # determined by the :scope argument to #define_callbacks. # # If a proc, lambda, or block is given, its body is evaluated in the context # of the current object. It can also optionally accept the current object as @@ -2176,13 +3003,16 @@ module ActiveSupport::Callbacks::ClassMethods # * :prepend - If +true+, the callback will be prepended to the # existing chain rather than appended. # - # source://activesupport//lib/active_support/callbacks.rb#756 + # source://activesupport//lib/active_support/callbacks.rb#739 def set_callback(name, *filter_list, &block); end - # Skip a previously set callback. Like +set_callback+, :if or + # Skip a previously set callback. Like #set_callback, :if or # :unless options may be passed in order to control when the # callback is skipped. # + # Note: this example uses +PersonRecord+ and +#saving_message+, which you + # can see defined here[rdoc-ref:ActiveSupport::Callbacks] + # # class Writer < PersonRecord # attr_accessor :age # skip_callback :save, :before, :saving_message, if: -> { age > 18 } @@ -2212,78 +3042,121 @@ module ActiveSupport::Callbacks::ClassMethods # An ArgumentError will be raised if the callback has not # already been set (unless the :raise option is set to false). # - # source://activesupport//lib/active_support/callbacks.rb#802 + # source://activesupport//lib/active_support/callbacks.rb#788 def skip_callback(name, *filter_list, &block); end protected - # source://activesupport//lib/active_support/callbacks.rb#948 + # source://activesupport//lib/active_support/callbacks.rb#939 def get_callbacks(name); end - # source://activesupport//lib/active_support/callbacks.rb#952 + # source://activesupport//lib/active_support/callbacks.rb#943 def set_callbacks(name, callbacks); end end -# source://activesupport//lib/active_support/callbacks.rb#150 +# source://activesupport//lib/active_support/callbacks.rb#153 module ActiveSupport::Callbacks::Conditionals; end -# source://activesupport//lib/active_support/callbacks.rb#151 +# source://activesupport//lib/active_support/callbacks.rb#154 class ActiveSupport::Callbacks::Conditionals::Value # @return [Value] a new instance of Value # - # source://activesupport//lib/active_support/callbacks.rb#152 + # source://activesupport//lib/active_support/callbacks.rb#155 def initialize(&block); end - # source://activesupport//lib/active_support/callbacks.rb#155 + # source://activesupport//lib/active_support/callbacks.rb#158 def call(target, value); end end -# source://activesupport//lib/active_support/callbacks.rb#159 +# source://activesupport//lib/active_support/callbacks.rb#162 module ActiveSupport::Callbacks::Filters; end -# source://activesupport//lib/active_support/callbacks.rb#212 +# source://activesupport//lib/active_support/callbacks.rb#194 class ActiveSupport::Callbacks::Filters::After - class << self - # source://activesupport//lib/active_support/callbacks.rb#213 - def build(callback_sequence, user_callback, user_conditions, chain_config); end + # @return [After] a new instance of After + # + # source://activesupport//lib/active_support/callbacks.rb#196 + def initialize(user_callback, user_conditions, chain_config); end - private + # source://activesupport//lib/active_support/callbacks.rb#214 + def apply(callback_sequence); end - # source://activesupport//lib/active_support/callbacks.rb#255 - def conditional(callback_sequence, user_callback, user_conditions); end + # source://activesupport//lib/active_support/callbacks.rb#202 + def call(env); end - # source://activesupport//lib/active_support/callbacks.rb#244 - def halting(callback_sequence, user_callback); end + # Returns the value of attribute halting. + # + # source://activesupport//lib/active_support/callbacks.rb#195 + def halting; end - # source://activesupport//lib/active_support/callbacks.rb#229 - def halting_and_conditional(callback_sequence, user_callback, user_conditions); end + # Returns the value of attribute user_callback. + # + # source://activesupport//lib/active_support/callbacks.rb#195 + def user_callback; end - # source://activesupport//lib/active_support/callbacks.rb#269 - def simple(callback_sequence, user_callback); end - end + # Returns the value of attribute user_conditions. + # + # source://activesupport//lib/active_support/callbacks.rb#195 + def user_conditions; end end -# source://activesupport//lib/active_support/callbacks.rb#162 +# source://activesupport//lib/active_support/callbacks.rb#219 +class ActiveSupport::Callbacks::Filters::Around + # @return [Around] a new instance of Around + # + # source://activesupport//lib/active_support/callbacks.rb#220 + def initialize(user_callback, user_conditions); end + + # source://activesupport//lib/active_support/callbacks.rb#225 + def apply(callback_sequence); end +end + +# source://activesupport//lib/active_support/callbacks.rb#165 class ActiveSupport::Callbacks::Filters::Before - class << self - # source://activesupport//lib/active_support/callbacks.rb#163 - def build(callback_sequence, user_callback, user_conditions, chain_config, filter, name); end + # @return [Before] a new instance of Before + # + # source://activesupport//lib/active_support/callbacks.rb#166 + def initialize(user_callback, user_conditions, chain_config, filter, name); end - private + # source://activesupport//lib/active_support/callbacks.rb#189 + def apply(callback_sequence); end - # source://activesupport//lib/active_support/callbacks.rb#192 - def halting(callback_sequence, user_callback, halted_lambda, filter, name); end + # source://activesupport//lib/active_support/callbacks.rb#173 + def call(env); end - # source://activesupport//lib/active_support/callbacks.rb#173 - def halting_and_conditional(callback_sequence, user_callback, user_conditions, halted_lambda, filter, name); end - end + # Returns the value of attribute filter. + # + # source://activesupport//lib/active_support/callbacks.rb#171 + def filter; end + + # Returns the value of attribute halted_lambda. + # + # source://activesupport//lib/active_support/callbacks.rb#171 + def halted_lambda; end + + # Returns the value of attribute name. + # + # source://activesupport//lib/active_support/callbacks.rb#171 + def name; end + + # Returns the value of attribute user_callback. + # + # source://activesupport//lib/active_support/callbacks.rb#171 + def user_callback; end + + # Returns the value of attribute user_conditions. + # + # source://activesupport//lib/active_support/callbacks.rb#171 + def user_conditions; end end -# source://activesupport//lib/active_support/callbacks.rb#160 +# source://activesupport//lib/active_support/callbacks.rb#163 class ActiveSupport::Callbacks::Filters::Environment < ::Struct # Returns the value of attribute halted # # @return [Object] the current value of halted + # + # source://activesupport//lib/active_support/callbacks.rb#163 def halted; end # Sets the attribute halted @@ -2291,12 +3164,14 @@ class ActiveSupport::Callbacks::Filters::Environment < ::Struct # @param value [Object] the value to set the attribute halted to. # @return [Object] the newly set value # - # source://activesupport//lib/active_support/callbacks.rb#160 + # source://activesupport//lib/active_support/callbacks.rb#163 def halted=(_); end # Returns the value of attribute target # # @return [Object] the current value of target + # + # source://activesupport//lib/active_support/callbacks.rb#163 def target; end # Sets the attribute target @@ -2304,12 +3179,14 @@ class ActiveSupport::Callbacks::Filters::Environment < ::Struct # @param value [Object] the value to set the attribute target to. # @return [Object] the newly set value # - # source://activesupport//lib/active_support/callbacks.rb#160 + # source://activesupport//lib/active_support/callbacks.rb#163 def target=(_); end # Returns the value of attribute value # # @return [Object] the current value of value + # + # source://activesupport//lib/active_support/callbacks.rb#163 def value; end # Sets the attribute value @@ -2317,32 +3194,58 @@ class ActiveSupport::Callbacks::Filters::Environment < ::Struct # @param value [Object] the value to set the attribute value to. # @return [Object] the newly set value # - # source://activesupport//lib/active_support/callbacks.rb#160 + # source://activesupport//lib/active_support/callbacks.rb#163 def value=(_); end class << self + # source://activesupport//lib/active_support/callbacks.rb#163 def [](*_arg0); end + + # source://activesupport//lib/active_support/callbacks.rb#163 def inspect; end + + # source://activesupport//lib/active_support/callbacks.rb#163 + def keyword_init?; end + + # source://activesupport//lib/active_support/callbacks.rb#163 def members; end + + # source://activesupport//lib/active_support/callbacks.rb#163 def new(*_arg0); end end end +# source://activesupport//lib/active_support/class_attribute.rb#4 +module ActiveSupport::ClassAttribute + class << self + # source://activesupport//lib/active_support/class_attribute.rb#6 + def redefine(owner, name, namespaced_name, value); end + + # source://activesupport//lib/active_support/class_attribute.rb#26 + def redefine_method(owner, name, private: T.unsafe(nil), &block); end + end +end + # source://activesupport//lib/active_support/code_generator.rb#4 class ActiveSupport::CodeGenerator # @return [CodeGenerator] a new instance of CodeGenerator # - # source://activesupport//lib/active_support/code_generator.rb#48 + # source://activesupport//lib/active_support/code_generator.rb#53 def initialize(owner, path, line); end - # source://activesupport//lib/active_support/code_generator.rb#55 - def define_cached_method(name, namespace:, as: T.unsafe(nil), &block); end + # @yield [@sources] + # + # source://activesupport//lib/active_support/code_generator.rb#61 + def class_eval; end + + # source://activesupport//lib/active_support/code_generator.rb#65 + def define_cached_method(canonical_name, namespace:, as: T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/code_generator.rb#59 + # source://activesupport//lib/active_support/code_generator.rb#69 def execute; end class << self - # source://activesupport//lib/active_support/code_generator.rb#36 + # source://activesupport//lib/active_support/code_generator.rb#41 def batch(owner, path, line); end end end @@ -2354,11 +3257,11 @@ class ActiveSupport::CodeGenerator::MethodSet # source://activesupport//lib/active_support/code_generator.rb#8 def initialize(namespace); end - # source://activesupport//lib/active_support/code_generator.rb#25 + # source://activesupport//lib/active_support/code_generator.rb#28 def apply(owner, path, line); end - # source://activesupport//lib/active_support/code_generator.rb#14 - def define_cached_method(name, as: T.unsafe(nil)); end + # source://activesupport//lib/active_support/code_generator.rb#15 + def define_cached_method(canonical_name, as: T.unsafe(nil)); end end # source://activesupport//lib/active_support/code_generator.rb#6 @@ -2399,6 +3302,8 @@ module ActiveSupport::CompareWithRange def include?(value); end end +# = Active Support \Concern +# # A typical module looks like this: # # module M @@ -2414,7 +3319,7 @@ end # end # end # -# By using ActiveSupport::Concern the above module could instead be +# By using +ActiveSupport::Concern+ the above module could instead be # written as: # # require "active_support/concern" @@ -2471,7 +3376,7 @@ end # end # # Unfortunately this won't work, since when +Foo+ is included, its base -# is the +Bar+ module, not the +Host+ class. With ActiveSupport::Concern, +# is the +Bar+ module, not the +Host+ class. With +ActiveSupport::Concern+, # module dependencies are properly resolved: # # require "active_support/concern" @@ -2506,9 +3411,9 @@ end # # prepend is also used for any dependencies. # -# source://activesupport//lib/active_support/concern.rb#110 +# source://activesupport//lib/active_support/concern.rb#112 module ActiveSupport::Concern - # source://activesupport//lib/active_support/concern.rb#127 + # source://activesupport//lib/active_support/concern.rb#129 def append_features(base); end # Define class methods from given block. @@ -2532,82 +3437,62 @@ module ActiveSupport::Concern # Buzz.foo # => "foo" # Buzz.bar # => private method 'bar' called for Buzz:Class(NoMethodError) # - # source://activesupport//lib/active_support/concern.rb#207 + # source://activesupport//lib/active_support/concern.rb#209 def class_methods(&class_methods_module_definition); end # Evaluate given block in context of base class, # so that you can write class macros here. # When you define more than one +included+ block, it raises an exception. # - # source://activesupport//lib/active_support/concern.rb#156 + # source://activesupport//lib/active_support/concern.rb#158 def included(base = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/concern.rb#140 + # source://activesupport//lib/active_support/concern.rb#142 def prepend_features(base); end # Evaluate given block in context of base class, # so that you can write class macros here. # When you define more than one +prepended+ block, it raises an exception. # - # source://activesupport//lib/active_support/concern.rb#173 + # source://activesupport//lib/active_support/concern.rb#175 def prepended(base = T.unsafe(nil), &block); end class << self - # source://activesupport//lib/active_support/concern.rb#123 + # source://activesupport//lib/active_support/concern.rb#125 def extended(base); end end end -# source://activesupport//lib/active_support/concern.rb#111 +# source://activesupport//lib/active_support/concern.rb#113 class ActiveSupport::Concern::MultipleIncludedBlocks < ::StandardError # @return [MultipleIncludedBlocks] a new instance of MultipleIncludedBlocks # - # source://activesupport//lib/active_support/concern.rb#112 + # source://activesupport//lib/active_support/concern.rb#114 def initialize; end end -# source://activesupport//lib/active_support/concern.rb#117 +# source://activesupport//lib/active_support/concern.rb#119 class ActiveSupport::Concern::MultiplePrependBlocks < ::StandardError # @return [MultiplePrependBlocks] a new instance of MultiplePrependBlocks # - # source://activesupport//lib/active_support/concern.rb#118 + # source://activesupport//lib/active_support/concern.rb#120 def initialize; end end -# source://activesupport//lib/active_support/concurrency/share_lock.rb#7 +# source://activesupport//lib/active_support/concurrency/share_lock.rb#6 module ActiveSupport::Concurrency; end -# A monitor that will permit dependency loading while blocked waiting for -# the lock. -# -# source://activesupport//lib/active_support/concurrency/load_interlock_aware_monitor.rb#9 -class ActiveSupport::Concurrency::LoadInterlockAwareMonitor < ::Monitor - # Enters an exclusive section, but allows dependency loading while blocked - # - # source://activesupport//lib/active_support/concurrency/load_interlock_aware_monitor.rb#15 - def mon_enter; end - - # source://activesupport//lib/active_support/concurrency/load_interlock_aware_monitor.rb#20 - def synchronize(&block); end -end - -# source://activesupport//lib/active_support/concurrency/load_interlock_aware_monitor.rb#11 -ActiveSupport::Concurrency::LoadInterlockAwareMonitor::EXCEPTION_IMMEDIATE = T.let(T.unsafe(nil), Hash) - -# source://activesupport//lib/active_support/concurrency/load_interlock_aware_monitor.rb#10 -ActiveSupport::Concurrency::LoadInterlockAwareMonitor::EXCEPTION_NEVER = T.let(T.unsafe(nil), Hash) - -# A share/exclusive lock, otherwise known as a read/write lock. +# A share/exclusive lock, otherwise known as a read/write lock. # # https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock # -# source://activesupport//lib/active_support/concurrency/share_lock.rb#11 +# source://activesupport//lib/active_support/concurrency/share_lock.rb#10 class ActiveSupport::Concurrency::ShareLock include ::MonitorMixin # @return [ShareLock] a new instance of ShareLock # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#50 + # source://activesupport//lib/active_support/concurrency/share_lock.rb#49 def initialize; end # Execute the supplied block while holding the Exclusive lock. If @@ -2617,19 +3502,19 @@ class ActiveSupport::Concurrency::ShareLock # # See +start_exclusive+ for other options. # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#148 + # source://activesupport//lib/active_support/concurrency/share_lock.rb#147 def exclusive(purpose: T.unsafe(nil), compatible: T.unsafe(nil), after_compatible: T.unsafe(nil), no_wait: T.unsafe(nil)); end # We track Thread objects, instead of just using counters, because # we need exclusive locks to be reentrant, and we need to be able # to upgrade share locks to exclusive. # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#18 + # source://activesupport//lib/active_support/concurrency/share_lock.rb#17 def raw_state; end # Execute the supplied block while holding the Share lock. # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#159 + # source://activesupport//lib/active_support/concurrency/share_lock.rb#158 def sharing; end # Returns false if +no_wait+ is set and the lock is not @@ -2647,26 +3532,26 @@ class ActiveSupport::Concurrency::ShareLock # +purpose+ matching, it is possible to yield only to other # threads whose activity will not interfere. # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#76 + # source://activesupport//lib/active_support/concurrency/share_lock.rb#75 def start_exclusive(purpose: T.unsafe(nil), compatible: T.unsafe(nil), no_wait: T.unsafe(nil)); end - # source://activesupport//lib/active_support/concurrency/share_lock.rb#114 + # source://activesupport//lib/active_support/concurrency/share_lock.rb#113 def start_sharing; end # Relinquish the exclusive lock. Must only be called by the thread # that called start_exclusive (and currently holds the lock). # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#96 + # source://activesupport//lib/active_support/concurrency/share_lock.rb#95 def stop_exclusive(compatible: T.unsafe(nil)); end - # source://activesupport//lib/active_support/concurrency/share_lock.rb#131 + # source://activesupport//lib/active_support/concurrency/share_lock.rb#130 def stop_sharing; end # Temporarily give up all held Share locks while executing the # supplied block, allowing any +compatible+ exclusive lock request # to proceed. # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#171 + # source://activesupport//lib/active_support/concurrency/share_lock.rb#170 def yield_shares(purpose: T.unsafe(nil), compatible: T.unsafe(nil), block_share: T.unsafe(nil)); end private @@ -2675,27 +3560,29 @@ class ActiveSupport::Concurrency::ShareLock # # @return [Boolean] # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#204 + # source://activesupport//lib/active_support/concurrency/share_lock.rb#203 def busy_for_exclusive?(purpose); end # @return [Boolean] # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#209 + # source://activesupport//lib/active_support/concurrency/share_lock.rb#208 def busy_for_sharing?(purpose); end # @return [Boolean] # - # source://activesupport//lib/active_support/concurrency/share_lock.rb#214 + # source://activesupport//lib/active_support/concurrency/share_lock.rb#213 def eligible_waiters?(compatible); end - # source://activesupport//lib/active_support/concurrency/share_lock.rb#218 + # source://activesupport//lib/active_support/concurrency/share_lock.rb#217 def wait_for(method, &block); end end +# = Active Support \Configurable +# # Configurable provides a config method to store and retrieve # configuration options as an OrderedOptions. # -# source://activesupport//lib/active_support/configurable.rb#9 +# source://activesupport//lib/active_support/configurable.rb#17 module ActiveSupport::Configurable extend ::ActiveSupport::Concern @@ -2717,18 +3604,48 @@ module ActiveSupport::Configurable # user.config.allowed_access # => true # user.config.level # => 1 # - # source://activesupport//lib/active_support/configurable.rb#145 + # source://activesupport//lib/active_support/configurable.rb#189 def config; end end -# source://activesupport//lib/active_support/configurable.rb#27 +# source://activesupport//lib/active_support/configurable.rb#35 module ActiveSupport::Configurable::ClassMethods - # source://activesupport//lib/active_support/configurable.rb#28 + # Reads and writes attributes from a configuration OrderedOptions. + # + # require "active_support/configurable" + # + # class User + # include ActiveSupport::Configurable + # end + # + # User.config.allowed_access = true + # User.config.level = 1 + # + # User.config.allowed_access # => true + # User.config.level # => 1 + # + # source://activesupport//lib/active_support/configurable.rb#49 def config; end + # Configure values from within the passed block. + # + # require "active_support/configurable" + # + # class User + # include ActiveSupport::Configurable + # end + # + # User.allowed_access # => nil + # + # User.configure do |config| + # config.allowed_access = true + # end + # + # User.allowed_access # => true + # # @yield [config] # - # source://activesupport//lib/active_support/configurable.rb#37 + # source://activesupport//lib/active_support/configurable.rb#73 def configure; end private @@ -2802,19 +3719,22 @@ module ActiveSupport::Configurable::ClassMethods # User.allowed_access # => false # User.hair_colors # => [:brown, :black, :blonde, :red] # - # source://activesupport//lib/active_support/configurable.rb#109 + # source://activesupport//lib/active_support/configurable.rb#145 def config_accessor(*names, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/configurable.rb#166 + def inherited(subclass); end end -# source://activesupport//lib/active_support/configurable.rb#12 +# source://activesupport//lib/active_support/configurable.rb#20 class ActiveSupport::Configurable::Configuration < ::ActiveSupport::InheritableOptions - # source://activesupport//lib/active_support/configurable.rb#13 + # source://activesupport//lib/active_support/configurable.rb#21 def compile_methods!; end class << self # Compiles reader methods so we don't have to go through method_missing. # - # source://activesupport//lib/active_support/configurable.rb#18 + # source://activesupport//lib/active_support/configurable.rb#26 def compile_methods!(keys); end end end @@ -2837,10 +3757,10 @@ class ActiveSupport::ConfigurationFile private - # source://activesupport//lib/active_support/configuration_file.rb#35 + # source://activesupport//lib/active_support/configuration_file.rb#44 def read(content_path); end - # source://activesupport//lib/active_support/configuration_file.rb#46 + # source://activesupport//lib/active_support/configuration_file.rb#54 def render(context); end class << self @@ -2852,6 +3772,175 @@ end # source://activesupport//lib/active_support/configuration_file.rb#10 class ActiveSupport::ConfigurationFile::FormatError < ::StandardError; end +# Provides a DSL for declaring a continuous integration workflow that can be run either locally or in the cloud. +# Each step is timed, reports success/error, and is aggregated into a collective report that reports total runtime, +# as well as whether the entire run was successful or not. +# +# Example: +# +# ActiveSupport::ContinuousIntegration.run do +# step "Setup", "bin/setup --skip-server" +# step "Style: Ruby", "bin/rubocop" +# step "Security: Gem audit", "bin/bundler-audit" +# step "Tests: Rails", "bin/rails test test:system" +# +# if success? +# step "Signoff: Ready for merge and deploy", "gh signoff" +# else +# failure "Skipping signoff; CI failed.", "Fix the issues and try again." +# end +# end +# +# Starting with Rails 8.1, a default `bin/ci` and `config/ci.rb` file are created to provide out-of-the-box CI. +# +# source://activesupport//lib/active_support/continuous_integration.rb#24 +class ActiveSupport::ContinuousIntegration + # @return [ContinuousIntegration] a new instance of ContinuousIntegration + # + # source://activesupport//lib/active_support/continuous_integration.rb#64 + def initialize; end + + # Echo text to the terminal in the color corresponding to the type of the text. + # + # Examples: + # + # echo "This is going to be green!", type: :success + # echo "This is going to be red!", type: :error + # + # See ActiveSupport::ContinuousIntegration::COLORS for a complete list of options. + # + # source://activesupport//lib/active_support/continuous_integration.rb#111 + def echo(text, type:); end + + # Display an error heading with the title and optional subtitle to reflect that the run failed. + # + # source://activesupport//lib/active_support/continuous_integration.rb#86 + def failure(title, subtitle = T.unsafe(nil)); end + + # Display a colorized heading followed by an optional subtitle. + # + # Examples: + # + # heading "Smoke Testing", "End-to-end tests verifying key functionality", padding: false + # heading "Skipping video encoding tests", "Install FFmpeg to run these tests", type: :error + # + # See ActiveSupport::ContinuousIntegration::COLORS for a complete list of options. + # + # source://activesupport//lib/active_support/continuous_integration.rb#98 + def heading(heading, subtitle = T.unsafe(nil), type: T.unsafe(nil), padding: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/continuous_integration.rb#116 + def report(title, &block); end + + # Returns the value of attribute results. + # + # source://activesupport//lib/active_support/continuous_integration.rb#33 + def results; end + + # Declare a step with a title and a command. The command can either be given as a single string or as multiple + # strings that will be passed to `system` as individual arguments (and therefore correctly escaped for paths etc). + # + # Examples: + # + # step "Setup", "bin/setup" + # step "Single test", "bin/rails", "test", "--name", "test_that_is_one" + # + # source://activesupport//lib/active_support/continuous_integration.rb#75 + def step(title, *command); end + + # Returns true if all steps were successful. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/continuous_integration.rb#81 + def success?; end + + private + + # source://activesupport//lib/active_support/continuous_integration.rb#141 + def colorize(text, type); end + + # source://activesupport//lib/active_support/continuous_integration.rb#134 + def timing; end + + class << self + # Perform a CI run. Execute each step, show their results and runtime, and exit with a non-zero status if there are any failures. + # + # Pass an optional title, subtitle, and a block that declares the steps to be executed. + # + # Sets the CI environment variable to "true" to allow for conditional behavior in the app, like enabling eager loading and disabling logging. + # + # Example: + # + # ActiveSupport::ContinuousIntegration.run do + # step "Setup", "bin/setup --skip-server" + # step "Style: Ruby", "bin/rubocop" + # step "Security: Gem audit", "bin/bundler-audit" + # step "Tests: Rails", "bin/rails test test:system" + # + # if success? + # step "Signoff: Ready for merge and deploy", "gh signoff" + # else + # failure "Skipping signoff; CI failed.", "Fix the issues and try again." + # end + # end + # + # source://activesupport//lib/active_support/continuous_integration.rb#55 + def run(title = T.unsafe(nil), subtitle = T.unsafe(nil), &block); end + end +end + +# source://activesupport//lib/active_support/continuous_integration.rb#25 +ActiveSupport::ContinuousIntegration::COLORS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/core_ext/erb/util.rb#6 +module ActiveSupport::CoreExt; end + +# source://activesupport//lib/active_support/core_ext/erb/util.rb#7 +module ActiveSupport::CoreExt::ERBUtil + # A utility method for escaping HTML tag characters. + # This method is also aliased as h. + # + # puts html_escape('is a > 0 & a < 10?') + # # => is a > 0 & a < 10? + # + # source://activesupport//lib/active_support/core_ext/erb/util.rb#28 + def h(s); end + + # A utility method for escaping HTML tag characters. + # This method is also aliased as h. + # + # puts html_escape('is a > 0 & a < 10?') + # # => is a > 0 & a < 10? + # + # source://activesupport//lib/active_support/core_ext/erb/util.rb#10 + def html_escape(s); end + + # HTML escapes strings but doesn't wrap them with an ActiveSupport::SafeBuffer. + # This method is not for public consumption! Seriously! + # + # source://activesupport//lib/active_support/core_ext/erb/util.rb#18 + def unwrapped_html_escape(s); end +end + +# source://activesupport//lib/active_support/core_ext/erb/util.rb#31 +module ActiveSupport::CoreExt::ERBUtilPrivate + include ::ActiveSupport::CoreExt::ERBUtil + + private + + # source://activesupport//lib/active_support/core_ext/erb/util.rb#33 + def h(s); end + + # source://activesupport//lib/active_support/core_ext/erb/util.rb#33 + def html_escape(s); end + + # source://activesupport//lib/active_support/core_ext/erb/util.rb#33 + def unwrapped_html_escape(s); end +end + +# = Current Attributes +# # Abstract super class that provides a thread-isolated attributes singleton, which resets automatically # before and after each request. This allows you to keep all the per-request attributes easily # available to the whole system. @@ -2934,7 +4023,7 @@ class ActiveSupport::ConfigurationFile::FormatError < ::StandardError; end # The attributes stuck in Current should be used by more or less all actions on all requests. If you start # sticking controller-specific attributes in there, you're going to create a mess. # -# source://activesupport//lib/active_support/current_attributes.rb#89 +# source://activesupport//lib/active_support/current_attributes.rb#93 class ActiveSupport::CurrentAttributes include ::ActiveSupport::Callbacks extend ::ActiveSupport::Callbacks::ClassMethods @@ -2942,23 +4031,21 @@ class ActiveSupport::CurrentAttributes # @return [CurrentAttributes] a new instance of CurrentAttributes # - # source://activesupport//lib/active_support/current_attributes.rb#188 + # source://activesupport//lib/active_support/current_attributes.rb#186 def initialize; end - # source://activesupport//lib/active_support/callbacks.rb#68 + # source://activesupport//lib/active_support/current_attributes.rb#94 def __callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#68 - def __callbacks?; end - - # source://activesupport//lib/active_support/callbacks.rb#940 + # source://activesupport//lib/active_support/current_attributes.rb#95 def _reset_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#928 - def _run_reset_callbacks(&block); end + # source://activesupport//lib/active_support/current_attributes.rb#95 + def _run_reset_callbacks; end + + # source://activesupport//lib/active_support/current_attributes.rb#95 + def _run_reset_callbacks!(&block); end - # Returns the value of attribute attributes. - # # source://activesupport//lib/active_support/current_attributes.rb#186 def attributes; end @@ -2969,9 +4056,15 @@ class ActiveSupport::CurrentAttributes # source://activesupport//lib/active_support/current_attributes.rb#186 def attributes=(_arg0); end + # source://activesupport//lib/active_support/current_attributes.rb#186 + def defaults; end + + # source://activesupport//lib/active_support/current_attributes.rb#186 + def defaults?; end + # Reset all attributes. Should be called before and after actions, when used as a per-request singleton. # - # source://activesupport//lib/active_support/current_attributes.rb#211 + # source://activesupport//lib/active_support/current_attributes.rb#186 def reset; end # Expose one or more attributes within a block. Old values are returned after the block concludes. @@ -2985,83 +4078,113 @@ class ActiveSupport::CurrentAttributes # end # end # - # source://activesupport//lib/active_support/current_attributes.rb#202 - def set(set_attributes); end + # source://activesupport//lib/active_support/current_attributes.rb#186 + def set(attributes, &block); end private - # source://activesupport//lib/active_support/current_attributes.rb#218 - def assign_attributes(new_attributes); end - - # source://activesupport//lib/active_support/current_attributes.rb#222 - def compute_attributes(keys); end + # source://activesupport//lib/active_support/current_attributes.rb#186 + def resolve_defaults; end class << self - # source://activesupport//lib/active_support/callbacks.rb#68 + # source://activesupport//lib/active_support/current_attributes.rb#94 def __callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#68 + # source://activesupport//lib/active_support/current_attributes.rb#94 def __callbacks=(value); end - # source://activesupport//lib/active_support/callbacks.rb#68 - def __callbacks?; end - - # source://activesupport//lib/active_support/callbacks.rb#932 + # source://activesupport//lib/active_support/current_attributes.rb#95 def _reset_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#936 + # source://activesupport//lib/active_support/current_attributes.rb#95 def _reset_callbacks=(value); end - # Calls this block after #reset is called on the instance. Used for resetting external collaborators, like Time.zone. + # Calls this callback after #reset is called on the instance. Used for resetting external collaborators, like Time.zone. # - # source://activesupport//lib/active_support/current_attributes.rb#142 - def after_reset(&block); end + # source://activesupport//lib/active_support/current_attributes.rb#153 + def after_reset(*methods, &block); end # Declares one or more attributes that will be given both class and instance accessor methods. # - # source://activesupport//lib/active_support/current_attributes.rb#100 - def attribute(*names); end + # ==== Options + # + # * :default - The default value for the attributes. If the value + # is a proc or lambda, it will be called whenever an instance is + # constructed. Otherwise, the value will be duplicated with +#dup+. + # Default values are re-assigned when the attributes are reset. + # + # source://activesupport//lib/active_support/current_attributes.rb#115 + def attribute(*names, default: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/current_attributes.rb#197 + def attributes(&_arg0); end - # Calls this block before #reset is called on the instance. Used for resetting external collaborators that depend on current values. + # source://activesupport//lib/active_support/current_attributes.rb#197 + def attributes=(arg); end + + # Calls this callback before #reset is called on the instance. Used for resetting external collaborators that depend on current values. # - # source://activesupport//lib/active_support/current_attributes.rb#137 - def before_reset(&block); end + # source://activesupport//lib/active_support/current_attributes.rb#145 + def before_reset(*methods, &block); end - # source://activesupport//lib/active_support/current_attributes.rb#153 + # source://activesupport//lib/active_support/current_attributes.rb#157 def clear_all; end + # source://activesupport//lib/active_support/current_attributes.rb#201 + def defaults; end + + # source://activesupport//lib/active_support/current_attributes.rb#201 + def defaults=(value); end + + # source://activesupport//lib/active_support/current_attributes.rb#201 + def defaults?; end + # Returns singleton instance for this class in this thread. If none exists, one is created. # - # source://activesupport//lib/active_support/current_attributes.rb#95 + # source://activesupport//lib/active_support/current_attributes.rb#103 def instance; end - # source://activesupport//lib/active_support/current_attributes.rb#147 - def reset(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/current_attributes.rb#155 + def reset(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/current_attributes.rb#149 - def reset_all; end - - # Calls this block after #reset is called on the instance. Used for resetting external collaborators, like Time.zone. + # Calls this callback after #reset is called on the instance. Used for resetting external collaborators, like Time.zone. # - # source://activesupport//lib/active_support/current_attributes.rb#142 - def resets(&block); end + # source://activesupport//lib/active_support/current_attributes.rb#150 + def resets(*methods, &block); end - # source://activesupport//lib/active_support/current_attributes.rb#147 - def set(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/current_attributes.rb#155 + def set(*_arg0, **_arg1, &_arg2); end private - # source://activesupport//lib/active_support/current_attributes.rb#163 + # source://activesupport//lib/active_support/current_attributes.rb#94 + def __class_attr___callbacks; end + + # source://activesupport//lib/active_support/current_attributes.rb#94 + def __class_attr___callbacks=(new_value); end + + # source://activesupport//lib/active_support/current_attributes.rb#201 + def __class_attr_defaults; end + + # source://activesupport//lib/active_support/current_attributes.rb#201 + def __class_attr_defaults=(new_value); end + + # source://activesupport//lib/active_support/current_attributes.rb#169 def current_instances; end - # source://activesupport//lib/active_support/current_attributes.rb#167 + # source://activesupport//lib/active_support/current_attributes.rb#173 def current_instances_key; end - # source://activesupport//lib/active_support/current_attributes.rb#159 + # source://activesupport//lib/active_support/current_attributes.rb#165 def generated_attribute_methods; end - # source://activesupport//lib/active_support/current_attributes.rb#171 - def method_missing(name, *args, &block); end + # @private + # + # source://activesupport//lib/active_support/current_attributes.rb#185 + def method_added(name); end + + # source://activesupport//lib/active_support/current_attributes.rb#177 + def method_missing(name, *_arg1, **_arg2, &_arg3); end # @return [Boolean] # @@ -3070,37 +4193,116 @@ class ActiveSupport::CurrentAttributes end end +# source://activesupport//lib/active_support/current_attributes.rb#97 +ActiveSupport::CurrentAttributes::INVALID_ATTRIBUTE_NAMES = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/current_attributes.rb#99 +ActiveSupport::CurrentAttributes::NOT_SET = T.let(T.unsafe(nil), Object) + +# Provides +deep_merge+ and +deep_merge!+ methods. Expects the including class +# to provide a merge!(other, &block) method. +# +# source://activesupport//lib/active_support/deep_mergeable.rb#6 +module ActiveSupport::DeepMergeable + # Returns a new instance with the values from +other+ merged recursively. + # + # class Hash + # include ActiveSupport::DeepMergeable + # end + # + # hash_1 = { a: true, b: { c: [1, 2, 3] } } + # hash_2 = { a: false, b: { x: [3, 4, 5] } } + # + # hash_1.deep_merge(hash_2) + # # => { a: false, b: { c: [1, 2, 3], x: [3, 4, 5] } } + # + # A block can be provided to merge non-DeepMergeable values: + # + # hash_1 = { a: 100, b: 200, c: { c1: 100 } } + # hash_2 = { b: 250, c: { c1: 200 } } + # + # hash_1.deep_merge(hash_2) do |key, this_val, other_val| + # this_val + other_val + # end + # # => { a: 100, b: 450, c: { c1: 300 } } + # + # source://activesupport//lib/active_support/deep_mergeable.rb#29 + def deep_merge(other, &block); end + + # Same as #deep_merge, but modifies +self+. + # + # source://activesupport//lib/active_support/deep_mergeable.rb#34 + def deep_merge!(other, &block); end + + # Returns true if +other+ can be deep merged into +self+. Classes may + # override this method to restrict or expand the domain of deep mergeable + # values. Defaults to checking that +other+ is of type +self.class+. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/deep_mergeable.rb#49 + def deep_merge?(other); end +end + +# source://activesupport//lib/active_support/delegation.rb#14 +module ActiveSupport::Delegation + class << self + # source://activesupport//lib/active_support/delegation.rb#21 + def generate(owner, methods, location: T.unsafe(nil), to: T.unsafe(nil), prefix: T.unsafe(nil), allow_nil: T.unsafe(nil), nilable: T.unsafe(nil), private: T.unsafe(nil), as: T.unsafe(nil), signature: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/delegation.rb#150 + def generate_method_missing(owner, target, allow_nil: T.unsafe(nil)); end + end +end + +# source://activesupport//lib/active_support/delegation.rb#18 +ActiveSupport::Delegation::RESERVED_METHOD_NAMES = T.let(T.unsafe(nil), Set) + +# source://activesupport//lib/active_support/delegation.rb#15 +ActiveSupport::Delegation::RUBY_RESERVED_KEYWORDS = T.let(T.unsafe(nil), Array) + +# Error generated by +delegate+ when a method is called on +nil+ and +allow_nil+ +# option is not used. +# +# source://activesupport//lib/active_support/delegation.rb#6 +class ActiveSupport::DelegationError < ::NoMethodError + class << self + # source://activesupport//lib/active_support/delegation.rb#8 + def nil_target(method_name, target); end + end +end + # source://activesupport//lib/active_support/dependencies/interlock.rb#6 module ActiveSupport::Dependencies class << self - # source://activesupport//lib/active_support/dependencies.rb#62 + # source://activesupport//lib/active_support/dependencies.rb#66 def _autoloaded_tracked_classes; end - # source://activesupport//lib/active_support/dependencies.rb#62 + # source://activesupport//lib/active_support/dependencies.rb#66 def _autoloaded_tracked_classes=(_arg0); end - # source://activesupport//lib/active_support/dependencies.rb#56 + # source://activesupport//lib/active_support/dependencies.rb#60 def _eager_load_paths; end - # source://activesupport//lib/active_support/dependencies.rb#56 + # source://activesupport//lib/active_support/dependencies.rb#60 def _eager_load_paths=(_arg0); end - # source://activesupport//lib/active_support/dependencies.rb#49 + # source://activesupport//lib/active_support/dependencies.rb#53 def autoload_once_paths; end - # source://activesupport//lib/active_support/dependencies.rb#49 + # source://activesupport//lib/active_support/dependencies.rb#53 def autoload_once_paths=(_arg0); end - # source://activesupport//lib/active_support/dependencies.rb#43 + # source://activesupport//lib/active_support/dependencies.rb#47 def autoload_paths; end - # source://activesupport//lib/active_support/dependencies.rb#43 + # source://activesupport//lib/active_support/dependencies.rb#47 def autoload_paths=(_arg0); end - # source://activesupport//lib/active_support/dependencies.rb#69 + # source://activesupport//lib/active_support/dependencies.rb#73 def autoloader; end - # source://activesupport//lib/active_support/dependencies.rb#69 + # source://activesupport//lib/active_support/dependencies.rb#73 def autoloader=(_arg0); end # Private method that reloads constants autoloaded by the main autoloader. @@ -3109,45 +4311,45 @@ module ActiveSupport::Dependencies # reload. That involves more things, like deleting unloaded classes from the # internal state of the descendants tracker, or reloading routes. # - # source://activesupport//lib/active_support/dependencies.rb#76 + # source://activesupport//lib/active_support/dependencies.rb#80 def clear; end # Private method that helps configuring the autoloaders. # # @return [Boolean] # - # source://activesupport//lib/active_support/dependencies.rb#94 + # source://activesupport//lib/active_support/dependencies.rb#98 def eager_load?(path); end - # source://activesupport//lib/active_support/dependencies.rb#10 + # source://activesupport//lib/active_support/dependencies.rb#9 def interlock; end - # source://activesupport//lib/active_support/dependencies.rb#10 + # source://activesupport//lib/active_support/dependencies.rb#9 def interlock=(_arg0); end # Execute the supplied block while holding an exclusive lock, # preventing any other thread from being inside a #run_interlock # block at the same time. # - # source://activesupport//lib/active_support/dependencies.rb#24 + # source://activesupport//lib/active_support/dependencies.rb#23 def load_interlock(&block); end # Execute the supplied block without interference from any # concurrent loads. # - # source://activesupport//lib/active_support/dependencies.rb#17 + # source://activesupport//lib/active_support/dependencies.rb#16 def run_interlock(&block); end # Private method used by require_dependency. # - # source://activesupport//lib/active_support/dependencies.rb#84 + # source://activesupport//lib/active_support/dependencies.rb#88 def search_for_file(relpath); end # Execute the supplied block while holding an exclusive lock, # preventing any other thread from being inside a #run_interlock # block at the same time. # - # source://activesupport//lib/active_support/dependencies.rb#31 + # source://activesupport//lib/active_support/dependencies.rb#35 def unload_interlock(&block); end end end @@ -3159,31 +4361,31 @@ class ActiveSupport::Dependencies::Interlock # source://activesupport//lib/active_support/dependencies/interlock.rb#8 def initialize; end - # source://activesupport//lib/active_support/dependencies/interlock.rb#32 + # source://activesupport//lib/active_support/dependencies/interlock.rb#37 def done_running; end - # source://activesupport//lib/active_support/dependencies/interlock.rb#24 + # source://activesupport//lib/active_support/dependencies/interlock.rb#29 def done_unloading; end # source://activesupport//lib/active_support/dependencies/interlock.rb#12 def loading(&block); end - # source://activesupport//lib/active_support/dependencies/interlock.rb#40 + # source://activesupport//lib/active_support/dependencies/interlock.rb#45 def permit_concurrent_loads(&block); end - # source://activesupport//lib/active_support/dependencies/interlock.rb#44 + # source://activesupport//lib/active_support/dependencies/interlock.rb#50 def raw_state(&block); end - # source://activesupport//lib/active_support/dependencies/interlock.rb#36 + # source://activesupport//lib/active_support/dependencies/interlock.rb#41 def running(&block); end - # source://activesupport//lib/active_support/dependencies/interlock.rb#28 + # source://activesupport//lib/active_support/dependencies/interlock.rb#33 def start_running; end - # source://activesupport//lib/active_support/dependencies/interlock.rb#20 + # source://activesupport//lib/active_support/dependencies/interlock.rb#25 def start_unloading; end - # source://activesupport//lib/active_support/dependencies/interlock.rb#16 + # source://activesupport//lib/active_support/dependencies/interlock.rb#21 def unloading(&block); end end @@ -3201,38 +4403,42 @@ module ActiveSupport::Dependencies::RequireDependency def require_dependency(filename); end end -# source://activesupport//lib/active_support/core_ext/numeric/deprecated_conversions.rb#4 -module ActiveSupport::DeprecatedNumericWithFormat - # source://activesupport//lib/active_support/core_ext/numeric/deprecated_conversions.rb#5 - def to_s(format = T.unsafe(nil), options = T.unsafe(nil)); end -end - -# source://activesupport//lib/active_support/core_ext/range/deprecated_conversions.rb#4 -module ActiveSupport::DeprecatedRangeWithFormat - # source://activesupport//lib/active_support/deprecation/method_wrappers.rb#63 - def to_default_s(*args, &block); end - - # source://activesupport//lib/active_support/core_ext/range/deprecated_conversions.rb#6 - def to_s(format = T.unsafe(nil)); end -end - -# source://activesupport//lib/active_support/core_ext/range/deprecated_conversions.rb#5 -ActiveSupport::DeprecatedRangeWithFormat::NOT_SET = T.let(T.unsafe(nil), Object) - -# \Deprecation specifies the API used by Rails to deprecate methods, instance -# variables, objects, and constants. +# = Active Support \Deprecation +# +# \Deprecation specifies the API used by \Rails to deprecate methods, instance variables, objects, and constants. It's +# also available for gems or applications. +# +# For a gem, use Deprecation.new to create a Deprecation object and store it in your module or class (in order for +# users to be able to configure it). +# +# module MyLibrary +# def self.deprecator +# @deprecator ||= ActiveSupport::Deprecation.new("2.0", "MyLibrary") +# end +# end +# +# For a Railtie or Engine, you may also want to add it to the application's deprecators, so that the application's +# configuration can be applied to it. # -# source://activesupport//lib/active_support/deprecation.rb#8 +# module MyLibrary +# class Railtie < Rails::Railtie +# initializer "my_library.deprecator" do |app| +# app.deprecators[:my_library] = MyLibrary.deprecator +# end +# end +# end +# +# With the above initializer, configuration settings like the following will affect +MyLibrary.deprecator+: +# +# # in config/environments/test.rb +# config.active_support.deprecation = :raise +# +# source://activesupport//lib/active_support/deprecation.rb#33 class ActiveSupport::Deprecation - include ::Singleton - include ::ActiveSupport::Deprecation::InstanceDelegator include ::ActiveSupport::Deprecation::Behavior include ::ActiveSupport::Deprecation::Reporting include ::ActiveSupport::Deprecation::Disallowed include ::ActiveSupport::Deprecation::MethodWrapper - extend ::Singleton::SingletonClassMethods - extend ::ActiveSupport::Deprecation::InstanceDelegator::ClassMethods - extend ::ActiveSupport::Deprecation::InstanceDelegator::OverrideDelegators # It accepts two parameters on initialization. The first is a version of library # and the second is a library name. @@ -3241,76 +4447,22 @@ class ActiveSupport::Deprecation # # @return [Deprecation] a new instance of Deprecation # - # source://activesupport//lib/active_support/deprecation.rb#41 + # source://activesupport//lib/active_support/deprecation.rb#71 def initialize(deprecation_horizon = T.unsafe(nil), gem_name = T.unsafe(nil)); end # The version number in which the deprecated behavior will be removed, by default. # - # source://activesupport//lib/active_support/deprecation.rb#35 + # source://activesupport//lib/active_support/deprecation.rb#65 def deprecation_horizon; end # The version number in which the deprecated behavior will be removed, by default. # - # source://activesupport//lib/active_support/deprecation.rb#35 + # source://activesupport//lib/active_support/deprecation.rb#65 def deprecation_horizon=(_arg0); end class << self - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def allow(*_arg0, &_arg1); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def behavior(*_arg0, &_arg1); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def behavior=(arg); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def debug(*_arg0, &_arg1); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def debug=(arg); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def deprecate_methods(*_arg0, &_arg1); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def deprecation_horizon(*_arg0, &_arg1); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def deprecation_horizon=(arg); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#31 - def deprecation_warning(deprecated_method_name, message = T.unsafe(nil), caller_backtrace = T.unsafe(nil)); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def disallowed_behavior(*_arg0, &_arg1); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def disallowed_behavior=(arg); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def disallowed_warnings(*_arg0, &_arg1); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def disallowed_warnings=(arg); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def gem_name(*_arg0, &_arg1); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def gem_name=(arg); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def silence(*_arg0, &_arg1); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def silenced(*_arg0, &_arg1); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#21 - def silenced=(arg); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#26 - def warn(message = T.unsafe(nil), callstack = T.unsafe(nil)); end + # source://activesupport//lib/active_support/deprecation.rb#60 + def _instance; end end end @@ -3318,20 +4470,21 @@ end # You can create a custom behavior or set any from the +DEFAULT_BEHAVIORS+ # constant. Available behaviors are: # -# [+raise+] Raise ActiveSupport::DeprecationException. -# [+stderr+] Log all deprecation warnings to $stderr. -# [+log+] Log all deprecation warnings to +Rails.logger+. -# [+notify+] Use +ActiveSupport::Notifications+ to notify +deprecation.rails+. -# [+silence+] Do nothing. On Rails, set config.active_support.report_deprecations = false to disable all behaviors. +# [+:raise+] Raise ActiveSupport::DeprecationException. +# [+:stderr+] Log all deprecation warnings to $stderr. +# [+:log+] Log all deprecation warnings to +Rails.logger+. +# [+:notify+] Use ActiveSupport::Notifications to notify +deprecation.rails+. +# [+:report+] Use ActiveSupport::ErrorReporter to report deprecations. +# [+:silence+] Do nothing. On \Rails, set config.active_support.report_deprecations = false to disable all behaviors. # # Setting behaviors only affects deprecations that happen after boot time. -# For more information you can read the documentation of the +behavior=+ method. +# For more information you can read the documentation of the #behavior= method. # -# source://activesupport//lib/active_support/deprecation/behaviors.rb#61 +# source://activesupport//lib/active_support/deprecation/behaviors.rb#69 module ActiveSupport::Deprecation::Behavior # Returns the current behavior or if one isn't set, defaults to +:stderr+. # - # source://activesupport//lib/active_support/deprecation/behaviors.rb#66 + # source://activesupport//lib/active_support/deprecation/behaviors.rb#74 def behavior; end # Sets the behavior to the specified value. Can be a single value, array, @@ -3339,56 +4492,63 @@ module ActiveSupport::Deprecation::Behavior # # Available behaviors: # - # [+raise+] Raise ActiveSupport::DeprecationException. - # [+stderr+] Log all deprecation warnings to $stderr. - # [+log+] Log all deprecation warnings to +Rails.logger+. - # [+notify+] Use +ActiveSupport::Notifications+ to notify +deprecation.rails+. - # [+silence+] Do nothing. + # [+:raise+] Raise ActiveSupport::DeprecationException. + # [+:stderr+] Log all deprecation warnings to $stderr. + # [+:log+] Log all deprecation warnings to +Rails.logger+. + # [+:notify+] Use ActiveSupport::Notifications to notify +deprecation.rails+. + # [+:report+] Use ActiveSupport::ErrorReporter to report deprecations. + # [+:silence+] Do nothing. # # Setting behaviors only affects deprecations that happen after boot time. # Deprecation warnings raised by gems are not affected by this setting - # because they happen before Rails boots up. + # because they happen before \Rails boots up. # - # ActiveSupport::Deprecation.behavior = :stderr - # ActiveSupport::Deprecation.behavior = [:stderr, :log] - # ActiveSupport::Deprecation.behavior = MyCustomHandler - # ActiveSupport::Deprecation.behavior = ->(message, callstack, deprecation_horizon, gem_name) { + # deprecator = ActiveSupport::Deprecation.new + # deprecator.behavior = :stderr + # deprecator.behavior = [:stderr, :log] + # deprecator.behavior = MyCustomHandler + # deprecator.behavior = ->(message, callstack, deprecation_horizon, gem_name) { # # custom stuff # } # - # If you are using Rails, you can set config.active_support.report_deprecations = false to disable - # all deprecation behaviors. This is similar to the +silence+ option but more performant. + # If you are using \Rails, you can set + # config.active_support.report_deprecations = false to disable + # all deprecation behaviors. This is similar to the +:silence+ option but + # more performant. # - # source://activesupport//lib/active_support/deprecation/behaviors.rb#99 + # source://activesupport//lib/active_support/deprecation/behaviors.rb#111 def behavior=(behavior); end # Whether to print a backtrace along with the warning. # - # source://activesupport//lib/active_support/deprecation/behaviors.rb#63 + # source://activesupport//lib/active_support/deprecation/behaviors.rb#71 def debug; end # Whether to print a backtrace along with the warning. # - # source://activesupport//lib/active_support/deprecation/behaviors.rb#63 + # source://activesupport//lib/active_support/deprecation/behaviors.rb#71 def debug=(_arg0); end # Returns the current behavior for disallowed deprecations or if one isn't set, defaults to +:raise+. # - # source://activesupport//lib/active_support/deprecation/behaviors.rb#71 + # source://activesupport//lib/active_support/deprecation/behaviors.rb#79 def disallowed_behavior; end # Sets the behavior for disallowed deprecations (those configured by - # ActiveSupport::Deprecation.disallowed_warnings=) to the specified - # value. As with +behavior=+, this can be a single value, array, or an + # ActiveSupport::Deprecation#disallowed_warnings=) to the specified + # value. As with #behavior=, this can be a single value, array, or an # object that responds to +call+. # - # source://activesupport//lib/active_support/deprecation/behaviors.rb#107 + # source://activesupport//lib/active_support/deprecation/behaviors.rb#119 def disallowed_behavior=(behavior); end private - # source://activesupport//lib/active_support/deprecation/behaviors.rb#112 + # source://activesupport//lib/active_support/deprecation/behaviors.rb#124 def arity_coerce(behavior); end + + # source://activesupport//lib/active_support/deprecation/behaviors.rb#143 + def arity_of_callable(callable); end end # Default warning behaviors per Rails.env. @@ -3396,64 +4556,41 @@ end # source://activesupport//lib/active_support/deprecation/behaviors.rb#13 ActiveSupport::Deprecation::DEFAULT_BEHAVIORS = T.let(T.unsafe(nil), Hash) -# DeprecatedConstantAccessor transforms a constant into a deprecated one by -# hooking +const_missing+. -# -# It takes the names of an old (deprecated) constant and of a new constant -# (both in string form) and optionally a deprecator. The deprecator defaults -# to +ActiveSupport::Deprecator+ if none is specified. -# -# The deprecated constant now returns the same object as the new one rather -# than a proxy object, so it can be used transparently in +rescue+ blocks -# etc. -# -# PLANETS = %w(mercury venus earth mars jupiter saturn uranus neptune pluto) -# -# # (In a later update, the original implementation of `PLANETS` has been removed.) -# -# PLANETS_POST_2006 = %w(mercury venus earth mars jupiter saturn uranus neptune) -# include ActiveSupport::Deprecation::DeprecatedConstantAccessor -# deprecate_constant 'PLANETS', 'PLANETS_POST_2006' -# -# PLANETS.map { |planet| planet.capitalize } -# # => DEPRECATION WARNING: PLANETS is deprecated! Use PLANETS_POST_2006 instead. -# (Backtrace information…) -# ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"] -# -# source://activesupport//lib/active_support/deprecation/constant_accessor.rb#28 +# source://activesupport//lib/active_support/deprecation/constant_accessor.rb#5 module ActiveSupport::Deprecation::DeprecatedConstantAccessor class << self # @private # - # source://activesupport//lib/active_support/deprecation/constant_accessor.rb#29 + # source://activesupport//lib/active_support/deprecation/constant_accessor.rb#6 def included(base); end end end -# DeprecatedConstantProxy transforms a constant into a deprecated one. It -# takes the names of an old (deprecated) constant and of a new constant -# (both in string form) and optionally a deprecator. The deprecator defaults -# to +ActiveSupport::Deprecator+ if none is specified. The deprecated constant -# now returns the value of the new one. +# DeprecatedConstantProxy transforms a constant into a deprecated one. It takes the full names of an old +# (deprecated) constant and of a new constant (both in string form) and a deprecator. The deprecated constant now +# returns the value of the new one. # # PLANETS = %w(mercury venus earth mars jupiter saturn uranus neptune pluto) # # # (In a later update, the original implementation of `PLANETS` has been removed.) # # PLANETS_POST_2006 = %w(mercury venus earth mars jupiter saturn uranus neptune) -# PLANETS = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('PLANETS', 'PLANETS_POST_2006') +# PLANETS = ActiveSupport::Deprecation::DeprecatedConstantProxy.new("PLANETS", "PLANETS_POST_2006", ActiveSupport::Deprecation.new) # # PLANETS.map { |planet| planet.capitalize } # # => DEPRECATION WARNING: PLANETS is deprecated! Use PLANETS_POST_2006 instead. # (Backtrace information…) # ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"] # -# source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#123 +# source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#120 class ActiveSupport::Deprecation::DeprecatedConstantProxy < ::Module # @return [DeprecatedConstantProxy] a new instance of DeprecatedConstantProxy # - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#131 - def initialize(old_const, new_const, deprecator = T.unsafe(nil), message: T.unsafe(nil)); end + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#128 + def initialize(old_const, new_const, deprecator, message: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#158 + def append_features(base); end # Returns the class of the new constant. # @@ -3461,53 +4598,59 @@ class ActiveSupport::Deprecation::DeprecatedConstantProxy < ::Module # PLANETS = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('PLANETS', 'PLANETS_POST_2006') # PLANETS.class # => Array # - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#157 + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#154 def class; end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#150 - def hash(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#168 + def extended(base); end + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#147 + def hash(*_arg0, **_arg1, &_arg2); end # Don't give a deprecation warning on inspect since test/unit and error # logs rely on it for diagnostics. # - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#144 + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#141 def inspect; end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#150 - def instance_methods(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#147 + def instance_methods(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#147 + def name(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#150 - def name(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#163 + def prepend_features(base); end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#150 - def respond_to?(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#147 + def respond_to?(*_arg0, **_arg1, &_arg2); end private - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#166 + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#178 def const_missing(name); end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#171 - def method_missing(called, *args, &block); end + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#183 + def method_missing(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#162 + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#174 def target; end class << self - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#124 + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#121 def new(*args, **options, &block); end end end -# DeprecatedInstanceVariableProxy transforms an instance variable into a -# deprecated one. It takes an instance of a class, a method on that class -# and an instance variable. It optionally takes a deprecator as the last -# argument. The deprecator defaults to +ActiveSupport::Deprecator+ if none -# is specified. +# DeprecatedInstanceVariableProxy transforms an instance variable into a deprecated one. It takes an instance of a +# class, a method on that class, an instance variable, and a deprecator as the last argument. +# +# Trying to use the deprecated instance variable will result in a deprecation warning, pointing to the method as a +# replacement. # # class Example # def initialize -# @request = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(self, :request, :@request) +# @request = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(self, :request, :@request, ActiveSupport::Deprecation.new) # @_request = :special_request # end # @@ -3532,27 +4675,26 @@ end # example.request.to_s # # => "special_request" # -# source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#88 +# source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#87 class ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy < ::ActiveSupport::Deprecation::DeprecationProxy # @return [DeprecatedInstanceVariableProxy] a new instance of DeprecatedInstanceVariableProxy # - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#89 - def initialize(instance, method, var = T.unsafe(nil), deprecator = T.unsafe(nil)); end + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#88 + def initialize(instance, method, var = T.unsafe(nil), deprecator:); end private - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#97 + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#96 def target; end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#101 + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#100 def warn(callstack, called, args); end end -# DeprecatedObjectProxy transforms an object into a deprecated one. It -# takes an object, a deprecation message, and optionally a deprecator. The -# deprecator defaults to +ActiveSupport::Deprecator+ if none is specified. +# DeprecatedObjectProxy transforms an object into a deprecated one. It takes an object, a deprecation message, and +# a deprecator. # -# deprecated_object = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(Object.new, "This object is now deprecated") +# deprecated_object = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(Object.new, "This object is now deprecated", ActiveSupport::Deprecation.new) # # => # # # deprecated_object.to_s @@ -3560,19 +4702,19 @@ end # (Backtrace) # # => "#" # -# source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#39 +# source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#38 class ActiveSupport::Deprecation::DeprecatedObjectProxy < ::ActiveSupport::Deprecation::DeprecationProxy # @return [DeprecatedObjectProxy] a new instance of DeprecatedObjectProxy # - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#40 - def initialize(object, message, deprecator = T.unsafe(nil)); end + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#39 + def initialize(object, message, deprecator); end private - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#47 + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#46 def target; end - # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#51 + # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#50 def warn(callstack, called, args); end end @@ -3591,29 +4733,120 @@ class ActiveSupport::Deprecation::DeprecationProxy class << self # source://activesupport//lib/active_support/deprecation/proxy_wrappers.rb#6 - def new(*args, &block); end + def new(*args, **kwargs, &block); end end end -# source://activesupport//lib/active_support/deprecation/disallowed.rb#5 -module ActiveSupport::Deprecation::Disallowed - # Returns the configured criteria used to identify deprecation messages - # which should be treated as disallowed. +# A managed collection of deprecators. Configuration methods, such as +# #behavior=, affect all deprecators in the collection. Additionally, the +# #silence method silences all deprecators in the collection for the +# duration of a given block. +# +# source://activesupport//lib/active_support/deprecation/deprecators.rb#9 +class ActiveSupport::Deprecation::Deprecators + # @return [Deprecators] a new instance of Deprecators # - # source://activesupport//lib/active_support/deprecation/disallowed.rb#21 - def disallowed_warnings; end + # source://activesupport//lib/active_support/deprecation/deprecators.rb#10 + def initialize; end + + # Returns a deprecator added to this collection via #[]=. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#16 + def [](name); end + + # Adds a given +deprecator+ to this collection. The deprecator will be + # immediately configured with any options previously set on this + # collection. + # + # deprecators = ActiveSupport::Deprecation::Deprecators.new + # deprecators.debug = true + # + # foo_deprecator = ActiveSupport::Deprecation.new("2.0", "Foo") + # foo_deprecator.debug # => false + # + # deprecators[:foo] = foo_deprecator + # deprecators[:foo].debug # => true + # foo_deprecator.debug # => true + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#34 + def []=(name, deprecator); end + + # Sets the deprecation warning behavior for all deprecators in this + # collection. + # + # See ActiveSupport::Deprecation#behavior=. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#60 + def behavior=(behavior); end + + # Sets the debug flag for all deprecators in this collection. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#52 + def debug=(debug); end + + # Sets the disallowed deprecation warning behavior for all deprecators in + # this collection. + # + # See ActiveSupport::Deprecation#disallowed_behavior=. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#68 + def disallowed_behavior=(disallowed_behavior); end + + # Sets the disallowed deprecation warnings for all deprecators in this + # collection. + # + # See ActiveSupport::Deprecation#disallowed_warnings=. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#76 + def disallowed_warnings=(disallowed_warnings); end + + # Iterates over all deprecators in this collection. If no block is given, + # returns an +Enumerator+. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#41 + def each(&block); end + + # Silences all deprecators in this collection for the duration of the + # given block. + # + # See ActiveSupport::Deprecation#silence. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#84 + def silence(&block); end + + # Sets the silenced flag for all deprecators in this collection. + # + # source://activesupport//lib/active_support/deprecation/deprecators.rb#47 + def silenced=(silenced); end + + private + + # source://activesupport//lib/active_support/deprecation/deprecators.rb#97 + def apply_options(deprecator); end + + # source://activesupport//lib/active_support/deprecation/deprecators.rb#92 + def set_option(name, value); end +end + +# source://activesupport//lib/active_support/deprecation/disallowed.rb#5 +module ActiveSupport::Deprecation::Disallowed + # Returns the configured criteria used to identify deprecation messages + # which should be treated as disallowed. + # + # source://activesupport//lib/active_support/deprecation/disallowed.rb#21 + def disallowed_warnings; end # Sets the criteria used to identify deprecation messages which should be # disallowed. Can be an array containing strings, symbols, or regular - # expressions. (Symbols are treated as strings). These are compared against + # expressions. (Symbols are treated as strings.) These are compared against # the text of the generated deprecation warning. # # Additionally the scalar symbol +:all+ may be used to treat all # deprecations as disallowed. # # Deprecations matching a substring or regular expression will be handled - # using the configured +ActiveSupport::Deprecation.disallowed_behavior+ - # rather than +ActiveSupport::Deprecation.behavior+ + # using the configured Behavior#disallowed_behavior rather than + # Behavior#behavior. # # source://activesupport//lib/active_support/deprecation/disallowed.rb#17 def disallowed_warnings=(_arg0); end @@ -3627,40 +4860,12 @@ module ActiveSupport::Deprecation::Disallowed # @return [Boolean] # - # source://activesupport//lib/active_support/deprecation/disallowed.rb#40 + # source://activesupport//lib/active_support/deprecation/disallowed.rb#39 def explicitly_allowed?(message); end end -# source://activesupport//lib/active_support/deprecation/instance_delegator.rb#7 -module ActiveSupport::Deprecation::InstanceDelegator - mixes_in_class_methods ::ActiveSupport::Deprecation::InstanceDelegator::ClassMethods - mixes_in_class_methods ::ActiveSupport::Deprecation::InstanceDelegator::OverrideDelegators - - class << self - # @private - # - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#8 - def included(base); end - end -end - -# source://activesupport//lib/active_support/deprecation/instance_delegator.rb#14 -module ActiveSupport::Deprecation::InstanceDelegator::ClassMethods - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#15 - def include(included_module); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#20 - def method_added(method_name); end -end - -# source://activesupport//lib/active_support/deprecation/instance_delegator.rb#25 -module ActiveSupport::Deprecation::InstanceDelegator::OverrideDelegators - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#31 - def deprecation_warning(deprecated_method_name, message = T.unsafe(nil), caller_backtrace = T.unsafe(nil)); end - - # source://activesupport//lib/active_support/deprecation/instance_delegator.rb#26 - def warn(message = T.unsafe(nil), callstack = T.unsafe(nil)); end -end +# source://activesupport//lib/active_support/deprecation.rb#57 +ActiveSupport::Deprecation::MUTEX = T.let(T.unsafe(nil), Thread::Mutex) # source://activesupport//lib/active_support/deprecation/method_wrappers.rb#8 module ActiveSupport::Deprecation::MethodWrapper @@ -3674,41 +4879,24 @@ module ActiveSupport::Deprecation::MethodWrapper # def eee; end # end # - # Using the default deprecator: - # ActiveSupport::Deprecation.deprecate_methods(Fred, :aaa, bbb: :zzz, ccc: 'use Bar#ccc instead') + # deprecator = ActiveSupport::Deprecation.new('next-release', 'MyGem') + # + # deprecator.deprecate_methods(Fred, :aaa, bbb: :zzz, ccc: 'use Bar#ccc instead') # # => Fred # # Fred.new.aaa - # # DEPRECATION WARNING: aaa is deprecated and will be removed from Rails 5.1. (called from irb_binding at (irb):10) + # # DEPRECATION WARNING: aaa is deprecated and will be removed from MyGem next-release. (called from irb_binding at (irb):10) # # => nil # # Fred.new.bbb - # # DEPRECATION WARNING: bbb is deprecated and will be removed from Rails 5.1 (use zzz instead). (called from irb_binding at (irb):11) + # # DEPRECATION WARNING: bbb is deprecated and will be removed from MyGem next-release (use zzz instead). (called from irb_binding at (irb):11) # # => nil # # Fred.new.ccc - # # DEPRECATION WARNING: ccc is deprecated and will be removed from Rails 5.1 (use Bar#ccc instead). (called from irb_binding at (irb):12) - # # => nil - # - # Passing in a custom deprecator: - # custom_deprecator = ActiveSupport::Deprecation.new('next-release', 'MyGem') - # ActiveSupport::Deprecation.deprecate_methods(Fred, ddd: :zzz, deprecator: custom_deprecator) - # # => [:ddd] - # - # Fred.new.ddd - # DEPRECATION WARNING: ddd is deprecated and will be removed from MyGem next-release (use zzz instead). (called from irb_binding at (irb):15) - # # => nil - # - # Using a custom deprecator directly: - # custom_deprecator = ActiveSupport::Deprecation.new('next-release', 'MyGem') - # custom_deprecator.deprecate_methods(Fred, eee: :zzz) - # # => [:eee] - # - # Fred.new.eee - # DEPRECATION WARNING: eee is deprecated and will be removed from MyGem next-release (use zzz instead). (called from irb_binding at (irb):18) + # # DEPRECATION WARNING: ccc is deprecated and will be removed from MyGem next-release (use Bar#ccc instead). (called from irb_binding at (irb):12) # # => nil # - # source://activesupport//lib/active_support/deprecation/method_wrappers.rb#52 + # source://activesupport//lib/active_support/deprecation/method_wrappers.rb#35 def deprecate_methods(target_module, *method_names); end end @@ -3719,36 +4907,43 @@ module ActiveSupport::Deprecation::Reporting # expressions. (Symbols are treated as strings). These are compared against # the text of deprecation warning messages generated within the block. # Matching warnings will be exempt from the rules set by - # +ActiveSupport::Deprecation.disallowed_warnings+ + # ActiveSupport::Deprecation#disallowed_warnings. # # The optional if: argument accepts a truthy/falsy value or an object that # responds to .call. If truthy, then matching warnings will be allowed. # If falsey then the method yields to the block without allowing the warning. # - # ActiveSupport::Deprecation.disallowed_behavior = :raise - # ActiveSupport::Deprecation.disallowed_warnings = [ + # deprecator = ActiveSupport::Deprecation.new + # deprecator.disallowed_behavior = :raise + # deprecator.disallowed_warnings = [ # "something broke" # ] # - # ActiveSupport::Deprecation.warn('something broke!') + # deprecator.warn('something broke!') # # => ActiveSupport::DeprecationException # - # ActiveSupport::Deprecation.allow ['something broke'] do - # ActiveSupport::Deprecation.warn('something broke!') + # deprecator.allow ['something broke'] do + # deprecator.warn('something broke!') # end # # => nil # - # ActiveSupport::Deprecation.allow ['something broke'], if: Rails.env.production? do - # ActiveSupport::Deprecation.warn('something broke!') + # deprecator.allow ['something broke'], if: Rails.env.production? do + # deprecator.warn('something broke!') # end # # => ActiveSupport::DeprecationException for dev/test, nil for production # - # source://activesupport//lib/active_support/deprecation/reporting.rb#72 + # source://activesupport//lib/active_support/deprecation/reporting.rb#89 def allow(allowed_warnings = T.unsafe(nil), if: T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/deprecation/reporting.rb#86 + # source://activesupport//lib/active_support/deprecation/reporting.rb#48 + def begin_silence; end + + # source://activesupport//lib/active_support/deprecation/reporting.rb#99 def deprecation_warning(deprecated_method_name, message = T.unsafe(nil), caller_backtrace = T.unsafe(nil)); end + # source://activesupport//lib/active_support/deprecation/reporting.rb#52 + def end_silence; end + # Name of gem where method is deprecated # # source://activesupport//lib/active_support/deprecation/reporting.rb#11 @@ -3761,18 +4956,19 @@ module ActiveSupport::Deprecation::Reporting # Silence deprecation warnings within the block. # - # ActiveSupport::Deprecation.warn('something broke!') + # deprecator = ActiveSupport::Deprecation.new + # deprecator.warn('something broke!') # # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)" # - # ActiveSupport::Deprecation.silence do - # ActiveSupport::Deprecation.warn('something broke!') + # deprecator.silence do + # deprecator.warn('something broke!') # end # # => nil # - # source://activesupport//lib/active_support/deprecation/reporting.rb#40 + # source://activesupport//lib/active_support/deprecation/reporting.rb#41 def silence(&block); end - # source://activesupport//lib/active_support/deprecation/reporting.rb#82 + # source://activesupport//lib/active_support/deprecation/reporting.rb#56 def silenced; end # Whether to print a message (silent mode) @@ -3781,9 +4977,9 @@ module ActiveSupport::Deprecation::Reporting def silenced=(_arg0); end # Outputs a deprecation warning to the output configured by - # ActiveSupport::Deprecation.behavior. + # ActiveSupport::Deprecation#behavior. # - # ActiveSupport::Deprecation.warn('something broke!') + # ActiveSupport::Deprecation.new.warn('something broke!') # # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)" # # source://activesupport//lib/active_support/deprecation/reporting.rb#18 @@ -3791,9 +4987,6 @@ module ActiveSupport::Deprecation::Reporting private - # source://activesupport//lib/active_support/deprecation/reporting.rb#137 - def _extract_callstack(callstack); end - # Outputs a deprecation warning message # # deprecated_method_warning(:method_name) @@ -3803,23 +4996,28 @@ module ActiveSupport::Deprecation::Reporting # deprecated_method_warning(:method_name, "Optional message") # # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon} (Optional message)" # - # source://activesupport//lib/active_support/deprecation/reporting.rb#102 + # source://activesupport//lib/active_support/deprecation/reporting.rb#115 def deprecated_method_warning(method_name, message = T.unsafe(nil)); end - # source://activesupport//lib/active_support/deprecation/reporting.rb#116 + # source://activesupport//lib/active_support/deprecation/reporting.rb#129 def deprecation_caller_message(callstack); end - # source://activesupport//lib/active_support/deprecation/reporting.rb#111 + # source://activesupport//lib/active_support/deprecation/reporting.rb#124 def deprecation_message(callstack, message = T.unsafe(nil)); end - # source://activesupport//lib/active_support/deprecation/reporting.rb#127 + # source://activesupport//lib/active_support/deprecation/reporting.rb#140 def extract_callstack(callstack); end - # source://activesupport//lib/active_support/deprecation/reporting.rb#152 - def ignored_callstack(path); end + # @return [Boolean] + # + # source://activesupport//lib/active_support/deprecation/reporting.rb#157 + def ignored_callstack?(path); end end -# source://activesupport//lib/active_support/deprecation/reporting.rb#150 +# source://activesupport//lib/active_support/deprecation/reporting.rb#154 +ActiveSupport::Deprecation::Reporting::LIB_DIR = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/deprecation/reporting.rb#152 ActiveSupport::Deprecation::Reporting::RAILS_GEM_ROOT = T.let(T.unsafe(nil), String) # Raised when ActiveSupport::Deprecation::Behavior#behavior is set with :raise. @@ -3828,87 +5026,60 @@ ActiveSupport::Deprecation::Reporting::RAILS_GEM_ROOT = T.let(T.unsafe(nil), Str # source://activesupport//lib/active_support/deprecation/behaviors.rb#8 class ActiveSupport::DeprecationException < ::StandardError; end +# = Active Support Descendants Tracker +# # This module provides an internal implementation to track descendants -# which is faster than iterating through ObjectSpace. +# which is faster than iterating through +ObjectSpace+. # -# source://activesupport//lib/active_support/descendants_tracker.rb#9 +# However Ruby 3.1 provide a fast native +Class#subclasses+ method, +# so if you know your code won't be executed on older rubies, including +# +ActiveSupport::DescendantsTracker+ does not provide any benefit. +# +# source://activesupport//lib/active_support/descendants_tracker.rb#14 module ActiveSupport::DescendantsTracker - # source://activesupport//lib/active_support/descendants_tracker.rb#170 + # source://activesupport//lib/active_support/descendants_tracker.rb#107 def descendants; end - # source://activesupport//lib/active_support/descendants_tracker.rb#158 - def direct_descendants; end - - # source://activesupport//lib/active_support/descendants_tracker.rb#153 - def inherited(base); end - - # source://activesupport//lib/active_support/descendants_tracker.rb#166 - def subclasses; end - class << self - # source://activesupport//lib/active_support/descendants_tracker.rb#118 + # source://activesupport//lib/active_support/descendants_tracker.rb#78 def clear(classes); end - # source://activesupport//lib/active_support/descendants_tracker.rb#112 + # source://activesupport//lib/active_support/descendants_tracker.rb#102 def descendants(klass); end - # source://activesupport//lib/active_support/descendants_tracker.rb#11 - def direct_descendants(klass); end - - # source://activesupport//lib/active_support/descendants_tracker.rb#103 + # source://activesupport//lib/active_support/descendants_tracker.rb#69 def disable_clear!; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/descendants_tracker.rb#132 - def native?; end - - # This is the only method that is not thread safe, but is only ever called - # during the eager loading phase. - # - # source://activesupport//lib/active_support/descendants_tracker.rb#138 - def store_inherited(klass, descendant); end + # source://activesupport//lib/active_support/descendants_tracker.rb#89 + def reject!(classes); end - # source://activesupport//lib/active_support/descendants_tracker.rb#107 + # source://activesupport//lib/active_support/descendants_tracker.rb#98 def subclasses(klass); end - - private - - # source://activesupport//lib/active_support/descendants_tracker.rb#143 - def accumulate_descendants(klass, acc); end end end -# DescendantsArray is an array that contains weak references to classes. -# -# source://activesupport//lib/active_support/descendants_tracker.rb#175 -class ActiveSupport::DescendantsTracker::DescendantsArray - include ::Enumerable - - # @return [DescendantsArray] a new instance of DescendantsArray - # - # source://activesupport//lib/active_support/descendants_tracker.rb#178 - def initialize; end - - # source://activesupport//lib/active_support/descendants_tracker.rb#186 - def <<(klass); end - - # source://activesupport//lib/active_support/descendants_tracker.rb#204 - def cleanup!; end - - # source://activesupport//lib/active_support/descendants_tracker.rb#190 - def each; end - - # source://activesupport//lib/active_support/descendants_tracker.rb#200 - def refs_size; end +# source://activesupport//lib/active_support/descendants_tracker.rb#58 +module ActiveSupport::DescendantsTracker::ReloadedClassesFiltering + # source://activesupport//lib/active_support/descendants_tracker.rb#63 + def descendants; end - # source://activesupport//lib/active_support/descendants_tracker.rb#208 - def reject!; end + # source://activesupport//lib/active_support/descendants_tracker.rb#59 + def subclasses; end +end - private +# On TruffleRuby `ObjectSpace::WeakMap` keys are strong references. +# So we use `object_id` as a key and the actual object as a value. +# +# JRuby for now doesn't have Class#descendant, but when it will, it will likely +# have the same WeakMap semantic than Truffle so we future proof this as much as possible. +# +# source://activesupport//lib/active_support/descendants_tracker.rb#20 +class ActiveSupport::DescendantsTracker::WeakSet < ::ObjectSpace::WeakMap + # source://activesupport//lib/active_support/descendants_tracker.rb#23 + def <<(object); end - # source://activesupport//lib/active_support/descendants_tracker.rb#182 - def initialize_copy(orig); end + # source://activesupport//lib/active_support/descendants_tracker.rb#21 + def to_a; end end # source://activesupport//lib/active_support/digest.rb#6 @@ -3927,92 +5098,97 @@ class ActiveSupport::Digest end end +# = Active Support \Duration +# # Provides accurate date and time measurements using Date#advance and # Time#advance, respectively. It mainly supports the methods on Numeric. # # 1.month.ago # equivalent to Time.now.advance(months: -1) # -# source://activesupport//lib/active_support/duration.rb#13 +# source://activesupport//lib/active_support/duration.rb#14 class ActiveSupport::Duration # @return [Duration] a new instance of Duration # - # source://activesupport//lib/active_support/duration.rb#223 + # source://activesupport//lib/active_support/duration.rb#226 def initialize(value, parts, variable = T.unsafe(nil)); end # Returns the modulo of this Duration by another Duration or Numeric. # Numeric values are treated as seconds. # - # source://activesupport//lib/active_support/duration.rb#306 + # source://activesupport//lib/active_support/duration.rb#312 def %(other); end # Multiplies this Duration by a Numeric and returns a new Duration. # - # source://activesupport//lib/active_support/duration.rb#281 + # source://activesupport//lib/active_support/duration.rb#287 def *(other); end # Adds another Duration or a Numeric to this Duration. Numeric values # are treated as seconds. # - # source://activesupport//lib/active_support/duration.rb#262 + # source://activesupport//lib/active_support/duration.rb#268 def +(other); end - # source://activesupport//lib/active_support/duration.rb#320 + # source://activesupport//lib/active_support/duration.rb#326 def +@; end # Subtracts another Duration or a Numeric from this Duration. Numeric # values are treated as seconds. # - # source://activesupport//lib/active_support/duration.rb#276 + # source://activesupport//lib/active_support/duration.rb#282 def -(other); end - # source://activesupport//lib/active_support/duration.rb#316 + # source://activesupport//lib/active_support/duration.rb#322 def -@; end # Divides this Duration by a Numeric and returns a new Duration. # - # source://activesupport//lib/active_support/duration.rb#292 + # source://activesupport//lib/active_support/duration.rb#298 def /(other); end # Compares one Duration with another or a Numeric to this Duration. # Numeric values are treated as seconds. # - # source://activesupport//lib/active_support/duration.rb#252 + # source://activesupport//lib/active_support/duration.rb#258 def <=>(other); end # Returns +true+ if +other+ is also a Duration instance with the # same +value+, or if other == value. # - # source://activesupport//lib/active_support/duration.rb#335 + # source://activesupport//lib/active_support/duration.rb#341 def ==(other); end - # source://activesupport//lib/active_support/duration.rb#475 + # source://activesupport//lib/active_support/duration.rb#481 def _parts; end + # source://activesupport//lib/active_support/duration.rb#224 + def abs(&_arg0); end + # Calculates a new Time or Date that is as far in the future # as this Duration represents. # - # source://activesupport//lib/active_support/duration.rb#430 + # source://activesupport//lib/active_support/duration.rb#440 def after(time = T.unsafe(nil)); end # Calculates a new Time or Date that is as far in the past # as this Duration represents. # - # source://activesupport//lib/active_support/duration.rb#438 + # source://activesupport//lib/active_support/duration.rb#444 def ago(time = T.unsafe(nil)); end - # source://activesupport//lib/active_support/duration.rb#453 + # source://activesupport//lib/active_support/duration.rb#459 def as_json(options = T.unsafe(nil)); end # Calculates a new Time or Date that is as far in the past # as this Duration represents. # - # source://activesupport//lib/active_support/duration.rb#438 + # source://activesupport//lib/active_support/duration.rb#448 def before(time = T.unsafe(nil)); end - # source://activesupport//lib/active_support/duration.rb#239 + # source://activesupport//lib/active_support/duration.rb#245 def coerce(other); end - # source://activesupport//lib/active_support/duration.rb#461 + # source://activesupport//lib/active_support/duration.rb#467 def encode_with(coder); end # Returns +true+ if +other+ is also a Duration instance, which has the @@ -4020,44 +5196,44 @@ class ActiveSupport::Duration # # @return [Boolean] # - # source://activesupport//lib/active_support/duration.rb#420 + # source://activesupport//lib/active_support/duration.rb#426 def eql?(other); end # Calculates a new Time or Date that is as far in the future # as this Duration represents. # - # source://activesupport//lib/active_support/duration.rb#430 + # source://activesupport//lib/active_support/duration.rb#439 def from_now(time = T.unsafe(nil)); end - # source://activesupport//lib/active_support/duration.rb#424 + # source://activesupport//lib/active_support/duration.rb#430 def hash; end # Returns the amount of days a duration covers as a float # # 12.hours.in_days # => 0.5 # - # source://activesupport//lib/active_support/duration.rb#393 + # source://activesupport//lib/active_support/duration.rb#399 def in_days; end # Returns the amount of hours a duration covers as a float # # 1.day.in_hours # => 24.0 # - # source://activesupport//lib/active_support/duration.rb#386 + # source://activesupport//lib/active_support/duration.rb#392 def in_hours; end # Returns the amount of minutes a duration covers as a float # # 1.day.in_minutes # => 1440.0 # - # source://activesupport//lib/active_support/duration.rb#379 + # source://activesupport//lib/active_support/duration.rb#385 def in_minutes; end # Returns the amount of months a duration covers as a float # # 9.weeks.in_months # => 2.07 # - # source://activesupport//lib/active_support/duration.rb#407 + # source://activesupport//lib/active_support/duration.rb#413 def in_months; end # Returns the number of seconds that this Duration represents. @@ -4077,65 +5253,77 @@ class ActiveSupport::Duration # 1.year.to_i # => 31556952 # # In such cases, Ruby's core - # Date[https://ruby-doc.org/stdlib/libdoc/date/rdoc/Date.html] and - # Time[https://ruby-doc.org/stdlib/libdoc/time/rdoc/Time.html] should be used for precision + # Date[https://docs.ruby-lang.org/en/master/Date.html] and + # Time[https://docs.ruby-lang.org/en/master/Time.html] should be used for precision # date and time arithmetic. # - # source://activesupport//lib/active_support/duration.rb#371 + # source://activesupport//lib/active_support/duration.rb#380 def in_seconds; end # Returns the amount of weeks a duration covers as a float # # 2.months.in_weeks # => 8.696 # - # source://activesupport//lib/active_support/duration.rb#400 + # source://activesupport//lib/active_support/duration.rb#406 def in_weeks; end # Returns the amount of years a duration covers as a float # # 30.days.in_years # => 0.082 # - # source://activesupport//lib/active_support/duration.rb#414 + # source://activesupport//lib/active_support/duration.rb#420 def in_years; end - # source://activesupport//lib/active_support/duration.rb#457 + # source://activesupport//lib/active_support/duration.rb#463 def init_with(coder); end - # source://activesupport//lib/active_support/duration.rb#444 + # source://activesupport//lib/active_support/duration.rb#450 def inspect; end # @return [Boolean] # - # source://activesupport//lib/active_support/duration.rb#329 + # source://activesupport//lib/active_support/duration.rb#335 def instance_of?(klass); end # @return [Boolean] # - # source://activesupport//lib/active_support/duration.rb#324 + # source://activesupport//lib/active_support/duration.rb#330 def is_a?(klass); end # Build ISO 8601 Duration string for this duration. # The +precision+ parameter can be used to limit seconds' precision of duration. # - # source://activesupport//lib/active_support/duration.rb#467 + # source://activesupport//lib/active_support/duration.rb#473 def iso8601(precision: T.unsafe(nil)); end # @return [Boolean] # - # source://activesupport//lib/active_support/duration.rb#324 + # source://activesupport//lib/active_support/duration.rb#333 def kind_of?(klass); end - # Returns a copy of the parts hash that defines the duration + # source://activesupport//lib/active_support/duration.rb#224 + def negative?(&_arg0); end + + # Returns a copy of the parts hash that defines the duration. # - # source://activesupport//lib/active_support/duration.rb#235 + # 5.minutes.parts # => {:minutes=>5} + # 3.years.parts # => {:years=>3} + # + # source://activesupport//lib/active_support/duration.rb#241 def parts; end + # source://activesupport//lib/active_support/duration.rb#224 + def positive?(&_arg0); end + # Calculates a new Time or Date that is as far in the future # as this Duration represents. # - # source://activesupport//lib/active_support/duration.rb#430 + # source://activesupport//lib/active_support/duration.rb#436 def since(time = T.unsafe(nil)); end + # source://activesupport//lib/active_support/duration.rb#224 + def to_f(&_arg0); end + # Returns the number of seconds that this Duration represents. # # 1.minute.to_i # => 60 @@ -4153,11 +5341,11 @@ class ActiveSupport::Duration # 1.year.to_i # => 31556952 # # In such cases, Ruby's core - # Date[https://ruby-doc.org/stdlib/libdoc/date/rdoc/Date.html] and - # Time[https://ruby-doc.org/stdlib/libdoc/time/rdoc/Time.html] should be used for precision + # Date[https://docs.ruby-lang.org/en/master/Date.html] and + # Time[https://docs.ruby-lang.org/en/master/Time.html] should be used for precision # date and time arithmetic. # - # source://activesupport//lib/active_support/duration.rb#371 + # source://activesupport//lib/active_support/duration.rb#377 def to_i; end # Returns the amount of seconds a duration covers as a string. @@ -4165,45 +5353,48 @@ class ActiveSupport::Duration # # 1.day.to_s # => "86400" # - # source://activesupport//lib/active_support/duration.rb#347 + # source://activesupport//lib/active_support/duration.rb#353 def to_s; end # Calculates a new Time or Date that is as far in the past # as this Duration represents. # - # source://activesupport//lib/active_support/duration.rb#438 + # source://activesupport//lib/active_support/duration.rb#447 def until(time = T.unsafe(nil)); end # Returns the value of attribute value. # - # source://activesupport//lib/active_support/duration.rb#132 + # source://activesupport//lib/active_support/duration.rb#133 def value; end # @return [Boolean] # - # source://activesupport//lib/active_support/duration.rb#471 + # source://activesupport//lib/active_support/duration.rb#477 def variable?; end + # source://activesupport//lib/active_support/duration.rb#224 + def zero?(&_arg0); end + private - # source://activesupport//lib/active_support/duration.rb#506 - def method_missing(method, *args, &block); end + # source://activesupport//lib/active_support/duration.rb#516 + def method_missing(*_arg0, **_arg1, &_arg2); end # @raise [TypeError] # - # source://activesupport//lib/active_support/duration.rb#510 + # source://activesupport//lib/active_support/duration.rb#520 def raise_type_error(other); end # @return [Boolean] # - # source://activesupport//lib/active_support/duration.rb#502 + # source://activesupport//lib/active_support/duration.rb#512 def respond_to_missing?(method, _); end - # source://activesupport//lib/active_support/duration.rb#480 + # source://activesupport//lib/active_support/duration.rb#486 def sum(sign, time = T.unsafe(nil)); end class << self - # source://activesupport//lib/active_support/duration.rb#148 + # source://activesupport//lib/active_support/duration.rb#149 def ===(other); end # Creates a new Duration from a seconds value that is converted @@ -4212,19 +5403,19 @@ class ActiveSupport::Duration # ActiveSupport::Duration.build(31556952).parts # => {:years=>1} # ActiveSupport::Duration.build(2716146).parts # => {:months=>1, :days=>1} # - # source://activesupport//lib/active_support/duration.rb#188 + # source://activesupport//lib/active_support/duration.rb#189 def build(value); end - # source://activesupport//lib/active_support/duration.rb#166 + # source://activesupport//lib/active_support/duration.rb#167 def days(value); end - # source://activesupport//lib/active_support/duration.rb#162 + # source://activesupport//lib/active_support/duration.rb#163 def hours(value); end - # source://activesupport//lib/active_support/duration.rb#158 + # source://activesupport//lib/active_support/duration.rb#159 def minutes(value); end - # source://activesupport//lib/active_support/duration.rb#174 + # source://activesupport//lib/active_support/duration.rb#175 def months(value); end # Creates a new Duration from string formatted according to ISO 8601 Duration. @@ -4233,21 +5424,21 @@ class ActiveSupport::Duration # This method allows negative parts to be present in pattern. # If invalid string is provided, it will raise +ActiveSupport::Duration::ISO8601Parser::ParsingError+. # - # source://activesupport//lib/active_support/duration.rb#143 + # source://activesupport//lib/active_support/duration.rb#144 def parse(iso8601duration); end - # source://activesupport//lib/active_support/duration.rb#154 + # source://activesupport//lib/active_support/duration.rb#155 def seconds(value); end - # source://activesupport//lib/active_support/duration.rb#170 + # source://activesupport//lib/active_support/duration.rb#171 def weeks(value); end - # source://activesupport//lib/active_support/duration.rb#178 + # source://activesupport//lib/active_support/duration.rb#179 def years(value); end private - # source://activesupport//lib/active_support/duration.rb#216 + # source://activesupport//lib/active_support/duration.rb#217 def calculate_total_seconds(parts); end end end @@ -4369,190 +5560,260 @@ ActiveSupport::Duration::ISO8601Parser::TIME_TO_PART = T.let(T.unsafe(nil), Hash # Serializes duration to string according to ISO 8601 Duration format. # -# source://activesupport//lib/active_support/duration/iso8601_serializer.rb#8 +# source://activesupport//lib/active_support/duration/iso8601_serializer.rb#6 class ActiveSupport::Duration::ISO8601Serializer # @return [ISO8601Serializer] a new instance of ISO8601Serializer # - # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#11 + # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#9 def initialize(duration, precision: T.unsafe(nil)); end # Builds and returns output string. # - # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#17 + # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#15 def serialize; end private - # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#58 + # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#55 def format_seconds(seconds); end # Return pair of duration's parts and whole duration sign. # Parts are summarized (as they can become repetitive due to addition, etc). # Zero parts are removed as not significant. - # If all parts are negative it will negate all of them and return minus as a sign. # - # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#41 + # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#38 def normalize; end # @return [Boolean] # - # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#54 + # source://activesupport//lib/active_support/duration/iso8601_serializer.rb#51 def week_mixed_with_date?(parts); end end -# source://activesupport//lib/active_support/duration/iso8601_serializer.rb#9 +# source://activesupport//lib/active_support/duration/iso8601_serializer.rb#7 ActiveSupport::Duration::ISO8601Serializer::DATE_COMPONENTS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/duration.rb#129 +# source://activesupport//lib/active_support/duration.rb#130 ActiveSupport::Duration::PARTS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/duration.rb#119 +# source://activesupport//lib/active_support/duration.rb#120 ActiveSupport::Duration::PARTS_IN_SECONDS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/duration.rb#114 +# source://activesupport//lib/active_support/duration.rb#115 ActiveSupport::Duration::SECONDS_PER_DAY = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/duration.rb#113 +# source://activesupport//lib/active_support/duration.rb#114 ActiveSupport::Duration::SECONDS_PER_HOUR = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/duration.rb#112 +# source://activesupport//lib/active_support/duration.rb#113 ActiveSupport::Duration::SECONDS_PER_MINUTE = T.let(T.unsafe(nil), Integer) # 1/12 of a gregorian year # -# source://activesupport//lib/active_support/duration.rb#116 +# source://activesupport//lib/active_support/duration.rb#117 ActiveSupport::Duration::SECONDS_PER_MONTH = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/duration.rb#115 +# source://activesupport//lib/active_support/duration.rb#116 ActiveSupport::Duration::SECONDS_PER_WEEK = T.let(T.unsafe(nil), Integer) # length of a gregorian year (365.2425 days) # -# source://activesupport//lib/active_support/duration.rb#117 +# source://activesupport//lib/active_support/duration.rb#118 ActiveSupport::Duration::SECONDS_PER_YEAR = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/duration.rb#14 +# source://activesupport//lib/active_support/duration.rb#15 class ActiveSupport::Duration::Scalar < ::Numeric # @return [Scalar] a new instance of Scalar # - # source://activesupport//lib/active_support/duration.rb#18 + # source://activesupport//lib/active_support/duration.rb#19 def initialize(value); end - # source://activesupport//lib/active_support/duration.rb#84 + # source://activesupport//lib/active_support/duration.rb#85 def %(other); end - # source://activesupport//lib/active_support/duration.rb#65 + # source://activesupport//lib/active_support/duration.rb#66 def *(other); end - # source://activesupport//lib/active_support/duration.rb#40 + # source://activesupport//lib/active_support/duration.rb#41 def +(other); end - # source://activesupport//lib/active_support/duration.rb#52 + # source://activesupport//lib/active_support/duration.rb#53 def -(other); end - # source://activesupport//lib/active_support/duration.rb#26 + # source://activesupport//lib/active_support/duration.rb#27 def -@; end - # source://activesupport//lib/active_support/duration.rb#76 + # source://activesupport//lib/active_support/duration.rb#77 def /(other); end - # source://activesupport//lib/active_support/duration.rb#30 + # source://activesupport//lib/active_support/duration.rb#31 def <=>(other); end - # source://activesupport//lib/active_support/duration.rb#22 + # source://activesupport//lib/active_support/duration.rb#23 def coerce(other); end - # source://activesupport//lib/active_support/duration.rb#16 - def to_f(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/duration.rb#17 + def to_f(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/duration.rb#16 - def to_i(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/duration.rb#17 + def to_i(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/duration.rb#16 - def to_s(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/duration.rb#17 + def to_s(*_arg0, **_arg1, &_arg2); end # Returns the value of attribute value. # - # source://activesupport//lib/active_support/duration.rb#15 + # source://activesupport//lib/active_support/duration.rb#16 def value; end # @return [Boolean] # - # source://activesupport//lib/active_support/duration.rb#92 + # source://activesupport//lib/active_support/duration.rb#93 def variable?; end private - # source://activesupport//lib/active_support/duration.rb#97 + # source://activesupport//lib/active_support/duration.rb#98 def calculate(op, other); end # @raise [TypeError] # - # source://activesupport//lib/active_support/duration.rb#107 + # source://activesupport//lib/active_support/duration.rb#108 def raise_type_error(other); end end -# source://activesupport//lib/active_support/duration.rb#130 +# source://activesupport//lib/active_support/duration.rb#131 ActiveSupport::Duration::VARIABLE_PARTS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/core_ext/range/each.rb#6 -module ActiveSupport::EachTimeWithZone - # source://activesupport//lib/active_support/core_ext/range/each.rb#7 - def each(&block); end +# source://activesupport//lib/active_support/editor.rb#6 +class ActiveSupport::Editor + # @return [Editor] a new instance of Editor + # + # source://activesupport//lib/active_support/editor.rb#48 + def initialize(url_pattern); end - # source://activesupport//lib/active_support/core_ext/range/each.rb#12 - def step(n = T.unsafe(nil), &block); end + # source://activesupport//lib/active_support/editor.rb#52 + def url_for(path, line); end - private + class << self + # Returns the current editor pattern if it is known. + # First check for the `RAILS_EDITOR` environment variable, and if it's + # missing, check for the `EDITOR` environment variable. + # + # source://activesupport//lib/active_support/editor.rb#28 + def current; end - # @raise [TypeError] - # - # source://activesupport//lib/active_support/core_ext/range/each.rb#18 - def ensure_iteration_allowed; end + # source://activesupport//lib/active_support/editor.rb#39 + def find(name); end + + # Registers a URL pattern for opening file in a given editor. + # This allows Rails to generate clickable links to control known editors. + # + # Example: + # + # ActiveSupport::Editor.register("myeditor", "myeditor://%s:%d") + # + # source://activesupport//lib/active_support/editor.rb#17 + def register(name, url_pattern, aliases: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/editor.rb#43 + def reset; end + end end -# source://activesupport//lib/active_support/encrypted_configuration.rb#10 +# = Encrypted Configuration +# +# Provides convenience methods on top of EncryptedFile to access values stored +# as encrypted YAML. +# +# Values can be accessed via +Hash+ methods, such as +fetch+ and +dig+, or via +# dynamic accessor methods, similar to OrderedOptions. +# +# my_config = ActiveSupport::EncryptedConfiguration.new(...) +# my_config.read # => "some_secret: 123\nsome_namespace:\n another_secret: 456" +# +# my_config[:some_secret] +# # => 123 +# my_config.some_secret +# # => 123 +# my_config.dig(:some_namespace, :another_secret) +# # => 456 +# my_config.some_namespace.another_secret +# # => 456 +# my_config.fetch(:foo) +# # => KeyError +# my_config.foo! +# # => KeyError +# +# source://activesupport//lib/active_support/encrypted_configuration.rb#35 class ActiveSupport::EncryptedConfiguration < ::ActiveSupport::EncryptedFile # @return [EncryptedConfiguration] a new instance of EncryptedConfiguration # - # source://activesupport//lib/active_support/encrypted_configuration.rb#14 + # source://activesupport//lib/active_support/encrypted_configuration.rb#54 def initialize(config_path:, key_path:, env_key:, raise_if_missing_key:); end - # source://activesupport//lib/active_support/encrypted_configuration.rb#11 - def [](*_arg0, &_arg1); end - - # source://activesupport//lib/active_support/encrypted_configuration.rb#32 + # Returns the decrypted content as a Hash with symbolized keys. + # + # my_config = ActiveSupport::EncryptedConfiguration.new(...) + # my_config.read # => "some_secret: 123\nsome_namespace:\n another_secret: 456" + # + # my_config.config + # # => { some_secret: 123, some_namespace: { another_secret: 789 } } + # + # source://activesupport//lib/active_support/encrypted_configuration.rb#85 def config; end - # source://activesupport//lib/active_support/encrypted_configuration.rb#11 - def fetch(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/encrypted_configuration.rb#89 + def inspect; end - # source://activesupport//lib/active_support/core_ext/module/delegation.rb#302 - def method_missing(method, *args, &block); end + # source://activesupport//lib/active_support/encrypted_configuration.rb#52 + def method_missing(method, *_arg1, **_arg2, &_arg3); end - # Allow a config to be started without a file present + # Reads the file and returns the decrypted content. See EncryptedFile#read. # - # source://activesupport//lib/active_support/encrypted_configuration.rb#20 + # source://activesupport//lib/active_support/encrypted_configuration.rb#62 def read; end - # source://activesupport//lib/active_support/encrypted_configuration.rb#26 - def write(contents); end + # source://activesupport//lib/active_support/encrypted_configuration.rb#69 + def validate!; end private - # source://activesupport//lib/active_support/encrypted_configuration.rb#37 + # source://activesupport//lib/active_support/encrypted_configuration.rb#94 + def deep_symbolize_keys(hash); end + + # source://activesupport//lib/active_support/encrypted_configuration.rb#102 def deep_transform(hash); end - # source://activesupport//lib/active_support/encrypted_configuration.rb#51 - def deserialize(config); end + # source://activesupport//lib/active_support/encrypted_configuration.rb#116 + def deserialize(content); end - # source://activesupport//lib/active_support/encrypted_configuration.rb#47 + # source://activesupport//lib/active_support/encrypted_configuration.rb#112 def options; end - # source://activesupport//lib/active_support/core_ext/module/delegation.rb#294 + # source://activesupport//lib/active_support/encrypted_configuration.rb#52 def respond_to_missing?(name, include_private = T.unsafe(nil)); end end +# source://activesupport//lib/active_support/encrypted_configuration.rb#36 +class ActiveSupport::EncryptedConfiguration::InvalidContentError < ::RuntimeError + # @return [InvalidContentError] a new instance of InvalidContentError + # + # source://activesupport//lib/active_support/encrypted_configuration.rb#37 + def initialize(content_path); end + + # source://activesupport//lib/active_support/encrypted_configuration.rb#41 + def message; end +end + +# source://activesupport//lib/active_support/encrypted_configuration.rb#46 +class ActiveSupport::EncryptedConfiguration::InvalidKeyError < ::RuntimeError + # @return [InvalidKeyError] a new instance of InvalidKeyError + # + # source://activesupport//lib/active_support/encrypted_configuration.rb#47 + def initialize(content_path, key); end +end + # source://activesupport//lib/active_support/encrypted_file.rb#8 class ActiveSupport::EncryptedFile # @return [EncryptedFile] a new instance of EncryptedFile @@ -4560,7 +5821,7 @@ class ActiveSupport::EncryptedFile # source://activesupport//lib/active_support/encrypted_file.rb#42 def initialize(content_path:, key_path:, env_key:, raise_if_missing_key:); end - # source://activesupport//lib/active_support/encrypted_file.rb#77 + # source://activesupport//lib/active_support/encrypted_file.rb#83 def change(&block); end # Returns the value of attribute content_path. @@ -4581,6 +5842,14 @@ class ActiveSupport::EncryptedFile # source://activesupport//lib/active_support/encrypted_file.rb#52 def key; end + # Returns truthy if #key is truthy. Returns falsy otherwise. Unlike #key, + # does not raise MissingKeyError when +raise_if_missing_key+ is true. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/encrypted_file.rb#58 + def key?; end + # Returns the value of attribute key_path. # # source://activesupport//lib/active_support/encrypted_file.rb#40 @@ -4600,40 +5869,40 @@ class ActiveSupport::EncryptedFile # - ActiveSupport::MessageEncryptor::InvalidMessage if the content cannot be # decrypted or verified. # - # source://activesupport//lib/active_support/encrypted_file.rb#64 + # source://activesupport//lib/active_support/encrypted_file.rb#70 def read; end - # source://activesupport//lib/active_support/encrypted_file.rb#72 + # source://activesupport//lib/active_support/encrypted_file.rb#78 def write(contents); end private # @raise [InvalidKeyLengthError] # - # source://activesupport//lib/active_support/encrypted_file.rb#125 + # source://activesupport//lib/active_support/encrypted_file.rb#129 def check_key_length; end - # source://activesupport//lib/active_support/encrypted_file.rb#103 + # source://activesupport//lib/active_support/encrypted_file.rb#108 def decrypt(contents); end - # source://activesupport//lib/active_support/encrypted_file.rb#98 + # source://activesupport//lib/active_support/encrypted_file.rb#103 def encrypt(contents); end - # source://activesupport//lib/active_support/encrypted_file.rb#107 + # source://activesupport//lib/active_support/encrypted_file.rb#112 def encryptor; end # @raise [MissingKeyError] # - # source://activesupport//lib/active_support/encrypted_file.rb#121 + # source://activesupport//lib/active_support/encrypted_file.rb#125 def handle_missing_key; end - # source://activesupport//lib/active_support/encrypted_file.rb#112 + # source://activesupport//lib/active_support/encrypted_file.rb#117 def read_env_key; end - # source://activesupport//lib/active_support/encrypted_file.rb#116 + # source://activesupport//lib/active_support/encrypted_file.rb#121 def read_key_file; end - # source://activesupport//lib/active_support/encrypted_file.rb#83 + # source://activesupport//lib/active_support/encrypted_file.rb#89 def writing(contents); end class << self @@ -4689,24 +5958,47 @@ end # source://activesupport//lib/active_support/core_ext/enumerable.rb#25 ActiveSupport::EnumerableCoreExt::SoleItemExpectedError = Enumerable::SoleItemExpectedError -# source://activesupport//lib/active_support/environment_inquirer.rb#6 +# source://activesupport//lib/active_support/environment_inquirer.rb#9 class ActiveSupport::EnvironmentInquirer < ::ActiveSupport::StringInquirer + # @raise [ArgumentError] # @return [EnvironmentInquirer] a new instance of EnvironmentInquirer # - # source://activesupport//lib/active_support/environment_inquirer.rb#8 + # source://activesupport//lib/active_support/environment_inquirer.rb#15 def initialize(env); end + # source://activesupport//lib/active_support/environment_inquirer.rb#28 def development?; end + + # Returns true if we're in the development or test environment. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/environment_inquirer.rb#36 + def local?; end + + # source://activesupport//lib/active_support/environment_inquirer.rb#28 def production?; end + + # source://activesupport//lib/active_support/environment_inquirer.rb#28 def test?; end end -# source://activesupport//lib/active_support/environment_inquirer.rb#7 +# Optimization for the three default environments, so this inquirer doesn't need to rely on +# the slower delegation through method_missing that StringInquirer would normally entail. +# +# source://activesupport//lib/active_support/environment_inquirer.rb#10 ActiveSupport::EnvironmentInquirer::DEFAULT_ENVIRONMENTS = T.let(T.unsafe(nil), Array) +# Environments that'll respond true for #local? +# +# source://activesupport//lib/active_support/environment_inquirer.rb#13 +ActiveSupport::EnvironmentInquirer::LOCAL_ENVIRONMENTS = T.let(T.unsafe(nil), Array) + +# = Active Support \Error Reporter +# # +ActiveSupport::ErrorReporter+ is a common interface for error reporting services. # -# To rescue and report any unhandled error, you can use the +handle+ method: +# To rescue and report any unhandled error, you can use the #handle method: # # Rails.error.handle do # do_something! @@ -4714,147 +6006,822 @@ ActiveSupport::EnvironmentInquirer::DEFAULT_ENVIRONMENTS = T.let(T.unsafe(nil), # # If an error is raised, it will be reported and swallowed. # -# Alternatively if you want to report the error but not swallow it, you can use +record+ +# Alternatively, if you want to report the error but not swallow it, you can use #record: # # Rails.error.record do # do_something! # end # -# Both methods can be restricted to only handle a specific exception class +# Both methods can be restricted to handle only a specific error class: # # maybe_tags = Rails.error.handle(Redis::BaseError) { redis.get("tags") } # -# You can also pass some extra context information that may be used by the error subscribers: -# -# Rails.error.handle(context: { section: "admin" }) do -# # ... -# end -# -# Additionally a +severity+ can be passed along to communicate how important the error report is. -# +severity+ can be one of +:error+, +:warning+, or +:info+. Handled errors default to the +:warning+ -# severity, and unhandled ones to +:error+. -# -# Both +handle+ and +record+ pass through the return value from the block. In the case of +handle+ -# rescuing an error, a fallback can be provided. The fallback must be a callable whose result will -# be returned when the block raises and is handled: -# -# user = Rails.error.handle(fallback: -> { User.anonymous }) do -# User.find_by(params) -# end -# -# source://activesupport//lib/active_support/error_reporter.rb#41 +# source://activesupport//lib/active_support/error_reporter.rb#26 class ActiveSupport::ErrorReporter # @return [ErrorReporter] a new instance of ErrorReporter # - # source://activesupport//lib/active_support/error_reporter.rb#46 + # source://activesupport//lib/active_support/error_reporter.rb#35 def initialize(*subscribers, logger: T.unsafe(nil)); end - # Report any unhandled exception, and swallow it. + # Add a middleware to modify the error context before it is sent to subscribers. + # + # Middleware is added to a stack of callables run on an error's execution context + # before passing to subscribers. Allows creation of entries in error context that + # are shared by all subscribers. + # + # A context middleware receives the same parameters as #report. + # It must return a hash - the middleware stack returns the hash after it has + # run through all middlewares. A middleware can mutate or replace the hash. + # + # Rails.error.add_middleware(-> (error, context) { context.merge({ foo: :bar }) }) + # + # source://activesupport//lib/active_support/error_reporter.rb#218 + def add_middleware(middleware); end + + # Returns the value of attribute debug_mode. + # + # source://activesupport//lib/active_support/error_reporter.rb#31 + def debug_mode; end + + # Sets the attribute debug_mode + # + # @param value the value to set the attribute debug_mode to. + # + # source://activesupport//lib/active_support/error_reporter.rb#31 + def debug_mode=(_arg0); end + + # Prevent a subscriber from being notified of errors for the + # duration of the block. You may pass in the subscriber itself, or its class. + # + # This can be helpful for error reporting service integrations, when they wish + # to handle any errors higher in the stack. + # + # source://activesupport//lib/active_support/error_reporter.rb#186 + def disable(subscriber); end + + # Evaluates the given block, reporting and swallowing any unhandled error. + # If no error is raised, returns the return value of the block. Otherwise, + # returns the result of +fallback.call+, or +nil+ if +fallback+ is not + # specified. # + # # Will report a TypeError to all subscribers and return nil. # Rails.error.handle do # 1 + '1' # end # - # source://activesupport//lib/active_support/error_reporter.rb#57 - def handle(error_class = T.unsafe(nil), severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil)); end + # Can be restricted to handle only specific error classes: + # + # maybe_tags = Rails.error.handle(Redis::BaseError) { redis.get("tags") } + # + # ==== Options + # + # * +:severity+ - This value is passed along to subscribers to indicate how + # important the error report is. Can be +:error+, +:warning+, or +:info+. + # Defaults to +:warning+. + # + # * +:context+ - Extra information that is passed along to subscribers. For + # example: + # + # Rails.error.handle(context: { section: "admin" }) do + # # ... + # end + # + # * +:fallback+ - A callable that provides +handle+'s return value when an + # unhandled error is raised. For example: + # + # user = Rails.error.handle(fallback: -> { User.anonymous }) do + # User.find_by(params) + # end + # + # * +:source+ - This value is passed along to subscribers to indicate the + # source of the error. Subscribers can use this value to ignore certain + # errors. Defaults to "application". + # + # source://activesupport//lib/active_support/error_reporter.rb#79 + def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil)); end # Returns the value of attribute logger. # - # source://activesupport//lib/active_support/error_reporter.rb#44 + # source://activesupport//lib/active_support/error_reporter.rb#31 def logger; end # Sets the attribute logger # # @param value the value to set the attribute logger to. # - # source://activesupport//lib/active_support/error_reporter.rb#44 + # source://activesupport//lib/active_support/error_reporter.rb#31 def logger=(_arg0); end - # source://activesupport//lib/active_support/error_reporter.rb#64 - def record(error_class = T.unsafe(nil), severity: T.unsafe(nil), context: T.unsafe(nil)); end - - # When the block based +handle+ and +record+ methods are not suitable, you can directly use +report+ + # Evaluates the given block, reporting and re-raising any unhandled error. + # If no error is raised, returns the return value of the block. + # + # # Will report a TypeError to all subscribers and re-raise it. + # Rails.error.record do + # 1 + '1' + # end # - # Rails.error.report(error, handled: true) + # Can be restricted to handle only specific error classes: # - # source://activesupport//lib/active_support/error_reporter.rb#95 - def report(error, handled:, severity: T.unsafe(nil), context: T.unsafe(nil)); end - - # Update the execution context that is accessible to error subscribers + # tags = Rails.error.record(Redis::BaseError) { redis.get("tags") } # - # Rails.error.set_context(section: "checkout", user_id: @user.id) + # ==== Options + # + # * +:severity+ - This value is passed along to subscribers to indicate how + # important the error report is. Can be +:error+, +:warning+, or +:info+. + # Defaults to +:error+. + # + # * +:context+ - Extra information that is passed along to subscribers. For + # example: + # + # Rails.error.record(context: { section: "admin" }) do + # # ... + # end # - # See +ActiveSupport::ExecutionContext.set+ + # * +:source+ - This value is passed along to subscribers to indicate the + # source of the error. Subscribers can use this value to ignore certain + # errors. Defaults to "application". # - # source://activesupport//lib/active_support/error_reporter.rb#88 - def set_context(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/error_reporter.rb#115 + def record(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end - # Register a new error subscriber. The subscriber must respond to + # Report an error directly to subscribers. You can use this method when the + # block-based #handle and #record methods are not suitable. # - # report(Exception, handled: Boolean, context: Hash) + # Rails.error.report(error) # - # The +report+ method +should+ never raise an error. + # The +error+ argument must be an instance of Exception. # - # source://activesupport//lib/active_support/error_reporter.rb#76 - def subscribe(subscriber); end -end + # Rails.error.report(Exception.new("Something went wrong")) + # + # Otherwise you can use #unexpected to report an error which does accept a + # string argument. + # + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/error_reporter.rb#233 + def report(error, handled: T.unsafe(nil), severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end -# source://activesupport//lib/active_support/error_reporter.rb#42 + # Update the execution context that is accessible to error subscribers. Any + # context passed to #handle, #record, or #report will be merged with the + # context set here. + # + # Rails.error.set_context(section: "checkout", user_id: @user.id) + # + # source://activesupport//lib/active_support/error_reporter.rb#202 + def set_context(*_arg0, **_arg1, &_arg2); end + + # Register a new error subscriber. The subscriber must respond to + # + # report(Exception, handled: Boolean, severity: (:error OR :warning OR :info), context: Hash, source: String) + # + # The +report+ method should never raise an error. + # + # source://activesupport//lib/active_support/error_reporter.rb#162 + def subscribe(subscriber); end + + # Either report the given error when in production, or raise it when in development or test. + # + # When called in production, after the error is reported, this method will return + # nil and execution will continue. + # + # When called in development, the original error is wrapped in a different error class to ensure + # it's not being rescued higher in the stack and will be surfaced to the developer. + # + # This method is intended for reporting violated assertions about preconditions, or similar + # cases that can and should be gracefully handled in production, but that aren't supposed to happen. + # + # The error can be either an exception instance or a String. + # + # example: + # + # def edit + # if published? + # Rails.error.unexpected("[BUG] Attempting to edit a published article, that shouldn't be possible") + # return false + # end + # # ... + # end + # + # source://activesupport//lib/active_support/error_reporter.rb#146 + def unexpected(error, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end + + # Unregister an error subscriber. Accepts either a subscriber or a class. + # + # subscriber = MyErrorSubscriber.new + # Rails.error.subscribe(subscriber) + # + # Rails.error.unsubscribe(subscriber) + # # or + # Rails.error.unsubscribe(MyErrorSubscriber) + # + # source://activesupport//lib/active_support/error_reporter.rb#177 + def unsubscribe(subscriber); end + + private + + # source://activesupport//lib/active_support/error_reporter.rb#278 + def ensure_backtrace(error); end +end + +# source://activesupport//lib/active_support/error_reporter.rb#29 +ActiveSupport::ErrorReporter::DEFAULT_RESCUE = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/error_reporter.rb#28 +ActiveSupport::ErrorReporter::DEFAULT_SOURCE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/error_reporter.rb#298 +class ActiveSupport::ErrorReporter::ErrorContextMiddlewareStack + # @return [ErrorContextMiddlewareStack] a new instance of ErrorContextMiddlewareStack + # + # source://activesupport//lib/active_support/error_reporter.rb#299 + def initialize; end + + # Run all middlewares in the stack + # + # source://activesupport//lib/active_support/error_reporter.rb#313 + def execute(error, handled:, severity:, context:, source:); end + + # Add a middleware to the error context stack. + # + # source://activesupport//lib/active_support/error_reporter.rb#304 + def use(middleware); end +end + +# source://activesupport//lib/active_support/error_reporter.rb#27 ActiveSupport::ErrorReporter::SEVERITIES = T.let(T.unsafe(nil), Array) +# source://activesupport//lib/active_support/error_reporter.rb#33 +class ActiveSupport::ErrorReporter::UnexpectedError < ::Exception; end + +# source://activesupport//lib/active_support/event_reporter.rb#49 +class ActiveSupport::EventContext + class << self + # source://activesupport//lib/active_support/event_reporter.rb#65 + def clear; end + + # source://activesupport//lib/active_support/event_reporter.rb#54 + def context; end + + # source://activesupport//lib/active_support/event_reporter.rb#58 + def set_context(context_hash); end + end +end + +# source://activesupport//lib/active_support/event_reporter.rb#50 +ActiveSupport::EventContext::EMPTY_CONTEXT = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/event_reporter.rb#51 +ActiveSupport::EventContext::FIBER_KEY = T.let(T.unsafe(nil), Symbol) + +# = Active Support \Event Reporter +# +# +ActiveSupport::EventReporter+ provides an interface for reporting structured events to subscribers. +# +# To report an event, you can use the +notify+ method: +# +# Rails.event.notify("user_created", { id: 123 }) +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# The +notify+ API can receive either an event name and a payload hash, or an event object. Names are coerced to strings. +# +# === Event Objects +# +# If an event object is passed to the +notify+ API, it will be passed through to subscribers as-is, and the name of the +# object's class will be used as the event name. +# +# class UserCreatedEvent +# def initialize(id:, name:) +# @id = id +# @name = name +# end +# +# def serialize +# { +# id: @id, +# name: @name +# } +# end +# end +# +# Rails.event.notify(UserCreatedEvent.new(id: 123, name: "John Doe")) +# # Emits event: +# # { +# # name: "UserCreatedEvent", +# # payload: #, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# An event is any Ruby object representing a schematized event. While payload hashes allow arbitrary, +# implicitly-structured data, event objects are intended to enforce a particular schema. +# +# Subscribers are responsible for serializing event objects. +# +# === Subscribers +# +# Subscribers must implement the +emit+ method, which will be called with the event hash. +# +# The event hash has the following keys: +# +# name: String (The name of the event) +# payload: Hash, Object (The payload of the event, or the event object itself) +# tags: Hash (The tags of the event) +# context: Hash (The context of the event) +# timestamp: Float (The timestamp of the event, in nanoseconds) +# source_location: Hash (The source location of the event, containing the filepath, lineno, and label) +# +# Subscribers are responsible for encoding events to their desired format before emitting them to their +# target destination, such as a streaming platform, a log device, or an alerting service. +# +# class JSONEventSubscriber +# def emit(event) +# json_data = JSON.generate(event) +# LogExporter.export(json_data) +# end +# end +# +# class LogSubscriber +# def emit(event) +# payload = event[:payload].map { |key, value| "#{key}=#{value}" }.join(" ") +# source_location = event[:source_location] +# log = "[#{event[:name]}] #{payload} at #{source_location[:filepath]}:#{source_location[:lineno]}" +# Rails.logger.info(log) +# end +# end +# +# Note that event objects are passed through to subscribers as-is, and may need to be serialized before being encoded: +# +# class UserCreatedEvent +# def initialize(id:, name:) +# @id = id +# @name = name +# end +# +# def serialize +# { +# id: @id, +# name: @name +# } +# end +# end +# +# class LogSubscriber +# def emit(event) +# payload = event[:payload] +# json_data = JSON.generate(payload.serialize) +# LogExporter.export(json_data) +# end +# end +# +# ==== Filtered Subscriptions +# +# Subscribers can be configured with an optional filter proc to only receive a subset of events: +# +# # Only receive events with names starting with "user." +# Rails.event.subscribe(user_subscriber) { |event| event[:name].start_with?("user.") } +# +# # Only receive events with specific payload types +# Rails.event.subscribe(audit_subscriber) { |event| event[:payload].is_a?(AuditEvent) } +# +# === Debug Events +# +# You can use the +debug+ method to report an event that will only be reported if the +# event reporter is in debug mode: +# +# Rails.event.debug("my_debug_event", { foo: "bar" }) +# +# === Tags +# +# To add additional context to an event, separate from the event payload, you can add +# tags via the +tagged+ method: +# +# Rails.event.tagged("graphql") do +# Rails.event.notify("user_created", { id: 123 }) +# end +# +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # tags: { graphql: true }, +# # context: {}, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# === Context Store +# +# You may want to attach metadata to every event emitted by the reporter. While tags +# provide domain-specific context for a series of events, context is scoped to the job / request +# and should be used for metadata associated with the execution context. +# Context can be set via the +set_context+ method: +# +# Rails.event.set_context(request_id: "abcd123", user_agent: "TestAgent") +# Rails.event.notify("user_created", { id: 123 }) +# +# # Emits event: +# # { +# # name: "user_created", +# # payload: { id: 123 }, +# # tags: {}, +# # context: { request_id: "abcd123", user_agent: "TestAgent" }, +# # timestamp: 1738964843208679035, +# # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } +# # } +# +# Context is reset automatically before and after each request. +# +# A custom context store can be configured via +config.active_support.event_reporter_context_store+. +# +# # config/application.rb +# config.active_support.event_reporter_context_store = CustomContextStore +# +# class CustomContextStore +# class << self +# def context +# # Return the context. +# end +# +# def set_context(context_hash) +# # Append context_hash to the existing context store. +# end +# +# def clear +# # Delete the stored context. +# end +# end +# end +# +# The Event Reporter standardizes on symbol keys for all payload data, tags, and context store entries. +# String keys are automatically converted to symbols for consistency. +# +# Rails.event.notify("user.created", { "id" => 123 }) +# # Emits event: +# # { +# # name: "user.created", +# # payload: { id: 123 }, +# # } +# +# === Security +# +# When reporting events, Hash-based payloads are automatically filtered to remove sensitive data based on {Rails.application.filter_parameters}[https://guides.rubyonrails.org/configuring.html#config-filter-parameters]. +# +# If an {event object}[rdoc-ref:EventReporter@Event+Objects] is given instead, subscribers will need to filter sensitive data themselves, e.g. with ActiveSupport::ParameterFilter. +# +# source://activesupport//lib/active_support/event_reporter.rb#271 +class ActiveSupport::EventReporter + # @return [EventReporter] a new instance of EventReporter + # + # source://activesupport//lib/active_support/event_reporter.rb#286 + def initialize(*subscribers, raise_on_error: T.unsafe(nil)); end + + # Clears all context data. + # + # source://activesupport//lib/active_support/event_reporter.rb#525 + def clear_context; end + + # Returns the current context data. + # + # source://activesupport//lib/active_support/event_reporter.rb#530 + def context; end + + # Report an event only when in debug mode. For example: + # + # Rails.event.debug("sql.query", { sql: "SELECT * FROM users" }) + # + # ==== Arguments + # + # * +:payload+ - The event payload when using string/symbol event names. + # + # * +:caller_depth+ - The stack depth to use for source location (default: 1). + # + # * +:kwargs+ - Additional payload data when using string/symbol event names. + # + # source://activesupport//lib/active_support/event_reporter.rb#435 + def debug(name_or_object, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # source://activesupport//lib/active_support/event_reporter.rb#276 + def debug_mode=(_arg0); end + + # Check if debug mode is currently enabled. Debug mode is enabled on the reporter + # via +with_debug+, and in local environments. + # + # @return [Boolean] + # + # source://activesupport//lib/active_support/event_reporter.rb#420 + def debug_mode?; end + + # Reports an event to all registered subscribers. An event name and payload can be provided: + # + # Rails.event.notify("user.created", { id: 123 }) + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: {}, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # Alternatively, an event object can be provided: + # + # Rails.event.notify(UserCreatedEvent.new(id: 123)) + # # Emits event: + # # { + # # name: "UserCreatedEvent", + # # payload: #, + # # tags: {}, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # ==== Arguments + # + # * +:payload+ - The event payload when using string/symbol event names. + # + # * +:caller_depth+ - The stack depth to use for source location (default: 1). + # + # * +:kwargs+ - Additional payload data when using string/symbol event names. + # + # source://activesupport//lib/active_support/event_reporter.rb#363 + def notify(name_or_object, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # Sets whether to raise an error if a subscriber raises an error during + # event emission, or when unexpected arguments are passed to +notify+. + # + # source://activesupport//lib/active_support/event_reporter.rb#274 + def raise_on_error=(_arg0); end + + # source://activesupport//lib/active_support/event_reporter.rb#534 + def reload_payload_filter; end + + # Sets context data that will be included with all events emitted by the reporter. + # Context data should be scoped to the job or request, and is reset automatically + # before and after each request and job. + # + # Rails.event.set_context(user_agent: "TestAgent") + # Rails.event.set_context(job_id: "abc123") + # Rails.event.tagged("graphql") do + # Rails.event.notify("user_created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user_created", + # # payload: { id: 123 }, + # # tags: { graphql: true }, + # # context: { user_agent: "TestAgent", job_id: "abc123" }, + # # timestamp: 1738964843208679035 + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # source://activesupport//lib/active_support/event_reporter.rb#520 + def set_context(context); end + + # Registers a new event subscriber. The subscriber must respond to + # + # emit(event: Hash) + # + # The event hash will have the following keys: + # + # name: String (The name of the event) + # payload: Hash, Object (The payload of the event, or the event object itself) + # tags: Hash (The tags of the event) + # context: Hash (The context of the event) + # timestamp: Float (The timestamp of the event, in nanoseconds) + # source_location: Hash (The source location of the event, containing the filepath, lineno, and label) + # + # An optional filter proc can be provided to only receive a subset of events: + # + # Rails.event.subscribe(subscriber) { |event| event[:name].start_with?("user.") } + # Rails.event.subscribe(subscriber) { |event| event[:payload].is_a?(UserEvent) } + # + # source://activesupport//lib/active_support/event_reporter.rb#311 + def subscribe(subscriber, &filter); end + + # :nodoc + # + # source://activesupport//lib/active_support/event_reporter.rb#278 + def subscribers; end + + # Add tags to events to supply additional context. Tags operate in a stack-oriented manner, + # so all events emitted within the block inherit the same set of tags. For example: + # + # Rails.event.tagged("graphql") do + # Rails.event.notify("user.created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { graphql: true }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # Tags can be provided as arguments or as keyword arguments, and can be nested: + # + # Rails.event.tagged("graphql") do + # # Other code here... + # Rails.event.tagged(section: "admin") do + # Rails.event.notify("user.created", { id: 123 }) + # end + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { section: "admin", graphql: true }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # The +tagged+ API can also receive a tag object: + # + # graphql_tag = GraphqlTag.new(operation_name: "user_created", operation_type: "mutation") + # Rails.event.tagged(graphql_tag) do + # Rails.event.notify("user.created", { id: 123 }) + # end + # + # # Emits event: + # # { + # # name: "user.created", + # # payload: { id: 123 }, + # # tags: { "GraphqlTag": # }, + # # context: {}, + # # timestamp: 1738964843208679035, + # # source_location: { filepath: "path/to/file.rb", lineno: 123, label: "UserService#create" } + # # } + # + # source://activesupport//lib/active_support/event_reporter.rb#497 + def tagged(*args, **kwargs, &block); end + + # Unregister an event subscriber. Accepts either a subscriber or a class. + # + # subscriber = MyEventSubscriber.new + # Rails.event.subscribe(subscriber) + # + # Rails.event.unsubscribe(subscriber) + # # or + # Rails.event.unsubscribe(MyEventSubscriber) + # + # source://activesupport//lib/active_support/event_reporter.rb#326 + def unsubscribe(subscriber); end + + # Temporarily enables debug mode for the duration of the block. + # Calls to +debug+ will only be reported if debug mode is enabled. + # + # Rails.event.with_debug do + # Rails.event.debug("sql.query", { sql: "SELECT * FROM users" }) + # end + # + # source://activesupport//lib/active_support/event_reporter.rb#410 + def with_debug; end + + private + + # source://activesupport//lib/active_support/event_reporter.rb#544 + def context_store; end + + # source://activesupport//lib/active_support/event_reporter.rb#579 + def handle_unexpected_args(name_or_object, payload, kwargs); end + + # source://activesupport//lib/active_support/event_reporter.rb#548 + def payload_filter; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/event_reporter.rb#540 + def raise_on_error?; end + + # source://activesupport//lib/active_support/event_reporter.rb#555 + def resolve_name(name_or_object); end + + # source://activesupport//lib/active_support/event_reporter.rb#564 + def resolve_payload(name_or_object, payload, **kwargs); end + + class << self + # source://activesupport//lib/active_support/event_reporter.rb#281 + def context_store; end + + # source://activesupport//lib/active_support/event_reporter.rb#281 + def context_store=(_arg0); end + end +end + # source://activesupport//lib/active_support/execution_context.rb#4 module ActiveSupport::ExecutionContext class << self - # source://activesupport//lib/active_support/execution_context.rb#34 + # source://activesupport//lib/active_support/execution_context.rb#69 def []=(key, value); end - # source://activesupport//lib/active_support/execution_context.rb#7 + # source://activesupport//lib/active_support/execution_context.rb#40 def after_change(&block); end - # source://activesupport//lib/active_support/execution_context.rb#43 + # source://activesupport//lib/active_support/execution_context.rb#96 def clear; end + # source://activesupport//lib/active_support/execution_context.rb#100 + def current_attributes_instances; end + + # Returns the value of attribute nestable. + # + # source://activesupport//lib/active_support/execution_context.rb#38 + def nestable; end + + # Sets the attribute nestable + # + # @param value the value to set the attribute nestable to. + # + # source://activesupport//lib/active_support/execution_context.rb#38 + def nestable=(_arg0); end + + # source://activesupport//lib/active_support/execution_context.rb#87 + def pop; end + + # source://activesupport//lib/active_support/execution_context.rb#78 + def push; end + # Updates the execution context. If a block is given, it resets the provided keys to their # previous value once the block exits. # - # source://activesupport//lib/active_support/execution_context.rb#13 + # source://activesupport//lib/active_support/execution_context.rb#46 def set(**options); end - # source://activesupport//lib/active_support/execution_context.rb#39 + # source://activesupport//lib/active_support/execution_context.rb#74 def to_h; end private - # source://activesupport//lib/active_support/execution_context.rb#48 - def store; end + # source://activesupport//lib/active_support/execution_context.rb#105 + def record; end end end -# source://activesupport//lib/active_support/execution_wrapper.rb#8 +# source://activesupport//lib/active_support/execution_context.rb#5 +class ActiveSupport::ExecutionContext::Record + # @return [Record] a new instance of Record + # + # source://activesupport//lib/active_support/execution_context.rb#8 + def initialize; end + + # Returns the value of attribute current_attributes_instances. + # + # source://activesupport//lib/active_support/execution_context.rb#6 + def current_attributes_instances; end + + # source://activesupport//lib/active_support/execution_context.rb#21 + def pop; end + + # source://activesupport//lib/active_support/execution_context.rb#14 + def push; end + + # Returns the value of attribute store. + # + # source://activesupport//lib/active_support/execution_context.rb#6 + def store; end +end + +# source://activesupport//lib/active_support/execution_wrapper.rb#7 class ActiveSupport::ExecutionWrapper include ::ActiveSupport::Callbacks extend ::ActiveSupport::Callbacks::ClassMethods extend ::ActiveSupport::DescendantsTracker - # source://activesupport//lib/active_support/callbacks.rb#68 + # source://activesupport//lib/active_support/execution_wrapper.rb#8 def __callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#68 - def __callbacks?; end - - # source://activesupport//lib/active_support/callbacks.rb#940 + # source://activesupport//lib/active_support/execution_wrapper.rb#15 def _complete_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#940 + # source://activesupport//lib/active_support/execution_wrapper.rb#14 def _run_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#928 - def _run_complete_callbacks(&block); end + # source://activesupport//lib/active_support/execution_wrapper.rb#15 + def _run_complete_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#928 - def _run_run_callbacks(&block); end + # source://activesupport//lib/active_support/execution_wrapper.rb#15 + def _run_complete_callbacks!(&block); end + + # source://activesupport//lib/active_support/execution_wrapper.rb#14 + def _run_run_callbacks; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#14 + def _run_run_callbacks!(&block); end - # source://activesupport//lib/active_support/execution_wrapper.rb#142 + # source://activesupport//lib/active_support/execution_wrapper.rb#141 def complete; end # Complete this in-flight execution. This method *must* be called @@ -4862,54 +6829,51 @@ class ActiveSupport::ExecutionWrapper # # Where possible, prefer +wrap+. # - # source://activesupport//lib/active_support/execution_wrapper.rb#136 + # source://activesupport//lib/active_support/execution_wrapper.rb#135 def complete!; end - # source://activesupport//lib/active_support/execution_wrapper.rb#128 + # source://activesupport//lib/active_support/execution_wrapper.rb#127 def run; end - # source://activesupport//lib/active_support/execution_wrapper.rb#123 + # source://activesupport//lib/active_support/execution_wrapper.rb#122 def run!; end private - # source://activesupport//lib/active_support/execution_wrapper.rb#147 + # source://activesupport//lib/active_support/execution_wrapper.rb#146 def hook_state; end class << self - # source://activesupport//lib/active_support/callbacks.rb#68 + # source://activesupport//lib/active_support/execution_wrapper.rb#8 def __callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#68 + # source://activesupport//lib/active_support/execution_wrapper.rb#8 def __callbacks=(value); end - # source://activesupport//lib/active_support/callbacks.rb#68 - def __callbacks?; end - - # source://activesupport//lib/active_support/callbacks.rb#932 + # source://activesupport//lib/active_support/execution_wrapper.rb#15 def _complete_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#936 + # source://activesupport//lib/active_support/execution_wrapper.rb#15 def _complete_callbacks=(value); end - # source://activesupport//lib/active_support/callbacks.rb#932 + # source://activesupport//lib/active_support/execution_wrapper.rb#14 def _run_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#936 + # source://activesupport//lib/active_support/execution_wrapper.rb#14 def _run_callbacks=(value); end # @return [Boolean] # - # source://activesupport//lib/active_support/execution_wrapper.rb#119 + # source://activesupport//lib/active_support/execution_wrapper.rb#118 def active?; end - # source://activesupport//lib/active_support/execution_wrapper.rb#115 + # source://activesupport//lib/active_support/execution_wrapper.rb#114 def active_key; end - # source://activesupport//lib/active_support/execution_wrapper.rb#111 + # source://activesupport//lib/active_support/execution_wrapper.rb#110 def error_reporter; end - # source://activesupport//lib/active_support/execution_wrapper.rb#101 + # source://activesupport//lib/active_support/execution_wrapper.rb#100 def perform; end # Register an object to be invoked during both the +run+ and @@ -4921,7 +6885,7 @@ class ActiveSupport::ExecutionWrapper # a preceding +to_run+ block; all ordinary +to_complete+ blocks are # invoked in that situation.) # - # source://activesupport//lib/active_support/execution_wrapper.rb#51 + # source://activesupport//lib/active_support/execution_wrapper.rb#50 def register_hook(hook, outer: T.unsafe(nil)); end # Run this execution. @@ -4931,33 +6895,43 @@ class ActiveSupport::ExecutionWrapper # # Where possible, prefer +wrap+. # - # source://activesupport//lib/active_support/execution_wrapper.rb#67 + # source://activesupport//lib/active_support/execution_wrapper.rb#66 def run!(reset: T.unsafe(nil)); end - # source://activesupport//lib/active_support/execution_wrapper.rb#22 + # source://activesupport//lib/active_support/execution_wrapper.rb#21 def to_complete(*args, &block); end - # source://activesupport//lib/active_support/execution_wrapper.rb#18 + # source://activesupport//lib/active_support/execution_wrapper.rb#17 def to_run(*args, &block); end # Perform the work in the supplied block as an execution. # - # source://activesupport//lib/active_support/execution_wrapper.rb#87 - def wrap; end + # source://activesupport//lib/active_support/execution_wrapper.rb#86 + def wrap(source: T.unsafe(nil)); end + + private + + # source://activesupport//lib/active_support/execution_wrapper.rb#8 + def __class_attr___callbacks; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#8 + def __class_attr___callbacks=(new_value); end end end -# source://activesupport//lib/active_support/execution_wrapper.rb#33 +# source://activesupport//lib/active_support/execution_wrapper.rb#32 class ActiveSupport::ExecutionWrapper::CompleteHook < ::Struct - # source://activesupport//lib/active_support/execution_wrapper.rb#34 + # source://activesupport//lib/active_support/execution_wrapper.rb#39 def after(target); end - # source://activesupport//lib/active_support/execution_wrapper.rb#34 + # source://activesupport//lib/active_support/execution_wrapper.rb#33 def before(target); end # Returns the value of attribute hook # # @return [Object] the current value of hook + # + # source://activesupport//lib/active_support/execution_wrapper.rb#32 def hook; end # Sets the attribute hook @@ -4965,28 +6939,40 @@ class ActiveSupport::ExecutionWrapper::CompleteHook < ::Struct # @param value [Object] the value to set the attribute hook to. # @return [Object] the newly set value # - # source://activesupport//lib/active_support/execution_wrapper.rb#33 + # source://activesupport//lib/active_support/execution_wrapper.rb#32 def hook=(_); end class << self + # source://activesupport//lib/active_support/execution_wrapper.rb#32 def [](*_arg0); end + + # source://activesupport//lib/active_support/execution_wrapper.rb#32 def inspect; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#32 + def keyword_init?; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#32 def members; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#32 def new(*_arg0); end end end -# source://activesupport//lib/active_support/execution_wrapper.rb#11 +# source://activesupport//lib/active_support/execution_wrapper.rb#10 ActiveSupport::ExecutionWrapper::Null = T.let(T.unsafe(nil), Object) -# source://activesupport//lib/active_support/execution_wrapper.rb#26 +# source://activesupport//lib/active_support/execution_wrapper.rb#25 class ActiveSupport::ExecutionWrapper::RunHook < ::Struct - # source://activesupport//lib/active_support/execution_wrapper.rb#27 + # source://activesupport//lib/active_support/execution_wrapper.rb#26 def before(target); end # Returns the value of attribute hook # # @return [Object] the current value of hook + # + # source://activesupport//lib/active_support/execution_wrapper.rb#25 def hook; end # Sets the attribute hook @@ -4994,13 +6980,23 @@ class ActiveSupport::ExecutionWrapper::RunHook < ::Struct # @param value [Object] the value to set the attribute hook to. # @return [Object] the newly set value # - # source://activesupport//lib/active_support/execution_wrapper.rb#26 + # source://activesupport//lib/active_support/execution_wrapper.rb#25 def hook=(_); end class << self + # source://activesupport//lib/active_support/execution_wrapper.rb#25 def [](*_arg0); end + + # source://activesupport//lib/active_support/execution_wrapper.rb#25 def inspect; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#25 + def keyword_init?; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#25 def members; end + + # source://activesupport//lib/active_support/execution_wrapper.rb#25 def new(*_arg0); end end end @@ -5008,7 +7004,9 @@ end # source://activesupport//lib/active_support/executor.rb#6 class ActiveSupport::Executor < ::ActiveSupport::ExecutionWrapper; end -# FileUpdateChecker specifies the API used by Rails to watch files +# = \File Update Checker +# +# FileUpdateChecker specifies the API used by \Rails to watch files # and control reloading. The API depends on four methods: # # * +initialize+ which expects two parameters and one block as @@ -5025,7 +7023,7 @@ class ActiveSupport::Executor < ::ActiveSupport::ExecutionWrapper; end # After initialization, a call to +execute_if_updated+ must execute # the block only if there was really a change in the filesystem. # -# This class is used by Rails to reload the I18n framework whenever +# This class is used by \Rails to reload the I18n framework whenever # they are changed upon a new request. # # i18n_reloader = ActiveSupport::FileUpdateChecker.new(paths) do @@ -5036,7 +7034,7 @@ class ActiveSupport::Executor < ::ActiveSupport::ExecutionWrapper; end # i18n_reloader.execute_if_updated # end # -# source://activesupport//lib/active_support/file_update_checker.rb#33 +# source://activesupport//lib/active_support/file_update_checker.rb#35 class ActiveSupport::FileUpdateChecker # It accepts two parameters on initialization. The first is an array # of files and the second is an optional hash of directories. The hash must @@ -5049,18 +7047,18 @@ class ActiveSupport::FileUpdateChecker # # @return [FileUpdateChecker] a new instance of FileUpdateChecker # - # source://activesupport//lib/active_support/file_update_checker.rb#42 + # source://activesupport//lib/active_support/file_update_checker.rb#44 def initialize(files, dirs = T.unsafe(nil), &block); end # Executes the given block and updates the latest watched files and # timestamp. # - # source://activesupport//lib/active_support/file_update_checker.rb#80 + # source://activesupport//lib/active_support/file_update_checker.rb#85 def execute; end # Execute the block given if updated. # - # source://activesupport//lib/active_support/file_update_checker.rb#90 + # source://activesupport//lib/active_support/file_update_checker.rb#95 def execute_if_updated; end # Check if any of the entries were updated. If so, the watched and/or @@ -5069,18 +7067,18 @@ class ActiveSupport::FileUpdateChecker # # @return [Boolean] # - # source://activesupport//lib/active_support/file_update_checker.rb#61 + # source://activesupport//lib/active_support/file_update_checker.rb#66 def updated?; end private - # source://activesupport//lib/active_support/file_update_checker.rb#156 + # source://activesupport//lib/active_support/file_update_checker.rb#160 def compile_ext(array); end - # source://activesupport//lib/active_support/file_update_checker.rb#142 + # source://activesupport//lib/active_support/file_update_checker.rb#147 def compile_glob(hash); end - # source://activesupport//lib/active_support/file_update_checker.rb#152 + # source://activesupport//lib/active_support/file_update_checker.rb#156 def escape(key); end # This method returns the maximum mtime of the files in +paths+, or +nil+ @@ -5091,48 +7089,41 @@ class ActiveSupport::FileUpdateChecker # healthy to consider this edge case because with mtimes in the future # reloading is not triggered. # - # source://activesupport//lib/active_support/file_update_checker.rb#120 + # source://activesupport//lib/active_support/file_update_checker.rb#125 def max_mtime(paths); end - # source://activesupport//lib/active_support/file_update_checker.rb#109 + # source://activesupport//lib/active_support/file_update_checker.rb#114 def updated_at(paths); end - # source://activesupport//lib/active_support/file_update_checker.rb#101 + # source://activesupport//lib/active_support/file_update_checker.rb#106 def watched; end end # source://activesupport//lib/active_support/fork_tracker.rb#4 module ActiveSupport::ForkTracker class << self - # source://activesupport//lib/active_support/fork_tracker.rb#59 + # source://activesupport//lib/active_support/fork_tracker.rb#31 def after_fork(&block); end - # source://activesupport//lib/active_support/fork_tracker.rb#40 - def check!; end + # source://activesupport//lib/active_support/fork_tracker.rb#19 + def after_fork_callback; end - # source://activesupport//lib/active_support/fork_tracker.rb#48 + # source://activesupport//lib/active_support/fork_tracker.rb#27 def hook!; end - # source://activesupport//lib/active_support/fork_tracker.rb#64 + # source://activesupport//lib/active_support/fork_tracker.rb#36 def unregister(callback); end end end -# source://activesupport//lib/active_support/fork_tracker.rb#15 -module ActiveSupport::ForkTracker::CoreExt - # source://activesupport//lib/active_support/fork_tracker.rb#16 - def fork(*_arg0, &_arg1); end -end - -# source://activesupport//lib/active_support/fork_tracker.rb#31 -module ActiveSupport::ForkTracker::CoreExtPrivate; end - # source://activesupport//lib/active_support/fork_tracker.rb#5 -module ActiveSupport::ForkTracker::ModernCoreExt +module ActiveSupport::ForkTracker::CoreExt # source://activesupport//lib/active_support/fork_tracker.rb#6 def _fork; end end +# = Active Support \Gzip +# # A convenient wrapper for the zlib standard library that allows # compression/decompression of strings with gzip. # @@ -5142,32 +7133,34 @@ end # ActiveSupport::Gzip.decompress(gzip) # # => "compress me!" # -# source://activesupport//lib/active_support/gzip.rb#15 +# source://activesupport//lib/active_support/gzip.rb#17 module ActiveSupport::Gzip class << self # Compresses a string using gzip. # - # source://activesupport//lib/active_support/gzip.rb#30 + # source://activesupport//lib/active_support/gzip.rb#32 def compress(source, level = T.unsafe(nil), strategy = T.unsafe(nil)); end # Decompresses a gzipped string. # - # source://activesupport//lib/active_support/gzip.rb#25 + # source://activesupport//lib/active_support/gzip.rb#27 def decompress(source); end end end -# source://activesupport//lib/active_support/gzip.rb#16 +# source://activesupport//lib/active_support/gzip.rb#18 class ActiveSupport::Gzip::Stream < ::StringIO # @return [Stream] a new instance of Stream # - # source://activesupport//lib/active_support/gzip.rb#17 + # source://activesupport//lib/active_support/gzip.rb#19 def initialize(*_arg0); end - # source://activesupport//lib/active_support/gzip.rb#21 + # source://activesupport//lib/active_support/gzip.rb#23 def close; end end +# = \Hash With Indifferent Access +# # Implements a hash where keys :foo and "foo" are considered # to be the same. # @@ -5199,7 +7192,7 @@ end # # but this class is intended for use cases where strings or symbols are the # expected keys and it is convenient to understand both as the same. For -# example the +params+ hash in Ruby on Rails. +# example the +params+ hash in Ruby on \Rails. # # Note that core extensions define Hash#with_indifferent_access: # @@ -5207,7 +7200,7 @@ end # # which may be handy. # -# To access this class outside of Rails, require the core extension with: +# To access this class outside of \Rails, require the core extension with: # # require "active_support/core_ext/hash/indifferent_access" # @@ -5217,7 +7210,7 @@ end class ActiveSupport::HashWithIndifferentAccess < ::Hash # @return [HashWithIndifferentAccess] a new instance of HashWithIndifferentAccess # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#68 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#70 def initialize(constructor = T.unsafe(nil)); end # Same as Hash#[] where the key passed as argument can be @@ -5230,7 +7223,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # counters[:foo] # => 1 # counters[:zoo] # => nil # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#166 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#184 def [](key); end # Assigns a new value to the hash: @@ -5240,7 +7233,10 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # # This value can be later fetched using either +:key+ or 'key'. # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#96 + # If the value is a Hash or contains one or multiple Hashes, they will be + # converted to +HashWithIndifferentAccess+. + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#101 def []=(key, value); end # Same as Hash#assoc where the key passed as argument can be @@ -5253,19 +7249,13 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # counters.assoc(:foo) # => ["foo", 1] # counters.assoc(:zoo) # => nil # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#179 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#197 def assoc(key); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#357 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#390 def compact; end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#311 - def deep_stringify_keys; end - - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#309 - def deep_stringify_keys!; end - - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#316 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#334 def deep_symbolize_keys; end # Same as Hash#default where the key passed as argument can be @@ -5279,12 +7269,12 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash.default('foo') # => 'foo' # hash.default(:foo) # => 'foo' # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#221 - def default(*args); end + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#239 + def default(key = T.unsafe(nil)); end # Removes the specified key from the hash. # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#295 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#317 def delete(key); end # Same as Hash#dig where the key passed as argument can be @@ -5297,7 +7287,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # counters.dig(:foo, :bar) # => 1 # counters.dig(:zoo) # => nil # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#206 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#224 def dig(*args); end # Returns a shallow copy of the hash. @@ -5309,7 +7299,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash[:a][:c] # => "c" # dup[:a][:c] # => "c" # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#256 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#280 def dup; end # Returns a hash with indifferent access that includes everything except given keys. @@ -5317,7 +7307,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash.except(:a, "b") # => {c: 10}.with_indifferent_access # hash # => { a: "x", b: "y", c: 10 }.with_indifferent_access # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#303 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#325 def except(*keys); end # Returns +true+ so that Array#extract_options! finds members of @@ -5325,7 +7315,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # # @return [Boolean] # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#56 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#58 def extractable_options?; end # Same as Hash#fetch where the key passed as argument can be @@ -5339,7 +7329,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # counters.fetch(:bar) { |key| 0 } # => 0 # counters.fetch(:zoo) # => KeyError: key not found: "zoo" # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#193 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#211 def fetch(key, *extras); end # Returns an array of the values at the specified indices, but also @@ -5352,7 +7342,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash.fetch_values('a', 'c') { |key| 'z' } # => ["x", "z"] # hash.fetch_values('a', 'c') # => KeyError: key not found: "c" # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#244 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#267 def fetch_values(*indices, &block); end # Checks the hash for a key matching the argument passed in: @@ -5364,7 +7354,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # # @return [Boolean] # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#149 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#172 def has_key?(key); end # Checks the hash for a key matching the argument passed in: @@ -5376,7 +7366,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # # @return [Boolean] # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#149 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#171 def include?(key); end # Checks the hash for a key matching the argument passed in: @@ -5388,7 +7378,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # # @return [Boolean] # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#149 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#167 def key?(key); end # Checks the hash for a key matching the argument passed in: @@ -5400,14 +7390,14 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # # @return [Boolean] # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#149 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#173 def member?(key); end # This method has the same semantics of +update+, except it does not # modify the receiver but rather returns a new hash with indifferent # access with the result of the merge. # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#265 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#287 def merge(*hashes, &block); end # Updates the receiver in-place, merging in the hashes passed as arguments: @@ -5424,7 +7414,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash.update({ "a" => 1 }, { "b" => 2 }) # => { "a" => 1, "b" => 2 } # # The arguments can be either an - # ActiveSupport::HashWithIndifferentAccess or a regular +Hash+. + # +ActiveSupport::HashWithIndifferentAccess+ or a regular +Hash+. # In either case the merge respects the semantics of indifferent access. # # If the argument is a regular hash with keys +:key+ and "key" only one @@ -5439,16 +7429,19 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash_2['key'] = 12 # hash_1.update(hash_2) { |key, old, new| old + new } # => {"key"=>22} # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#130 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#159 def merge!(*other_hashes, &block); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#64 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#66 def nested_under_indifferent_access; end + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#90 def regular_update(*_arg0); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#89 def regular_writer(_arg0, _arg1); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#324 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#342 def reject(*args, &block); end # Replaces the contents of this hash with other_hash. @@ -5456,7 +7449,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # h = { "a" => 100, "b" => 200 } # h.replace({ "c" => 300, "d" => 400 }) # => {"c"=>300, "d"=>400} # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#290 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#312 def replace(other_hash); end # Like +merge+ but the other way around: Merges the receiver into the @@ -5466,21 +7459,21 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash['a'] = nil # hash.reverse_merge(a: 0, b: 1) # => {"a"=>nil, "b"=>1} # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#275 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#297 def reverse_merge(other_hash); end # Same semantics as +reverse_merge+ but modifies the receiver in-place. # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#281 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#303 def reverse_merge!(other_hash); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#319 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#337 def select(*args, &block); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#347 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#380 def slice(*keys); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#352 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#385 def slice!(*keys); end # Assigns a new value to the hash: @@ -5490,37 +7483,38 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # # This value can be later fetched using either +:key+ or 'key'. # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#96 - def store(key, value); end - - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#310 - def stringify_keys; end - - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#308 - def stringify_keys!; end + # If the value is a Hash or contains one or multiple Hashes, they will be + # converted to +HashWithIndifferentAccess+. unless `convert_value: false` + # is set. + # + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#115 + def store(key, value, convert_value: T.unsafe(nil)); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#314 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#332 def symbolize_keys; end # Convert to a regular hash with string keys. # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#362 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#395 def to_hash; end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#314 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#333 def to_options; end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#317 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#335 def to_options!; end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#334 - def transform_keys(*args, &block); end + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#401 + def to_proc; end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#339 - def transform_keys!; end + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#354 + def transform_keys(hash = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#329 - def transform_values(*args, &block); end + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#366 + def transform_keys!(hash = T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#347 + def transform_values(&block); end # Updates the receiver in-place, merging in the hashes passed as arguments: # @@ -5536,7 +7530,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash.update({ "a" => 1 }, { "b" => 2 }) # => { "a" => 1, "b" => 2 } # # The arguments can be either an - # ActiveSupport::HashWithIndifferentAccess or a regular +Hash+. + # +ActiveSupport::HashWithIndifferentAccess+ or a regular +Hash+. # In either case the merge respects the semantics of indifferent access. # # If the argument is a regular hash with keys +:key+ and "key" only one @@ -5551,7 +7545,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash_2['key'] = 12 # hash_1.update(hash_2) { |key, old, new| old + new } # => {"key"=>22} # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#130 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#148 def update(*other_hashes, &block); end # Returns an array of the values at the specified indices: @@ -5561,7 +7555,7 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash[:b] = 'y' # hash.values_at('a', 'b') # => ["x", "y"] # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#231 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#253 def values_at(*keys); end # Like +merge+ but the other way around: Merges the receiver into the @@ -5571,15 +7565,15 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash['a'] = nil # hash.reverse_merge(a: 0, b: 1) # => {"a"=>nil, "b"=>1} # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#275 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#300 def with_defaults(other_hash); end # Same semantics as +reverse_merge+ but modifies the receiver in-place. # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#281 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#306 def with_defaults!(other_hash); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#60 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#62 def with_indifferent_access; end # Returns a hash with indifferent access that includes everything except given keys. @@ -5587,67 +7581,78 @@ class ActiveSupport::HashWithIndifferentAccess < ::Hash # hash.except(:a, "b") # => {c: 10}.with_indifferent_access # hash # => { a: "x", b: "y", c: 10 }.with_indifferent_access # - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#303 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#328 def without(*keys); end private - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#378 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#406 + def cast(other); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#410 def convert_key(key); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#383 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#414 def convert_value(value, conversion: T.unsafe(nil)); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#400 - def set_defaults(target); end + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#427 + def convert_value_to_hash(value); end - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#408 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#438 + def copy_defaults(target); end + + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#447 def update_with_single_argument(other_hash, block); end class << self - # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#83 + # source://activesupport//lib/active_support/hash_with_indifferent_access.rb#85 def [](*args); end end end +# source://activesupport//lib/active_support/hash_with_indifferent_access.rb#352 +ActiveSupport::HashWithIndifferentAccess::NOT_GIVEN = T.let(T.unsafe(nil), Object) + # source://activesupport//lib/active_support/html_safe_translation.rb#4 module ActiveSupport::HtmlSafeTranslation extend ::ActiveSupport::HtmlSafeTranslation + # @return [Boolean] + # + # source://activesupport//lib/active_support/html_safe_translation.rb#30 + def html_safe_translation_key?(key); end + # source://activesupport//lib/active_support/html_safe_translation.rb#7 def translate(key, **options); end private - # source://activesupport//lib/active_support/html_safe_translation.rb#22 + # source://activesupport//lib/active_support/html_safe_translation.rb#35 def html_escape_translation_options(options); end - # source://activesupport//lib/active_support/html_safe_translation.rb#35 + # source://activesupport//lib/active_support/html_safe_translation.rb#48 def html_safe_translation(translation); end # @return [Boolean] # - # source://activesupport//lib/active_support/html_safe_translation.rb#18 - def html_safe_translation_key?(key); end - - # @return [Boolean] - # - # source://activesupport//lib/active_support/html_safe_translation.rb#30 + # source://activesupport//lib/active_support/html_safe_translation.rb#43 def i18n_option?(name); end end +# = Active Support \Inflector +# # The Inflector transforms words from singular to plural, class names to table # names, modularized class names to ones without, and class names to foreign # keys. The default inflections for pluralization, singularization, and # uncountable words are kept in inflections.rb. # -# The Rails core team has stated patches for the inflections library will not +# The \Rails core team has stated patches for the inflections library will not # be accepted in order to avoid breaking legacy applications which may be # relying on errant inflections. If you discover an incorrect inflection and # require it for your application or wish to define rules for languages other # than English, please correct or add them yourself (explained below). # -# source://activesupport//lib/active_support/inflector/inflections.rb#7 +# source://activesupport//lib/active_support/inflector/inflections.rb#8 module ActiveSupport::Inflector extend ::ActiveSupport::Inflector @@ -5668,12 +7673,12 @@ module ActiveSupport::Inflector # # camelize(underscore('SSLError')) # => "SslError" # - # source://activesupport//lib/active_support/inflector/methods.rb#69 + # source://activesupport//lib/active_support/inflector/methods.rb#70 def camelize(term, uppercase_first_letter = T.unsafe(nil)); end - # Creates a class name from a plural table name like Rails does for table - # names to models. Note that this returns a string and not a Class (To - # convert to an actual class follow +classify+ with #constantize). + # Creates a class name from a plural table name like \Rails does for table + # names to models. Note that this returns a string and not a Class. (To + # convert to an actual class follow +classify+ with #constantize.) # # classify('ham_and_eggs') # => "HamAndEgg" # classify('posts') # => "Post" @@ -5682,7 +7687,7 @@ module ActiveSupport::Inflector # # classify('calculus') # => "Calculu" # - # source://activesupport//lib/active_support/inflector/methods.rb#208 + # source://activesupport//lib/active_support/inflector/methods.rb#218 def classify(table_name); end # Tries to find a constant with the name specified in the argument string. @@ -5704,14 +7709,14 @@ module ActiveSupport::Inflector # NameError is raised when the name is not in CamelCase or the constant is # unknown. # - # source://activesupport//lib/active_support/inflector/methods.rb#279 + # source://activesupport//lib/active_support/inflector/methods.rb#289 def constantize(camel_cased_word); end # Replaces underscores with dashes in the string. # # dasherize('puni_puni') # => "puni-puni" # - # source://activesupport//lib/active_support/inflector/methods.rb#216 + # source://activesupport//lib/active_support/inflector/methods.rb#226 def dasherize(underscored_word); end # Removes the rightmost segment from the constant expression in the string. @@ -5724,7 +7729,7 @@ module ActiveSupport::Inflector # # See also #demodulize. # - # source://activesupport//lib/active_support/inflector/methods.rb#246 + # source://activesupport//lib/active_support/inflector/methods.rb#256 def deconstantize(path); end # Removes the module part from the expression in the string. @@ -5736,9 +7741,18 @@ module ActiveSupport::Inflector # # See also #deconstantize. # - # source://activesupport//lib/active_support/inflector/methods.rb#228 + # source://activesupport//lib/active_support/inflector/methods.rb#238 def demodulize(path); end + # Converts the first character in the string to lowercase. + # + # downcase_first('If they enjoyed The Matrix') # => "if they enjoyed The Matrix" + # downcase_first('I') # => "i" + # downcase_first('') # => "" + # + # source://activesupport//lib/active_support/inflector/methods.rb#175 + def downcase_first(string); end + # Creates a foreign key name from a class name. # +separate_class_name_and_id_with_underscore+ sets whether # the method should put '_' between the name and 'id'. @@ -5747,7 +7761,7 @@ module ActiveSupport::Inflector # foreign_key('Message', false) # => "messageid" # foreign_key('Admin::Post') # => "post_id" # - # source://activesupport//lib/active_support/inflector/methods.rb#257 + # source://activesupport//lib/active_support/inflector/methods.rb#267 def foreign_key(class_name, separate_class_name_and_id_with_underscore = T.unsafe(nil)); end # Tweaks an attribute name for display to end users. @@ -5776,7 +7790,7 @@ module ActiveSupport::Inflector # # humanize('ssl_error') # => "SSL error" # - # source://activesupport//lib/active_support/inflector/methods.rb#132 + # source://activesupport//lib/active_support/inflector/methods.rb#135 def humanize(lower_case_and_underscored_word, capitalize: T.unsafe(nil), keep_id_suffix: T.unsafe(nil)); end # Yields a singleton instance of Inflector::Inflections so you can specify @@ -5788,7 +7802,7 @@ module ActiveSupport::Inflector # inflect.uncountable 'rails' # end # - # source://activesupport//lib/active_support/inflector/inflections.rb#263 + # source://activesupport//lib/active_support/inflector/inflections.rb#282 def inflections(locale = T.unsafe(nil)); end # Returns the suffix that should be added to a number to denote the position @@ -5801,7 +7815,7 @@ module ActiveSupport::Inflector # ordinal(-11) # => "th" # ordinal(-1021) # => "st" # - # source://activesupport//lib/active_support/inflector/methods.rb#324 + # source://activesupport//lib/active_support/inflector/methods.rb#334 def ordinal(number); end # Turns a number into an ordinal string used to denote the position in an @@ -5814,7 +7828,7 @@ module ActiveSupport::Inflector # ordinalize(-11) # => "-11th" # ordinalize(-1021) # => "-1021st" # - # source://activesupport//lib/active_support/inflector/methods.rb#337 + # source://activesupport//lib/active_support/inflector/methods.rb#347 def ordinalize(number); end # Replaces special characters in a string so that it may be used as part of @@ -5844,7 +7858,7 @@ module ActiveSupport::Inflector # By default, this parameter is set to nil and it will use # the configured I18n.locale. # - # source://activesupport//lib/active_support/inflector/transliterate.rb#121 + # source://activesupport//lib/active_support/inflector/transliterate.rb#123 def parameterize(string, separator: T.unsafe(nil), preserve_case: T.unsafe(nil), locale: T.unsafe(nil)); end # Returns the plural form of the word in the string. @@ -5860,7 +7874,7 @@ module ActiveSupport::Inflector # pluralize('CamelOctopus') # => "CamelOctopi" # pluralize('ley', :es) # => "leyes" # - # source://activesupport//lib/active_support/inflector/methods.rb#32 + # source://activesupport//lib/active_support/inflector/methods.rb#33 def pluralize(word, locale = T.unsafe(nil)); end # Tries to find a constant with the name specified in the argument string. @@ -5886,7 +7900,7 @@ module ActiveSupport::Inflector # safe_constantize('UnknownModule') # => nil # safe_constantize('UnknownModule::Foo::Bar') # => nil # - # source://activesupport//lib/active_support/inflector/methods.rb#305 + # source://activesupport//lib/active_support/inflector/methods.rb#315 def safe_constantize(camel_cased_word); end # The reverse of #pluralize, returns the singular form of a word in a @@ -5903,36 +7917,34 @@ module ActiveSupport::Inflector # singularize('CamelOctopi') # => "CamelOctopus" # singularize('leyes', :es) # => "ley" # - # source://activesupport//lib/active_support/inflector/methods.rb#49 + # source://activesupport//lib/active_support/inflector/methods.rb#50 def singularize(word, locale = T.unsafe(nil)); end - # Creates the name of a table like Rails does for models to table names. + # Creates the name of a table like \Rails does for models to table names. # This method uses the #pluralize method on the last word in the string. # # tableize('RawScaledScorer') # => "raw_scaled_scorers" # tableize('ham_and_egg') # => "ham_and_eggs" # tableize('fancyCategory') # => "fancy_categories" # - # source://activesupport//lib/active_support/inflector/methods.rb#194 + # source://activesupport//lib/active_support/inflector/methods.rb#204 def tableize(class_name); end # Capitalizes all the words and replaces some characters in the string to # create a nicer looking title. +titleize+ is meant for creating pretty - # output. It is not used in the Rails internals. + # output. It is not used in the \Rails internals. # # The trailing '_id','Id'.. can be kept and capitalized by setting the # optional parameter +keep_id_suffix+ to true. # By default, this parameter is false. # - # +titleize+ is also aliased as +titlecase+. - # # titleize('man from the boondocks') # => "Man From The Boondocks" # titleize('x-men: the last stand') # => "X Men: The Last Stand" # titleize('TheManWithoutAPast') # => "The Man Without A Past" # titleize('raiders_of_the_lost_ark') # => "Raiders Of The Lost Ark" # titleize('string_ending_with_id', keep_id_suffix: true) # => "String Ending With Id" # - # source://activesupport//lib/active_support/inflector/methods.rb#182 + # source://activesupport//lib/active_support/inflector/methods.rb#192 def titleize(word, keep_id_suffix: T.unsafe(nil)); end # Replaces non-ASCII characters with an ASCII approximation, or if none @@ -6007,16 +8019,16 @@ module ActiveSupport::Inflector # # camelize(underscore('SSLError')) # => "SslError" # - # source://activesupport//lib/active_support/inflector/methods.rb#96 + # source://activesupport//lib/active_support/inflector/methods.rb#99 def underscore(camel_cased_word); end - # Converts just the first character to uppercase. + # Converts the first character in the string to uppercase. # # upcase_first('what a Lovely Day') # => "What a Lovely Day" # upcase_first('w') # => "W" # upcase_first('') # => "" # - # source://activesupport//lib/active_support/inflector/methods.rb#163 + # source://activesupport//lib/active_support/inflector/methods.rb#166 def upcase_first(string); end private @@ -6026,10 +8038,10 @@ module ActiveSupport::Inflector # If passed an optional +locale+ parameter, the uncountables will be # found for that locale. # - # apply_inflections('post', inflections.plurals, :en) # => "posts" - # apply_inflections('posts', inflections.singulars, :en) # => "post" + # apply_inflections('post', inflections.plurals, :en) # => "posts" + # apply_inflections('posts', inflections.singulars, :en) # => "post" # - # source://activesupport//lib/active_support/inflector/methods.rb#366 + # source://activesupport//lib/active_support/inflector/methods.rb#376 def apply_inflections(word, rules, locale = T.unsafe(nil)); end # Mounts a regular expression, returned as a string to ease interpolation, @@ -6038,13 +8050,15 @@ module ActiveSupport::Inflector # const_regexp("Foo::Bar::Baz") # => "Foo(::Bar(::Baz)?)?" # const_regexp("::") # => "::" # - # source://activesupport//lib/active_support/inflector/methods.rb#347 + # source://activesupport//lib/active_support/inflector/methods.rb#357 def const_regexp(camel_cased_word); end end # source://activesupport//lib/active_support/inflector/transliterate.rb#8 ActiveSupport::Inflector::ALLOWED_ENCODINGS_FOR_TRANSLITERATE = T.let(T.unsafe(nil), Array) +# = Active Support \Inflections +# # A singleton instance of this class is yielded by Inflector.inflections, # which can then be used to specify additional inflection rules. If passed # an optional locale, rules for other languages can be specified. The @@ -6064,11 +8078,11 @@ ActiveSupport::Inflector::ALLOWED_ENCODINGS_FOR_TRANSLITERATE = T.let(T.unsafe(n # singularization rules that is runs. This guarantees that your rules run # before any of the rules that may already have been loaded. # -# source://activesupport//lib/active_support/inflector/inflections.rb#28 +# source://activesupport//lib/active_support/inflector/inflections.rb#31 class ActiveSupport::Inflector::Inflections # @return [Inflections] a new instance of Inflections # - # source://activesupport//lib/active_support/inflector/inflections.rb#78 + # source://activesupport//lib/active_support/inflector/inflections.rb#97 def initialize; end # Specifies a new acronym. An acronym must be specified as it will appear @@ -6121,18 +8135,18 @@ class ActiveSupport::Inflector::Inflections # underscore 'McDonald' # => 'mcdonald' # camelize 'mcdonald' # => 'McDonald' # - # source://activesupport//lib/active_support/inflector/inflections.rb#140 + # source://activesupport//lib/active_support/inflector/inflections.rb#159 def acronym(word); end # Returns the value of attribute acronyms. # - # source://activesupport//lib/active_support/inflector/inflections.rb#74 + # source://activesupport//lib/active_support/inflector/inflections.rb#93 def acronyms; end - # source://activesupport//lib/active_support/inflector/inflections.rb#76 + # source://activesupport//lib/active_support/inflector/inflections.rb#95 def acronyms_camelize_regex; end - # source://activesupport//lib/active_support/inflector/inflections.rb#76 + # source://activesupport//lib/active_support/inflector/inflections.rb#95 def acronyms_underscore_regex; end # Clears the loaded inflections within a given scope (default is @@ -6143,7 +8157,7 @@ class ActiveSupport::Inflector::Inflections # clear :all # clear :plurals # - # source://activesupport//lib/active_support/inflector/inflections.rb#229 + # source://activesupport//lib/active_support/inflector/inflections.rb#248 def clear(scope = T.unsafe(nil)); end # Specifies a humanized form of a string by a regular expression rule or @@ -6155,12 +8169,12 @@ class ActiveSupport::Inflector::Inflections # human /_cnt$/i, '\1_count' # human 'legacy_col_person_name', 'Name' # - # source://activesupport//lib/active_support/inflector/inflections.rb#218 + # source://activesupport//lib/active_support/inflector/inflections.rb#237 def human(rule, replacement); end # Returns the value of attribute humans. # - # source://activesupport//lib/active_support/inflector/inflections.rb#74 + # source://activesupport//lib/active_support/inflector/inflections.rb#93 def humans; end # Specifies a new irregular that applies to both pluralization and @@ -6171,7 +8185,7 @@ class ActiveSupport::Inflector::Inflections # irregular 'cactus', 'cacti' # irregular 'person', 'people' # - # source://activesupport//lib/active_support/inflector/inflections.rb#172 + # source://activesupport//lib/active_support/inflector/inflections.rb#191 def irregular(singular, plural); end # Specifies a new pluralization rule and its replacement. The rule can @@ -6179,12 +8193,12 @@ class ActiveSupport::Inflector::Inflections # always be a string that may include references to the matched data from # the rule. # - # source://activesupport//lib/active_support/inflector/inflections.rb#149 + # source://activesupport//lib/active_support/inflector/inflections.rb#168 def plural(rule, replacement); end # Returns the value of attribute plurals. # - # source://activesupport//lib/active_support/inflector/inflections.rb#74 + # source://activesupport//lib/active_support/inflector/inflections.rb#93 def plurals; end # Specifies a new singularization rule and its replacement. The rule can @@ -6192,12 +8206,12 @@ class ActiveSupport::Inflector::Inflections # always be a string that may include references to the matched data from # the rule. # - # source://activesupport//lib/active_support/inflector/inflections.rb#159 + # source://activesupport//lib/active_support/inflector/inflections.rb#178 def singular(rule, replacement); end # Returns the value of attribute singulars. # - # source://activesupport//lib/active_support/inflector/inflections.rb#74 + # source://activesupport//lib/active_support/inflector/inflections.rb#93 def singulars; end # Specifies words that are uncountable and should not be inflected. @@ -6206,60 +8220,83 @@ class ActiveSupport::Inflector::Inflections # uncountable 'money', 'information' # uncountable %w( money information rice ) # - # source://activesupport//lib/active_support/inflector/inflections.rb#206 + # source://activesupport//lib/active_support/inflector/inflections.rb#225 def uncountable(*words); end # Returns the value of attribute uncountables. # - # source://activesupport//lib/active_support/inflector/inflections.rb#74 + # source://activesupport//lib/active_support/inflector/inflections.rb#93 def uncountables; end private - # source://activesupport//lib/active_support/inflector/inflections.rb#248 + # source://activesupport//lib/active_support/inflector/inflections.rb#267 def define_acronym_regex_patterns; end # Private, for the test suite. # - # source://activesupport//lib/active_support/inflector/inflections.rb#84 + # source://activesupport//lib/active_support/inflector/inflections.rb#103 def initialize_dup(orig); end class << self - # source://activesupport//lib/active_support/inflector/inflections.rb#63 + # source://activesupport//lib/active_support/inflector/inflections.rb#77 def instance(locale = T.unsafe(nil)); end - # source://activesupport//lib/active_support/inflector/inflections.rb#67 + # source://activesupport//lib/active_support/inflector/inflections.rb#83 def instance_or_fallback(locale); end end end -# source://activesupport//lib/active_support/inflector/inflections.rb#31 -class ActiveSupport::Inflector::Inflections::Uncountables < ::Array +# source://activesupport//lib/active_support/inflector/inflections.rb#35 +class ActiveSupport::Inflector::Inflections::Uncountables + include ::Enumerable + # @return [Uncountables] a new instance of Uncountables # - # source://activesupport//lib/active_support/inflector/inflections.rb#32 + # source://activesupport//lib/active_support/inflector/inflections.rb#40 def initialize; end - # source://activesupport//lib/active_support/inflector/inflections.rb#42 - def <<(*word); end + # source://activesupport//lib/active_support/inflector/inflections.rb#50 + def <<(word); end - # source://activesupport//lib/active_support/inflector/inflections.rb#46 + # source://activesupport//lib/active_support/inflector/inflections.rb#38 + def ==(arg); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#61 def add(words); end - # source://activesupport//lib/active_support/inflector/inflections.rb#37 + # source://activesupport//lib/active_support/inflector/inflections.rb#45 def delete(entry); end + # source://activesupport//lib/active_support/inflector/inflections.rb#38 + def each(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#38 + def empty?(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#57 + def flatten; end + + # source://activesupport//lib/active_support/inflector/inflections.rb#38 + def pop(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#38 + def to_a(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#38 + def to_ary(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/inflector/inflections.rb#38 + def to_s(*_arg0, **_arg1, &_arg2); end + # @return [Boolean] # - # source://activesupport//lib/active_support/inflector/inflections.rb#53 + # source://activesupport//lib/active_support/inflector/inflections.rb#68 def uncountable?(str); end - - private - - # source://activesupport//lib/active_support/inflector/inflections.rb#58 - def to_regex(string); end end +# = Inheritable Options +# # +InheritableOptions+ provides a constructor to build an OrderedOptions # hash inherited from another hash. # @@ -6269,75 +8306,146 @@ end # h.girl # => 'Mary' # h.boy # => 'John' # -# source://activesupport//lib/active_support/ordered_options.rb#79 +# If the existing hash has string keys, call Hash#symbolize_keys on it. +# +# h = ActiveSupport::InheritableOptions.new({ 'girl' => 'Mary', 'boy' => 'John' }.symbolize_keys) +# h.girl # => 'Mary' +# h.boy # => 'John' +# +# source://activesupport//lib/active_support/ordered_options.rb#89 class ActiveSupport::InheritableOptions < ::ActiveSupport::OrderedOptions # @return [InheritableOptions] a new instance of InheritableOptions # - # source://activesupport//lib/active_support/ordered_options.rb#80 + # source://activesupport//lib/active_support/ordered_options.rb#90 def initialize(parent = T.unsafe(nil)); end - # source://activesupport//lib/active_support/ordered_options.rb#91 + # source://activesupport//lib/active_support/ordered_options.rb#107 + def ==(other); end + + # source://activesupport//lib/active_support/ordered_options.rb#142 + def each(&block); end + + # source://activesupport//lib/active_support/ordered_options.rb#134 def inheritable_copy; end + + # source://activesupport//lib/active_support/ordered_options.rb#111 + def inspect; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/ordered_options.rb#126 + def key?(key); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/ordered_options.rb#130 + def overridden?(key); end + + # source://activesupport//lib/active_support/ordered_options.rb#119 + def pretty_print(pp); end + + # source://activesupport//lib/active_support/ordered_options.rb#138 + def to_a; end + + # source://activesupport//lib/active_support/ordered_options.rb#103 + def to_h; end + + # source://activesupport//lib/active_support/ordered_options.rb#115 + def to_s; end + + private + + # source://activesupport//lib/active_support/ordered_options.rb#123 + def own_key?(_arg0); end end -# source://activesupport//lib/active_support/isolated_execution_state.rb#6 +# source://activesupport//lib/active_support/isolated_execution_state.rb#4 module ActiveSupport::IsolatedExecutionState class << self - # source://activesupport//lib/active_support/isolated_execution_state.rb#32 + # source://activesupport//lib/active_support/isolated_execution_state.rb#31 def [](key); end - # source://activesupport//lib/active_support/isolated_execution_state.rb#36 + # source://activesupport//lib/active_support/isolated_execution_state.rb#37 def []=(key, value); end - # source://activesupport//lib/active_support/isolated_execution_state.rb#48 + # source://activesupport//lib/active_support/isolated_execution_state.rb#50 def clear; end - # source://activesupport//lib/active_support/isolated_execution_state.rb#44 + # source://activesupport//lib/active_support/isolated_execution_state.rb#54 + def context; end + + # source://activesupport//lib/active_support/isolated_execution_state.rb#46 def delete(key); end # Returns the value of attribute isolation_level. # - # source://activesupport//lib/active_support/isolated_execution_state.rb#13 + # source://activesupport//lib/active_support/isolated_execution_state.rb#11 def isolation_level; end - # source://activesupport//lib/active_support/isolated_execution_state.rb#15 + # source://activesupport//lib/active_support/isolated_execution_state.rb#13 def isolation_level=(level); end # @return [Boolean] # - # source://activesupport//lib/active_support/isolated_execution_state.rb#40 + # source://activesupport//lib/active_support/isolated_execution_state.rb#42 def key?(key); end - # source://activesupport//lib/active_support/isolated_execution_state.rb#52 - def share_with(other); end - - # source://activesupport//lib/active_support/isolated_execution_state.rb#28 - def unique_id; end - - private - - # source://activesupport//lib/active_support/isolated_execution_state.rb#61 - def current; end - - # source://activesupport//lib/active_support/isolated_execution_state.rb#65 - def current_fiber; end + # Returns the value of attribute scope. + # + # source://activesupport//lib/active_support/isolated_execution_state.rb#11 + def scope; end - # source://activesupport//lib/active_support/isolated_execution_state.rb#61 - def current_thread; end + # source://activesupport//lib/active_support/isolated_execution_state.rb#58 + def share_with(other, except: T.unsafe(nil), &block); end end end # source://activesupport//lib/active_support/json/decoding.rb#11 module ActiveSupport::JSON class << self - # Parses a JSON string (JavaScript Object Notation) into a hash. + # Parses a JSON string (JavaScript Object Notation) into a Ruby object. # See http://www.json.org for more info. # # ActiveSupport::JSON.decode("{\"team\":\"rails\",\"players\":\"36\"}") - # => {"team" => "rails", "players" => "36"} + # # => {"team" => "rails", "players" => "36"} + # ActiveSupport::JSON.decode("2.39") + # # => 2.39 + # + # source://activesupport//lib/active_support/json/decoding.rb#24 + def decode(json, options = T.unsafe(nil)); end + + # Dumps objects in JSON (JavaScript Object Notation). + # See http://www.json.org for more info. + # + # ActiveSupport::JSON.encode({ team: 'rails', players: '36' }) + # # => "{\"team\":\"rails\",\"players\":\"36\"}" + # + # By default, it generates JSON that is safe to include in JavaScript, as + # it escapes U+2028 (Line Separator) and U+2029 (Paragraph Separator): + # + # ActiveSupport::JSON.encode({ key: "\u2028" }) + # # => "{\"key\":\"\\u2028\"}" + # + # By default, it also generates JSON that is safe to include in HTML, as + # it escapes <, >, and &: + # + # ActiveSupport::JSON.encode({ key: "<>&" }) + # # => "{\"key\":\"\\u003c\\u003e\\u0026\"}" + # + # This behavior can be changed with the +escape_html_entities+ option, or the + # global escape_html_entities_in_json configuration option. + # + # ActiveSupport::JSON.encode({ key: "<>&" }, escape_html_entities: false) + # # => "{\"key\":\"<>&\"}" # - # source://activesupport//lib/active_support/json/decoding.rb#22 - def decode(json); end + # For performance reasons, you can set the +escape+ option to false, + # which will skip all escaping: + # + # ActiveSupport::JSON.encode({ key: "\u2028<>&" }, escape: false) + # # => "{\"key\":\"\u2028<>&\"}" + # + # source://activesupport//lib/active_support/json/encoding.rb#56 + def dump(value, options = T.unsafe(nil)); end # Dumps objects in JSON (JavaScript Object Notation). # See http://www.json.org for more info. @@ -6345,9 +8453,44 @@ module ActiveSupport::JSON # ActiveSupport::JSON.encode({ team: 'rails', players: '36' }) # # => "{\"team\":\"rails\",\"players\":\"36\"}" # - # source://activesupport//lib/active_support/json/encoding.rb#21 + # By default, it generates JSON that is safe to include in JavaScript, as + # it escapes U+2028 (Line Separator) and U+2029 (Paragraph Separator): + # + # ActiveSupport::JSON.encode({ key: "\u2028" }) + # # => "{\"key\":\"\\u2028\"}" + # + # By default, it also generates JSON that is safe to include in HTML, as + # it escapes <, >, and &: + # + # ActiveSupport::JSON.encode({ key: "<>&" }) + # # => "{\"key\":\"\\u003c\\u003e\\u0026\"}" + # + # This behavior can be changed with the +escape_html_entities+ option, or the + # global escape_html_entities_in_json configuration option. + # + # ActiveSupport::JSON.encode({ key: "<>&" }, escape_html_entities: false) + # # => "{\"key\":\"<>&\"}" + # + # For performance reasons, you can set the +escape+ option to false, + # which will skip all escaping: + # + # ActiveSupport::JSON.encode({ key: "\u2028<>&" }, escape: false) + # # => "{\"key\":\"\u2028<>&\"}" + # + # source://activesupport//lib/active_support/json/encoding.rb#47 def encode(value, options = T.unsafe(nil)); end + # Parses a JSON string (JavaScript Object Notation) into a Ruby object. + # See http://www.json.org for more info. + # + # ActiveSupport::JSON.decode("{\"team\":\"rails\",\"players\":\"36\"}") + # # => {"team" => "rails", "players" => "36"} + # ActiveSupport::JSON.decode("2.39") + # # => 2.39 + # + # source://activesupport//lib/active_support/json/decoding.rb#33 + def load(json, options = T.unsafe(nil)); end + # Returns the class of the error that will be raised when there is an # error in decoding JSON. Using this method means you won't directly # depend on the ActiveSupport's JSON implementation, in case it changes @@ -6359,12 +8502,12 @@ module ActiveSupport::JSON # Rails.logger.warn("Attempted to decode invalid JSON: #{some_string}") # end # - # source://activesupport//lib/active_support/json/decoding.rb#42 + # source://activesupport//lib/active_support/json/decoding.rb#45 def parse_error; end private - # source://activesupport//lib/active_support/json/decoding.rb#47 + # source://activesupport//lib/active_support/json/decoding.rb#50 def convert_dates_from(data); end end end @@ -6377,80 +8520,129 @@ ActiveSupport::JSON::DATETIME_REGEX = T.let(T.unsafe(nil), Regexp) # source://activesupport//lib/active_support/json/decoding.rb#13 ActiveSupport::JSON::DATE_REGEX = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/json/encoding.rb#25 +# source://activesupport//lib/active_support/json/encoding.rb#59 module ActiveSupport::JSON::Encoding class << self + # source://activesupport//lib/active_support/json/encoding.rb#239 + def encode_without_escape(value); end + + # source://activesupport//lib/active_support/json/encoding.rb#235 + def encode_without_options(value); end + # If true, encode >, <, & as escaped unicode sequences (e.g. > as \u003e) # as a safety measure. # - # source://activesupport//lib/active_support/json/encoding.rb#121 + # source://activesupport//lib/active_support/json/encoding.rb#212 def escape_html_entities_in_json; end # If true, encode >, <, & as escaped unicode sequences (e.g. > as \u003e) # as a safety measure. # - # source://activesupport//lib/active_support/json/encoding.rb#121 + # source://activesupport//lib/active_support/json/encoding.rb#212 def escape_html_entities_in_json=(_arg0); end - # Sets the encoder used by Rails to encode Ruby objects into JSON strings - # in +Object#to_json+ and +ActiveSupport::JSON.encode+. + # If true, encode LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) + # as escaped unicode sequences ('\u2028' and '\u2029'). + # Historically these characters were not valid inside JavaScript strings + # but that changed in ECMAScript 2019. As such it's no longer a concern in + # modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset. # - # source://activesupport//lib/active_support/json/encoding.rb#129 - def json_encoder; end + # source://activesupport//lib/active_support/json/encoding.rb#219 + def escape_js_separators_in_json; end + + # If true, encode LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) + # as escaped unicode sequences ('\u2028' and '\u2029'). + # Historically these characters were not valid inside JavaScript strings + # but that changed in ECMAScript 2019. As such it's no longer a concern in + # modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset. + # + # source://activesupport//lib/active_support/json/encoding.rb#219 + def escape_js_separators_in_json=(_arg0); end - # Sets the encoder used by Rails to encode Ruby objects into JSON strings + # Sets the encoder used by \Rails to encode Ruby objects into JSON strings # in +Object#to_json+ and +ActiveSupport::JSON.encode+. # - # source://activesupport//lib/active_support/json/encoding.rb#129 - def json_encoder=(_arg0); end + # source://activesupport//lib/active_support/json/encoding.rb#227 + def json_encoder; end + + # source://activesupport//lib/active_support/json/encoding.rb#229 + def json_encoder=(encoder); end # Sets the precision of encoded time values. # Defaults to 3 (equivalent to millisecond precision) # - # source://activesupport//lib/active_support/json/encoding.rb#125 + # source://activesupport//lib/active_support/json/encoding.rb#223 def time_precision; end # Sets the precision of encoded time values. # Defaults to 3 (equivalent to millisecond precision) # - # source://activesupport//lib/active_support/json/encoding.rb#125 + # source://activesupport//lib/active_support/json/encoding.rb#223 def time_precision=(_arg0); end # If true, use ISO 8601 format for dates and times. Otherwise, fall back # to the Active Support legacy format. # - # source://activesupport//lib/active_support/json/encoding.rb#117 + # source://activesupport//lib/active_support/json/encoding.rb#208 def use_standard_json_time_format; end # If true, use ISO 8601 format for dates and times. Otherwise, fall back # to the Active Support legacy format. # - # source://activesupport//lib/active_support/json/encoding.rb#117 + # source://activesupport//lib/active_support/json/encoding.rb#208 def use_standard_json_time_format=(_arg0); end end end -# source://activesupport//lib/active_support/json/encoding.rb#26 +# source://activesupport//lib/active_support/json/encoding.rb#63 +ActiveSupport::JSON::Encoding::ESCAPED_CHARS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/json/encoding.rb#72 +ActiveSupport::JSON::Encoding::FULL_ESCAPE_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/json/encoding.rb#71 +ActiveSupport::JSON::Encoding::HTML_ENTITIES_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/json/encoding.rb#150 +class ActiveSupport::JSON::Encoding::JSONGemCoderEncoder + # @return [JSONGemCoderEncoder] a new instance of JSONGemCoderEncoder + # + # source://activesupport//lib/active_support/json/encoding.rb#171 + def initialize(options = T.unsafe(nil)); end + + # Encode the given object into a JSON string + # + # source://activesupport//lib/active_support/json/encoding.rb#183 + def encode(value); end +end + +# source://activesupport//lib/active_support/json/encoding.rb#152 +ActiveSupport::JSON::Encoding::JSONGemCoderEncoder::CODER = T.let(T.unsafe(nil), JSON::Coder) + +# source://activesupport//lib/active_support/json/encoding.rb#151 +ActiveSupport::JSON::Encoding::JSONGemCoderEncoder::JSON_NATIVE_TYPES = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/json/encoding.rb#75 class ActiveSupport::JSON::Encoding::JSONGemEncoder # @return [JSONGemEncoder] a new instance of JSONGemEncoder # - # source://activesupport//lib/active_support/json/encoding.rb#29 + # source://activesupport//lib/active_support/json/encoding.rb#78 def initialize(options = T.unsafe(nil)); end # Encode the given object into a JSON string # - # source://activesupport//lib/active_support/json/encoding.rb#34 + # source://activesupport//lib/active_support/json/encoding.rb#83 def encode(value); end # Returns the value of attribute options. # - # source://activesupport//lib/active_support/json/encoding.rb#27 + # source://activesupport//lib/active_support/json/encoding.rb#76 def options; end private # Convert an object into a "JSON-ready" representation composed of - # primitives like Hash, Array, String, Numeric, + # primitives like Hash, Array, String, Symbol, Numeric, # and +true+/+false+/+nil+. # Recursively calls #as_json to the object to recursively build a # fully JSON-ready object. @@ -6463,72 +8655,64 @@ class ActiveSupport::JSON::Encoding::JSONGemEncoder # to +object.as_json+, not any of this method's recursive +#as_json+ # calls. # - # source://activesupport//lib/active_support/json/encoding.rb#89 + # source://activesupport//lib/active_support/json/encoding.rb#118 def jsonify(value); end # Encode a "jsonified" Ruby data structure using the JSON gem # - # source://activesupport//lib/active_support/json/encoding.rb#109 + # source://activesupport//lib/active_support/json/encoding.rb#143 def stringify(jsonified); end end -# Rails does more escaping than the JSON gem natively does (we -# escape \u2028 and \u2029 and optionally >, <, & to work around -# certain browser problems). -# -# source://activesupport//lib/active_support/json/encoding.rb#42 -ActiveSupport::JSON::Encoding::JSONGemEncoder::ESCAPED_CHARS = T.let(T.unsafe(nil), Hash) +# source://activesupport//lib/active_support/json/encoding.rb#73 +ActiveSupport::JSON::Encoding::JS_SEPARATORS_REGEX = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/json/encoding.rb#51 -ActiveSupport::JSON::Encoding::JSONGemEncoder::ESCAPE_REGEX_WITHOUT_HTML_ENTITIES = T.let(T.unsafe(nil), Regexp) +# source://activesupport//lib/active_support/json/encoding.rb#60 +ActiveSupport::JSON::Encoding::U2028 = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/json/encoding.rb#50 -ActiveSupport::JSON::Encoding::JSONGemEncoder::ESCAPE_REGEX_WITH_HTML_ENTITIES = T.let(T.unsafe(nil), Regexp) +# source://activesupport//lib/active_support/json/encoding.rb#61 +ActiveSupport::JSON::Encoding::U2029 = T.let(T.unsafe(nil), String) -# This class wraps all the strings we see and does the extra escaping +# = Key Generator # -# source://activesupport//lib/active_support/json/encoding.rb#54 -class ActiveSupport::JSON::Encoding::JSONGemEncoder::EscapedString < ::String - # source://activesupport//lib/active_support/json/encoding.rb#55 - def to_json(*_arg0); end - - # source://activesupport//lib/active_support/json/encoding.rb#67 - def to_s; end -end - # KeyGenerator is a simple wrapper around OpenSSL's implementation of PBKDF2. # It can be used to derive a number of keys for various purposes from a given secret. -# This lets Rails applications have a single secure secret, but avoid reusing that +# This lets \Rails applications have a single secure secret, but avoid reusing that # key in multiple incompatible contexts. # -# source://activesupport//lib/active_support/key_generator.rb#11 +# source://activesupport//lib/active_support/key_generator.rb#13 class ActiveSupport::KeyGenerator # @return [KeyGenerator] a new instance of KeyGenerator # - # source://activesupport//lib/active_support/key_generator.rb#26 + # source://activesupport//lib/active_support/key_generator.rb#28 def initialize(secret, options = T.unsafe(nil)); end # Returns a derived key suitable for use. The default +key_size+ is chosen # to be compatible with the default settings of ActiveSupport::MessageVerifier. # i.e. OpenSSL::Digest::SHA1#block_length # - # source://activesupport//lib/active_support/key_generator.rb#39 + # source://activesupport//lib/active_support/key_generator.rb#41 def generate_key(salt, key_size = T.unsafe(nil)); end + # source://activesupport//lib/active_support/key_generator.rb#45 + def inspect; end + class << self - # source://activesupport//lib/active_support/key_generator.rb#21 + # source://activesupport//lib/active_support/key_generator.rb#23 def hash_digest_class; end - # source://activesupport//lib/active_support/key_generator.rb#13 + # source://activesupport//lib/active_support/key_generator.rb#15 def hash_digest_class=(klass); end end end -# LazyLoadHooks allows Rails to lazily load a lot of components and thus +# = Lazy Load Hooks +# +# LazyLoadHooks allows \Rails to lazily load a lot of components and thus # making the app boot faster. Because of this feature now there is no need to -# require ActiveRecord::Base at boot time purely to apply +# require +ActiveRecord::Base+ at boot time purely to apply # configuration. Instead a hook is registered that applies configuration once -# ActiveRecord::Base is loaded. Here ActiveRecord::Base is +# +ActiveRecord::Base+ is loaded. Here +ActiveRecord::Base+ is # used as example but this feature can be applied elsewhere too. # # Here is an example where on_load method is called to register a hook. @@ -6562,46 +8746,48 @@ end # end # end # -# source://activesupport//lib/active_support/lazy_load_hooks.rb#41 +# source://activesupport//lib/active_support/lazy_load_hooks.rb#43 module ActiveSupport::LazyLoadHooks - # Declares a block that will be executed when a Rails component is fully + # Declares a block that will be executed when a \Rails component is fully # loaded. If the component has already loaded, the block is executed # immediately. # - # Options: + # ==== Options # # * :yield - Yields the object that run_load_hooks to +block+. # * :run_once - Given +block+ will run only once. # - # source://activesupport//lib/active_support/lazy_load_hooks.rb#58 + # source://activesupport//lib/active_support/lazy_load_hooks.rb#60 def on_load(name, options = T.unsafe(nil), &block); end # Executes all blocks registered to +name+ via on_load, using +base+ as the # evaluation context. # - # ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base) + # ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base) # # In the case of the above example, it will execute all hooks registered # for +:active_record+ within the class +ActiveRecord::Base+. # - # source://activesupport//lib/active_support/lazy_load_hooks.rb#73 + # source://activesupport//lib/active_support/lazy_load_hooks.rb#75 def run_load_hooks(name, base = T.unsafe(nil)); end private - # source://activesupport//lib/active_support/lazy_load_hooks.rb#89 + # source://activesupport//lib/active_support/lazy_load_hooks.rb#91 def execute_hook(name, base, options, block); end - # source://activesupport//lib/active_support/lazy_load_hooks.rb#81 + # source://activesupport//lib/active_support/lazy_load_hooks.rb#83 def with_execution_control(name, block, once); end class << self - # source://activesupport//lib/active_support/lazy_load_hooks.rb#42 + # source://activesupport//lib/active_support/lazy_load_hooks.rb#44 def extended(base); end end end -# ActiveSupport::LogSubscriber is an object set to consume +# = Active Support Log \Subscriber +# +# +ActiveSupport::LogSubscriber+ is an object set to consume # ActiveSupport::Notifications with the sole purpose of logging them. # The log subscriber dispatches notifications to a registered object based # on its given namespace. @@ -6611,29 +8797,23 @@ end # # module ActiveRecord # class LogSubscriber < ActiveSupport::LogSubscriber +# attach_to :active_record +# # def sql(event) # info "#{event.payload[:name]} (#{event.duration}) #{event.payload[:sql]}" # end # end # end # -# And it's finally registered as: +# ActiveRecord::LogSubscriber.logger must be set as well, but it is assigned +# automatically in a \Rails environment. # -# ActiveRecord::LogSubscriber.attach_to :active_record -# -# Since we need to know all instance methods before attaching the log -# subscriber, the line above should be called after your -# ActiveRecord::LogSubscriber definition. -# -# A logger also needs to be set with ActiveRecord::LogSubscriber.logger=. -# This is assigned automatically in a Rails environment. -# -# After configured, whenever a "sql.active_record" notification is published, -# it will properly dispatch the event -# (ActiveSupport::Notifications::Event) to the sql method. +# After configured, whenever a "sql.active_record" notification is +# published, it will properly dispatch the event +# (ActiveSupport::Notifications::Event) to the +sql+ method. # # Being an ActiveSupport::Notifications consumer, -# ActiveSupport::LogSubscriber exposes a simple interface to check if +# +ActiveSupport::LogSubscriber+ exposes a simple interface to check if # instrumented code raises an exception. It is common to log a different # message in case of an error, and this can be achieved by extending # the previous example: @@ -6655,125 +8835,159 @@ end # end # end # -# Log subscriber also has some helpers to deal with logging and automatically -# flushes all logs when the request finishes -# (via action_dispatch.callback notification) in a Rails environment. +# +ActiveSupport::LogSubscriber+ also has some helpers to deal with +# logging. For example, ActiveSupport::LogSubscriber.flush_all! will ensure +# that all logs are flushed, and it is called in Rails::Rack::Logger after a +# request finishes. # -# source://activesupport//lib/active_support/log_subscriber.rb#66 +# source://activesupport//lib/active_support/log_subscriber.rb#64 class ActiveSupport::LogSubscriber < ::ActiveSupport::Subscriber - # source://activesupport//lib/active_support/log_subscriber.rb#80 + # @return [LogSubscriber] a new instance of LogSubscriber + # + # source://activesupport//lib/active_support/log_subscriber.rb#133 + def initialize; end + + # source://activesupport//lib/active_support/log_subscriber.rb#146 + def call(event); end + + # source://activesupport//lib/active_support/log_subscriber.rb#83 def colorize_logging; end - # source://activesupport//lib/active_support/log_subscriber.rb#80 + # source://activesupport//lib/active_support/log_subscriber.rb#83 def colorize_logging=(val); end - # source://activesupport//lib/active_support/log_subscriber.rb#129 + # source://activesupport//lib/active_support/log_subscriber.rb#156 def debug(progname = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/log_subscriber.rb#129 + # source://activesupport//lib/active_support/log_subscriber.rb#156 def error(progname = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/log_subscriber.rb#129 - def fatal(progname = T.unsafe(nil), &block); end + # source://activesupport//lib/active_support/log_subscriber.rb#152 + def event_levels=(_arg0); end - # source://activesupport//lib/active_support/log_subscriber.rb#114 - def finish(name, id, payload); end + # source://activesupport//lib/active_support/log_subscriber.rb#156 + def fatal(progname = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/log_subscriber.rb#129 + # source://activesupport//lib/active_support/log_subscriber.rb#156 def info(progname = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/log_subscriber.rb#106 + # source://activesupport//lib/active_support/log_subscriber.rb#138 def logger; end - # source://activesupport//lib/active_support/log_subscriber.rb#120 - def publish_event(event); end - - # source://activesupport//lib/active_support/log_subscriber.rb#110 - def start(name, id, payload); end + # @return [Boolean] + # + # source://activesupport//lib/active_support/log_subscriber.rb#142 + def silenced?(event); end - # source://activesupport//lib/active_support/log_subscriber.rb#129 + # source://activesupport//lib/active_support/log_subscriber.rb#156 def unknown(progname = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/log_subscriber.rb#129 + # source://activesupport//lib/active_support/log_subscriber.rb#156 def warn(progname = T.unsafe(nil), &block); end private - # Set color by using a symbol or one of the defined constants. If a third - # option is set to +true+, it also adds bold to the string. This is based - # on the Highline implementation and will automatically append CLEAR to the - # end of the returned String. + # Set color by using a symbol or one of the defined constants. Set modes + # by specifying bold, italic, or underline options. Inspired by Highline, + # this method will automatically clear formatting at the end of the returned String. # - # source://activesupport//lib/active_support/log_subscriber.rb#139 - def color(text, color, bold = T.unsafe(nil)); end + # source://activesupport//lib/active_support/log_subscriber.rb#166 + def color(text, color, mode_options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/log_subscriber.rb#146 + # source://activesupport//lib/active_support/log_subscriber.rb#180 def log_exception(name, e); end + # source://activesupport//lib/active_support/log_subscriber.rb#174 + def mode_from(options); end + class << self - # source://activesupport//lib/active_support/log_subscriber.rb#80 + # source://activesupport//lib/active_support/log_subscriber.rb#99 + def attach_to(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/log_subscriber.rb#83 def colorize_logging; end - # source://activesupport//lib/active_support/log_subscriber.rb#80 + # source://activesupport//lib/active_support/log_subscriber.rb#83 def colorize_logging=(val); end # Flush all log_subscribers' logger. # - # source://activesupport//lib/active_support/log_subscriber.rb#96 + # source://activesupport//lib/active_support/log_subscriber.rb#112 def flush_all!; end - # source://activesupport//lib/active_support/log_subscriber.rb#91 + # source://activesupport//lib/active_support/log_subscriber.rb#84 + def log_levels; end + + # source://activesupport//lib/active_support/log_subscriber.rb#84 + def log_levels=(value); end + + # source://activesupport//lib/active_support/log_subscriber.rb#84 + def log_levels?; end + + # source://activesupport//lib/active_support/log_subscriber.rb#107 def log_subscribers; end - # source://activesupport//lib/active_support/log_subscriber.rb#83 + # source://activesupport//lib/active_support/log_subscriber.rb#93 def logger; end # Sets the attribute logger # # @param value the value to set the attribute logger to. # - # source://activesupport//lib/active_support/log_subscriber.rb#89 + # source://activesupport//lib/active_support/log_subscriber.rb#105 def logger=(_arg0); end private - # source://activesupport//lib/active_support/log_subscriber.rb#101 + # source://activesupport//lib/active_support/log_subscriber.rb#84 + def __class_attr_log_levels; end + + # source://activesupport//lib/active_support/log_subscriber.rb#84 + def __class_attr_log_levels=(new_value); end + + # source://activesupport//lib/active_support/log_subscriber.rb#117 def fetch_public_methods(subscriber, inherit_all); end + + # source://activesupport//lib/active_support/log_subscriber.rb#121 + def set_event_levels; end + + # source://activesupport//lib/active_support/log_subscriber.rb#127 + def subscribe_log_level(method, level); end end end -# Colors +# ANSI sequence colors # -# source://activesupport//lib/active_support/log_subscriber.rb#71 +# source://activesupport//lib/active_support/log_subscriber.rb#74 ActiveSupport::LogSubscriber::BLACK = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/log_subscriber.rb#75 +# source://activesupport//lib/active_support/log_subscriber.rb#78 ActiveSupport::LogSubscriber::BLUE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/log_subscriber.rb#68 -ActiveSupport::LogSubscriber::BOLD = T.let(T.unsafe(nil), String) - -# Embed in a String to clear all previous ANSI sequences. -# -# source://activesupport//lib/active_support/log_subscriber.rb#67 -ActiveSupport::LogSubscriber::CLEAR = T.let(T.unsafe(nil), String) - -# source://activesupport//lib/active_support/log_subscriber.rb#77 +# source://activesupport//lib/active_support/log_subscriber.rb#80 ActiveSupport::LogSubscriber::CYAN = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/log_subscriber.rb#73 +# source://activesupport//lib/active_support/log_subscriber.rb#76 ActiveSupport::LogSubscriber::GREEN = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/log_subscriber.rb#76 +# source://activesupport//lib/active_support/log_subscriber.rb#86 +ActiveSupport::LogSubscriber::LEVEL_CHECKS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/log_subscriber.rb#79 ActiveSupport::LogSubscriber::MAGENTA = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/log_subscriber.rb#72 +# ANSI sequence modes +# +# source://activesupport//lib/active_support/log_subscriber.rb#66 +ActiveSupport::LogSubscriber::MODES = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/log_subscriber.rb#75 ActiveSupport::LogSubscriber::RED = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/log_subscriber.rb#78 +# source://activesupport//lib/active_support/log_subscriber.rb#81 ActiveSupport::LogSubscriber::WHITE = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/log_subscriber.rb#74 +# source://activesupport//lib/active_support/log_subscriber.rb#77 ActiveSupport::LogSubscriber::YELLOW = T.let(T.unsafe(nil), String) # source://activesupport//lib/active_support/logger.rb#8 @@ -6783,47 +8997,49 @@ class ActiveSupport::Logger < ::Logger # @return [Logger] a new instance of Logger # - # source://activesupport//lib/active_support/logger.rb#80 + # source://activesupport//lib/active_support/logger.rb#33 def initialize(*args, **kwargs); end - # source://activesupport//lib/active_support/logger_silence.rb#12 + # source://activesupport//lib/active_support/logger.rb#9 def silencer; end - # source://activesupport//lib/active_support/logger_silence.rb#12 + # source://activesupport//lib/active_support/logger.rb#9 def silencer=(val); end class << self - # Broadcasts logs to multiple loggers. - # - # source://activesupport//lib/active_support/logger.rb#23 - def broadcast(logger); end - # Returns true if the logger destination matches one of the sources # # logger = Logger.new(STDOUT) # ActiveSupport::Logger.logger_outputs_to?(logger, STDOUT) # # => true # + # logger = Logger.new('/var/log/rails.log') + # ActiveSupport::Logger.logger_outputs_to?(logger, '/var/log/rails.log') + # # => true + # # @return [Boolean] # - # source://activesupport//lib/active_support/logger.rb#16 + # source://activesupport//lib/active_support/logger.rb#20 def logger_outputs_to?(logger, *sources); end - # source://activesupport//lib/active_support/logger_silence.rb#12 + # source://activesupport//lib/active_support/logger.rb#47 + def normalize_sources(sources); end + + # source://activesupport//lib/active_support/logger.rb#9 def silencer; end - # source://activesupport//lib/active_support/logger_silence.rb#12 + # source://activesupport//lib/active_support/logger.rb#9 def silencer=(val); end end end # Simple formatter which only displays the message. # -# source://activesupport//lib/active_support/logger.rb#87 +# source://activesupport//lib/active_support/logger.rb#39 class ActiveSupport::Logger::SimpleFormatter < ::Logger::Formatter # This method is invoked when a log event occurs # - # source://activesupport//lib/active_support/logger.rb#88 + # source://activesupport//lib/active_support/logger.rb#41 def call(severity, timestamp, progname, msg); end end @@ -6838,49 +9054,37 @@ module ActiveSupport::LoggerSilence def silence(severity = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/logger_thread_safe_level.rb#9 +# source://activesupport//lib/active_support/logger_thread_safe_level.rb#7 module ActiveSupport::LoggerThreadSafeLevel extend ::ActiveSupport::Concern - # Redefined to check severity against #level, and thus the thread-local level, rather than +@level+. - # FIXME: Remove when the minimum Ruby version supports overriding Logger#level. - # - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#50 - def add(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end - - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#14 - def debug?; end - - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#14 - def error?; end - - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#14 - def fatal?; end - - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#14 - def info?; end + # source://activesupport//lib/active_support/logger_thread_safe_level.rb#10 + def initialize(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#36 + # source://activesupport//lib/active_support/logger_thread_safe_level.rb#35 def level; end - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#20 + # source://activesupport//lib/active_support/logger_thread_safe_level.rb#15 def local_level; end - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#24 + # source://activesupport//lib/active_support/logger_thread_safe_level.rb#19 def local_level=(level); end # Change the thread-local level for the duration of the given block. # - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#41 + # source://activesupport//lib/active_support/logger_thread_safe_level.rb#40 def log_at(level); end - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#14 - def unknown?; end + private - # source://activesupport//lib/active_support/logger_thread_safe_level.rb#14 - def warn?; end + # Returns the value of attribute local_level_key. + # + # source://activesupport//lib/active_support/logger_thread_safe_level.rb#48 + def local_level_key; end end +# = Active Support Message Encryptor +# # MessageEncryptor is a simple way to encrypt values which get stored # somewhere you don't trust. # @@ -6898,7 +9102,7 @@ end # crypt.decrypt_and_verify(encrypted_data) # => "my secret data" # # The +decrypt_and_verify+ method will raise an -# ActiveSupport::MessageEncryptor::InvalidMessage exception if the data +# +ActiveSupport::MessageEncryptor::InvalidMessage+ exception if the data # provided cannot be decrypted or verified. # # crypt.decrypt_and_verify('not encrypted data') # => ActiveSupport::MessageEncryptor::InvalidMessage @@ -6959,10 +9163,9 @@ end # # crypt.rotate old_secret, cipher: "aes-256-cbc" # -# source://activesupport//lib/active_support/message_encryptor.rb#87 -class ActiveSupport::MessageEncryptor +# source://activesupport//lib/active_support/message_encryptor.rb#90 +class ActiveSupport::MessageEncryptor < ::ActiveSupport::Messages::Codec include ::ActiveSupport::Messages::Rotator - include ::ActiveSupport::Messages::Rotator::Encryptor # Initialize a new MessageEncryptor. +secret+ must be at least as long as # the cipher key size. For the default 'aes-256-gcm' cipher, this is 256 @@ -6970,171 +9173,296 @@ class ActiveSupport::MessageEncryptor # key by using ActiveSupport::KeyGenerator or a similar key # derivation function. # - # First additional parameter is used as the signature key for MessageVerifier. - # This allows you to specify keys to encrypt and sign data. + # The first additional parameter is used as the signature key for + # MessageVerifier. This allows you to specify keys to encrypt and sign + # data. Ignored when using an AEAD cipher like 'aes-256-gcm'. # # ActiveSupport::MessageEncryptor.new('secret', 'signature_secret') # - # Options: - # * :cipher - Cipher to use. Can be any cipher returned by - # OpenSSL::Cipher.ciphers. Default is 'aes-256-gcm'. - # * :digest - String of digest to use for signing. Default is - # +SHA1+. Ignored when using an AEAD cipher like 'aes-256-gcm'. - # * :serializer - Object serializer to use. Default is +Marshal+. + # ==== Options + # + # [+:cipher+] + # Cipher to use. Can be any cipher returned by +OpenSSL::Cipher.ciphers+. + # Default is 'aes-256-gcm'. + # + # [+:digest+] + # Digest used for signing. Ignored when using an AEAD cipher like + # 'aes-256-gcm'. + # + # [+:serializer+] + # The serializer used to serialize message data. You can specify any + # object that responds to +dump+ and +load+, or you can choose from + # several preconfigured serializers: +:marshal+, +:json_allow_marshal+, + # +:json+, +:message_pack_allow_marshal+, +:message_pack+. + # + # The preconfigured serializers include a fallback mechanism to support + # multiple deserialization formats. For example, the +:marshal+ serializer + # will serialize using +Marshal+, but can deserialize using +Marshal+, + # ActiveSupport::JSON, or ActiveSupport::MessagePack. This makes it easy + # to migrate between serializers. + # + # The +:marshal+, +:json_allow_marshal+, and +:message_pack_allow_marshal+ + # serializers support deserializing using +Marshal+, but the others do + # not. Beware that +Marshal+ is a potential vector for deserialization + # attacks in cases where a message signing secret has been leaked. If + # possible, choose a serializer that does not support +Marshal+. + # + # The +:message_pack+ and +:message_pack_allow_marshal+ serializers use + # ActiveSupport::MessagePack, which can roundtrip some Ruby types that are + # not supported by JSON, and may provide improved performance. However, + # these require the +msgpack+ gem. + # + # When using \Rails, the default depends on +config.active_support.message_serializer+. + # Otherwise, the default is +:marshal+. + # + # [+:url_safe+] + # By default, MessageEncryptor generates RFC 4648 compliant strings + # which are not URL-safe. In other words, they can contain "+" and "/". + # If you want to generate URL-safe strings (in compliance with "Base 64 + # Encoding with URL and Filename Safe Alphabet" in RFC 4648), you can + # pass +true+. + # + # [+:force_legacy_metadata_serializer+] + # Whether to use the legacy metadata serializer, which serializes the + # message first, then wraps it in an envelope which is also serialized. This + # was the default in \Rails 7.0 and below. + # + # If you don't pass a truthy value, the default is set using + # +config.active_support.use_message_serializer_for_metadata+. # # @return [MessageEncryptor] a new instance of MessageEncryptor # - # source://activesupport//lib/active_support/messages/rotator.rb#6 - def initialize(*secrets, on_rotation: T.unsafe(nil), **options); end + # source://activesupport//lib/active_support/message_encryptor.rb#183 + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/message_encryptor.rb#256 + def create_message(value, **options); end # Decrypt and verify a message. We need to verify the message in order to # avoid padding attacks. Reference: https://www.limited-entropy.com/padding-oracle-attacks/. # - # source://activesupport//lib/active_support/messages/rotator.rb#21 - def decrypt_and_verify(*args, on_rotation: T.unsafe(nil), **options); end + # ==== Options + # + # [+:purpose+] + # The purpose that the message was generated with. If the purpose does not + # match, +decrypt_and_verify+ will return +nil+. + # + # message = encryptor.encrypt_and_sign("hello", purpose: "greeting") + # encryptor.decrypt_and_verify(message, purpose: "greeting") # => "hello" + # encryptor.decrypt_and_verify(message) # => nil + # + # message = encryptor.encrypt_and_sign("bye") + # encryptor.decrypt_and_verify(message) # => "bye" + # encryptor.decrypt_and_verify(message, purpose: "greeting") # => nil + # + # source://activesupport//lib/active_support/message_encryptor.rb#241 + def decrypt_and_verify(message, **options); end # Encrypt and sign a message. We need to sign the message in order to avoid # padding attacks. Reference: https://www.limited-entropy.com/padding-oracle-attacks/. # - # source://activesupport//lib/active_support/message_encryptor.rb#153 - def encrypt_and_sign(value, expires_at: T.unsafe(nil), expires_in: T.unsafe(nil), purpose: T.unsafe(nil)); end + # ==== Options + # + # [+:expires_at+] + # The datetime at which the message expires. After this datetime, + # verification of the message will fail. + # + # message = encryptor.encrypt_and_sign("hello", expires_at: Time.now.tomorrow) + # encryptor.decrypt_and_verify(message) # => "hello" + # # 24 hours later... + # encryptor.decrypt_and_verify(message) # => nil + # + # [+:expires_in+] + # The duration for which the message is valid. After this duration has + # elapsed, verification of the message will fail. + # + # message = encryptor.encrypt_and_sign("hello", expires_in: 24.hours) + # encryptor.decrypt_and_verify(message) # => "hello" + # # 24 hours later... + # encryptor.decrypt_and_verify(message) # => nil + # + # [+:purpose+] + # The purpose of the message. If specified, the same purpose must be + # specified when verifying the message; otherwise, verification will fail. + # (See #decrypt_and_verify.) + # + # source://activesupport//lib/active_support/message_encryptor.rb#220 + def encrypt_and_sign(value, **options); end - private + # source://activesupport//lib/active_support/message_encryptor.rb#264 + def inspect; end + + # source://activesupport//lib/active_support/message_encryptor.rb#260 + def read_message(message, on_rotation: T.unsafe(nil), **options); end - # source://activesupport//lib/active_support/message_encryptor.rb#186 - def _decrypt(encrypted_message, purpose); end + private - # source://activesupport//lib/active_support/message_encryptor.rb#169 - def _encrypt(value, **metadata_options); end + # Returns the value of attribute aead_mode. + # + # source://activesupport//lib/active_support/message_encryptor.rb#371 + def aead_mode; end - # @return [Boolean] + # Returns the value of attribute aead_mode. # - # source://activesupport//lib/active_support/message_encryptor.rb#218 + # source://activesupport//lib/active_support/message_encryptor.rb#372 def aead_mode?; end - # source://activesupport//lib/active_support/message_encryptor.rb#212 + # source://activesupport//lib/active_support/message_encryptor.rb#295 + def decrypt(encrypted_message); end + + # source://activesupport//lib/active_support/message_encryptor.rb#277 + def encrypt(data); end + + # source://activesupport//lib/active_support/message_encryptor.rb#340 + def extract_part(encrypted_message, rindex, length); end + + # source://activesupport//lib/active_support/message_encryptor.rb#350 + def extract_parts(encrypted_message); end + + # source://activesupport//lib/active_support/message_encryptor.rb#336 + def join_parts(parts); end + + # source://activesupport//lib/active_support/message_encryptor.rb#320 + def length_after_encode(length_before_encode); end + + # source://activesupport//lib/active_support/message_encryptor.rb#332 + def length_of_encoded_auth_tag; end + + # source://activesupport//lib/active_support/message_encryptor.rb#328 + def length_of_encoded_iv; end + + # source://activesupport//lib/active_support/message_encryptor.rb#367 def new_cipher; end - # source://activesupport//lib/active_support/message_encryptor.rb#222 - def resolve_verifier; end + # source://activesupport//lib/active_support/message_encryptor.rb#269 + def sign(data); end - # Returns the value of attribute verifier. - # - # source://activesupport//lib/active_support/message_encryptor.rb#216 - def verifier; end + # source://activesupport//lib/active_support/message_encryptor.rb#273 + def verify(data); end class << self - # source://activesupport//lib/active_support/message_encryptor.rb#93 + # source://activesupport//lib/active_support/message_encryptor.rb#96 def default_cipher; end # Given a cipher, returns the key length of the cipher to help generate the key of desired size # - # source://activesupport//lib/active_support/message_encryptor.rb#164 + # source://activesupport//lib/active_support/message_encryptor.rb#252 def key_len(cipher = T.unsafe(nil)); end - # source://activesupport//lib/active_support/message_encryptor.rb#90 + # source://activesupport//lib/active_support/message_encryptor.rb#93 def use_authenticated_message_encryption; end - # source://activesupport//lib/active_support/message_encryptor.rb#90 + # source://activesupport//lib/active_support/message_encryptor.rb#93 def use_authenticated_message_encryption=(val); end end end -# source://activesupport//lib/active_support/message_encryptor.rb#122 +# source://activesupport//lib/active_support/message_encryptor.rb#118 +ActiveSupport::MessageEncryptor::AUTH_TAG_LENGTH = T.let(T.unsafe(nil), Integer) + +# source://activesupport//lib/active_support/message_encryptor.rb#115 class ActiveSupport::MessageEncryptor::InvalidMessage < ::StandardError; end -# source://activesupport//lib/active_support/message_encryptor.rb#102 +# source://activesupport//lib/active_support/message_encryptor.rb#105 module ActiveSupport::MessageEncryptor::NullSerializer class << self - # source://activesupport//lib/active_support/message_encryptor.rb#107 + # source://activesupport//lib/active_support/message_encryptor.rb#110 def dump(value); end - # source://activesupport//lib/active_support/message_encryptor.rb#103 + # source://activesupport//lib/active_support/message_encryptor.rb#106 def load(value); end end end -# source://activesupport//lib/active_support/message_encryptor.rb#112 -module ActiveSupport::MessageEncryptor::NullVerifier - class << self - # source://activesupport//lib/active_support/message_encryptor.rb#117 - def generate(value); end +# source://activesupport//lib/active_support/message_encryptor.rb#116 +ActiveSupport::MessageEncryptor::OpenSSLCipherError = OpenSSL::Cipher::CipherError - # source://activesupport//lib/active_support/message_encryptor.rb#113 - def verify(value); end - end -end +# source://activesupport//lib/active_support/message_encryptor.rb#119 +ActiveSupport::MessageEncryptor::SEPARATOR = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/message_encryptor.rb#123 -ActiveSupport::MessageEncryptor::OpenSSLCipherError = OpenSSL::Cipher::CipherError +# source://activesupport//lib/active_support/message_encryptors.rb#6 +class ActiveSupport::MessageEncryptors < ::ActiveSupport::Messages::RotationCoordinator + private + + # source://activesupport//lib/active_support/message_encryptors.rb#187 + def build(salt, secret_generator:, secret_generator_options:, **options); end +end +# = Active Support Message Verifier +# # +MessageVerifier+ makes it easy to generate and verify messages which are # signed to prevent tampering. # +# In a \Rails application, you can use +Rails.application.message_verifier+ +# to manage unique instances of verifiers for each use case. +# {Learn more}[link:classes/Rails/Application.html#method-i-message_verifier]. +# # This is useful for cases like remember-me tokens and auto-unsubscribe links # where the session store isn't suitable or available. # -# Remember Me: -# cookies[:remember_me] = @verifier.generate([@user.id, 2.weeks.from_now]) +# First, generate a signed message: +# cookies[:remember_me] = Rails.application.message_verifier(:remember_me).generate([@user.id, 2.weeks.from_now]) # -# In the authentication filter: +# Later verify that message: # -# id, time = @verifier.verify(cookies[:remember_me]) -# if Time.now < time +# id, time = Rails.application.message_verifier(:remember_me).verify(cookies[:remember_me]) +# if time.future? # self.current_user = User.find(id) # end # -# By default it uses Marshal to serialize the message. If you want to use -# another serialization method, you can set the serializer in the options -# hash upon initialization: +# === Signing is not encryption # -# @verifier = ActiveSupport::MessageVerifier.new('s3Krit', serializer: YAML) +# The signed messages are not encrypted. The payload is merely encoded (Base64 by default) and can be decoded by +# anyone. The signature is just assuring that the message wasn't tampered with. For example: # -# +MessageVerifier+ creates HMAC signatures using SHA1 hash algorithm by default. -# If you want to use a different hash algorithm, you can change it by providing -# +:digest+ key as an option while initializing the verifier: +# message = Rails.application.message_verifier('my_purpose').generate('never put secrets here') +# # => "BAhJIhtuZXZlciBwdXQgc2VjcmV0cyBoZXJlBjoGRVQ=--a0c1c0827919da5e949e989c971249355735e140" +# Base64.decode64(message.split("--").first) # no key needed +# # => 'never put secrets here' # -# @verifier = ActiveSupport::MessageVerifier.new('s3Krit', digest: 'SHA256') +# If you also need to encrypt the contents, you must use ActiveSupport::MessageEncryptor instead. # -# === Confining messages to a specific purpose +# === Confine messages to a specific purpose # -# By default any message can be used throughout your app. But they can also be -# confined to a specific +:purpose+. +# It's not recommended to use the same verifier for different purposes in your application. +# Doing so could allow a malicious actor to re-use a signed message to perform an unauthorized +# action. +# You can reduce this risk by confining signed messages to a specific +:purpose+. # -# token = @verifier.generate("this is the chair", purpose: :login) +# token = @verifier.generate("signed message", purpose: :login) # # Then that same purpose must be passed when verifying to get the data back out: # -# @verifier.verified(token, purpose: :login) # => "this is the chair" +# @verifier.verified(token, purpose: :login) # => "signed message" # @verifier.verified(token, purpose: :shipping) # => nil # @verifier.verified(token) # => nil # -# @verifier.verify(token, purpose: :login) # => "this is the chair" -# @verifier.verify(token, purpose: :shipping) # => ActiveSupport::MessageVerifier::InvalidSignature -# @verifier.verify(token) # => ActiveSupport::MessageVerifier::InvalidSignature +# @verifier.verify(token, purpose: :login) # => "signed message" +# @verifier.verify(token, purpose: :shipping) # => raises ActiveSupport::MessageVerifier::InvalidSignature +# @verifier.verify(token) # => raises ActiveSupport::MessageVerifier::InvalidSignature # # Likewise, if a message has no purpose it won't be returned when verifying with # a specific purpose. # -# token = @verifier.generate("the conversation is lively") -# @verifier.verified(token, purpose: :scare_tactics) # => nil -# @verifier.verified(token) # => "the conversation is lively" +# token = @verifier.generate("signed message") +# @verifier.verified(token, purpose: :redirect) # => nil +# @verifier.verified(token) # => "signed message" # -# @verifier.verify(token, purpose: :scare_tactics) # => ActiveSupport::MessageVerifier::InvalidSignature -# @verifier.verify(token) # => "the conversation is lively" +# @verifier.verify(token, purpose: :redirect) # => raises ActiveSupport::MessageVerifier::InvalidSignature +# @verifier.verify(token) # => "signed message" # -# === Making messages expire +# === Expiring messages # # By default messages last forever and verifying one year from now will still # return the original value. But messages can be set to expire at a given # time with +:expires_in+ or +:expires_at+. # -# @verifier.generate("parcel", expires_in: 1.month) -# @verifier.generate("doowad", expires_at: Time.now.end_of_year) +# @verifier.generate("signed message", expires_in: 1.month) +# @verifier.generate("signed message", expires_at: Time.now.end_of_year) # -# Then the messages can be verified and returned up to the expire time. +# Messages can then be verified and returned until expiry. # Thereafter, the +verified+ method returns +nil+ while +verify+ raises -# ActiveSupport::MessageVerifier::InvalidSignature. +# +ActiveSupport::MessageVerifier::InvalidSignature+. # # === Rotating keys # @@ -7152,41 +9480,126 @@ ActiveSupport::MessageEncryptor::OpenSSLCipherError = OpenSSL::Cipher::CipherErr # Then gradually rotate the old values out by adding them as fallbacks. Any message # generated with the old values will then work until the rotation is removed. # -# verifier.rotate old_secret # Fallback to an old secret instead of @secret. -# verifier.rotate digest: "SHA256" # Fallback to an old digest instead of SHA512. -# verifier.rotate serializer: Marshal # Fallback to an old serializer instead of JSON. +# verifier.rotate(old_secret) # Fallback to an old secret instead of @secret. +# verifier.rotate(digest: "SHA256") # Fallback to an old digest instead of SHA512. +# verifier.rotate(serializer: Marshal) # Fallback to an old serializer instead of JSON. # # Though the above would most likely be combined into one rotation: # -# verifier.rotate old_secret, digest: "SHA256", serializer: Marshal +# verifier.rotate(old_secret, digest: "SHA256", serializer: Marshal) # -# source://activesupport//lib/active_support/message_verifier.rb#102 -class ActiveSupport::MessageVerifier +# source://activesupport//lib/active_support/message_verifier.rb#110 +class ActiveSupport::MessageVerifier < ::ActiveSupport::Messages::Codec include ::ActiveSupport::Messages::Rotator - include ::ActiveSupport::Messages::Rotator::Verifier + # Initialize a new MessageVerifier with a secret for the signature. + # + # ==== Options + # + # [+:digest+] + # Digest used for signing. The default is "SHA1". See + # +OpenSSL::Digest+ for alternatives. + # + # [+:serializer+] + # The serializer used to serialize message data. You can specify any + # object that responds to +dump+ and +load+, or you can choose from + # several preconfigured serializers: +:marshal+, +:json_allow_marshal+, + # +:json+, +:message_pack_allow_marshal+, +:message_pack+. + # + # The preconfigured serializers include a fallback mechanism to support + # multiple deserialization formats. For example, the +:marshal+ serializer + # will serialize using +Marshal+, but can deserialize using +Marshal+, + # ActiveSupport::JSON, or ActiveSupport::MessagePack. This makes it easy + # to migrate between serializers. + # + # The +:marshal+, +:json_allow_marshal+, and +:message_pack_allow_marshal+ + # serializers support deserializing using +Marshal+, but the others do + # not. Beware that +Marshal+ is a potential vector for deserialization + # attacks in cases where a message signing secret has been leaked. If + # possible, choose a serializer that does not support +Marshal+. + # + # The +:message_pack+ and +:message_pack_allow_marshal+ serializers use + # ActiveSupport::MessagePack, which can roundtrip some Ruby types that are + # not supported by JSON, and may provide improved performance. However, + # these require the +msgpack+ gem. + # + # When using \Rails, the default depends on +config.active_support.message_serializer+. + # Otherwise, the default is +:marshal+. + # + # [+:url_safe+] + # By default, MessageVerifier generates RFC 4648 compliant strings which are + # not URL-safe. In other words, they can contain "+" and "/". If you want to + # generate URL-safe strings (in compliance with "Base 64 Encoding with URL + # and Filename Safe Alphabet" in RFC 4648), you can pass +true+. + # Note that MessageVerifier will always accept both URL-safe and URL-unsafe + # encoded messages, to allow a smooth transition between the two settings. + # + # [+:force_legacy_metadata_serializer+] + # Whether to use the legacy metadata serializer, which serializes the + # message first, then wraps it in an envelope which is also serialized. This + # was the default in \Rails 7.0 and below. + # + # If you don't pass a truthy value, the default is set using + # +config.active_support.use_message_serializer_for_metadata+. + # # @raise [ArgumentError] # @return [MessageVerifier] a new instance of MessageVerifier # - # source://activesupport//lib/active_support/messages/rotator.rb#6 - def initialize(*secrets, on_rotation: T.unsafe(nil), **options); end + # source://activesupport//lib/active_support/message_verifier.rb#167 + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/message_verifier.rb#310 + def create_message(value, **options); end # Generates a signed message for the provided value. # # The message is signed with the +MessageVerifier+'s secret. # Returns Base64-encoded message joined with the generated signature. # - # verifier = ActiveSupport::MessageVerifier.new 's3Krit' - # verifier.generate 'a private message' # => "BAhJIhRwcml2YXRlLW1lc3NhZ2UGOgZFVA==--e2d724331ebdee96a10fb99b089508d1c72bd772" + # verifier = ActiveSupport::MessageVerifier.new("secret") + # verifier.generate("signed message") # => "BAhJIhNzaWduZWQgbWVzc2FnZQY6BkVU--f67d5f27c3ee0b8483cebf2103757455e947493b" + # + # ==== Options + # + # [+:expires_at+] + # The datetime at which the message expires. After this datetime, + # verification of the message will fail. + # + # message = verifier.generate("hello", expires_at: Time.now.tomorrow) + # verifier.verified(message) # => "hello" + # # 24 hours later... + # verifier.verified(message) # => nil + # verifier.verify(message) # => raises ActiveSupport::MessageVerifier::InvalidSignature + # + # [+:expires_in+] + # The duration for which the message is valid. After this duration has + # elapsed, verification of the message will fail. + # + # message = verifier.generate("hello", expires_in: 24.hours) + # verifier.verified(message) # => "hello" + # # 24 hours later... + # verifier.verified(message) # => nil + # verifier.verify(message) # => raises ActiveSupport::MessageVerifier::InvalidSignature + # + # [+:purpose+] + # The purpose of the message. If specified, the same purpose must be + # specified when verifying the message; otherwise, verification will fail. + # (See #verified and #verify.) # - # source://activesupport//lib/active_support/message_verifier.rb#188 - def generate(value, expires_at: T.unsafe(nil), expires_in: T.unsafe(nil), purpose: T.unsafe(nil)); end + # source://activesupport//lib/active_support/message_verifier.rb#306 + def generate(value, **options); end + + # source://activesupport//lib/active_support/message_verifier.rb#318 + def inspect; end + + # source://activesupport//lib/active_support/message_verifier.rb#314 + def read_message(message, on_rotation: T.unsafe(nil), **options); end # Checks if a signed message could have been generated by signing an object # with the +MessageVerifier+'s secret. # - # verifier = ActiveSupport::MessageVerifier.new 's3Krit' - # signed_message = verifier.generate 'a private message' + # verifier = ActiveSupport::MessageVerifier.new("secret") + # signed_message = verifier.generate("signed message") # verifier.valid_message?(signed_message) # => true # # tampered_message = signed_message.chop # editing the message invalidates the signature @@ -7194,19 +9607,19 @@ class ActiveSupport::MessageVerifier # # @return [Boolean] # - # source://activesupport//lib/active_support/message_verifier.rb#126 - def valid_message?(signed_message); end + # source://activesupport//lib/active_support/message_verifier.rb#183 + def valid_message?(message); end # Decodes the signed message using the +MessageVerifier+'s secret. # - # verifier = ActiveSupport::MessageVerifier.new 's3Krit' + # verifier = ActiveSupport::MessageVerifier.new("secret") # - # signed_message = verifier.generate 'a private message' - # verifier.verified(signed_message) # => 'a private message' + # signed_message = verifier.generate("signed message") + # verifier.verified(signed_message) # => "signed message" # # Returns +nil+ if the message was not signed with the same secret. # - # other_verifier = ActiveSupport::MessageVerifier.new 'd1ff3r3nt-s3Krit' + # other_verifier = ActiveSupport::MessageVerifier.new("different_secret") # other_verifier.verified(signed_message) # => nil # # Returns +nil+ if the message is not Base64-encoded. @@ -7219,114 +9632,229 @@ class ActiveSupport::MessageVerifier # incompatible_message = "test--dad7b06c94abba8d46a15fafaef56c327665d5ff" # verifier.verified(incompatible_message) # => TypeError: incompatible marshal file format # - # source://activesupport//lib/active_support/messages/rotator.rb#36 - def verified(*args, on_rotation: T.unsafe(nil), **options); end + # ==== Options + # + # [+:purpose+] + # The purpose that the message was generated with. If the purpose does not + # match, +verified+ will return +nil+. + # + # message = verifier.generate("hello", purpose: "greeting") + # verifier.verified(message, purpose: "greeting") # => "hello" + # verifier.verified(message, purpose: "chatting") # => nil + # verifier.verified(message) # => nil + # + # message = verifier.generate("bye") + # verifier.verified(message) # => "bye" + # verifier.verified(message, purpose: "greeting") # => nil + # + # source://activesupport//lib/active_support/message_verifier.rb#224 + def verified(message, **options); end # Decodes the signed message using the +MessageVerifier+'s secret. # - # verifier = ActiveSupport::MessageVerifier.new 's3Krit' - # signed_message = verifier.generate 'a private message' + # verifier = ActiveSupport::MessageVerifier.new("secret") + # signed_message = verifier.generate("signed message") # - # verifier.verify(signed_message) # => 'a private message' + # verifier.verify(signed_message) # => "signed message" # # Raises +InvalidSignature+ if the message was not signed with the same # secret or was not Base64-encoded. # - # other_verifier = ActiveSupport::MessageVerifier.new 'd1ff3r3nt-s3Krit' + # other_verifier = ActiveSupport::MessageVerifier.new("different_secret") # other_verifier.verify(signed_message) # => ActiveSupport::MessageVerifier::InvalidSignature # - # source://activesupport//lib/active_support/message_verifier.rb#177 - def verify(*args, **options); end + # ==== Options + # + # [+:purpose+] + # The purpose that the message was generated with. If the purpose does not + # match, +verify+ will raise ActiveSupport::MessageVerifier::InvalidSignature. + # + # message = verifier.generate("hello", purpose: "greeting") + # verifier.verify(message, purpose: "greeting") # => "hello" + # verifier.verify(message, purpose: "chatting") # => raises InvalidSignature + # verifier.verify(message) # => raises InvalidSignature + # + # message = verifier.generate("bye") + # verifier.verify(message) # => "bye" + # verifier.verify(message, purpose: "greeting") # => raises InvalidSignature + # + # source://activesupport//lib/active_support/message_verifier.rb#262 + def verify(message, **options); end private - # source://activesupport//lib/active_support/message_verifier.rb#198 - def decode(data); end + # source://activesupport//lib/active_support/message_verifier.rb#323 + def decode(encoded, url_safe: T.unsafe(nil)); end - # source://activesupport//lib/active_support/message_verifier.rb#206 + # source://activesupport//lib/active_support/message_verifier.rb#356 def digest_length_in_hex; end # @return [Boolean] # - # source://activesupport//lib/active_support/message_verifier.rb#233 + # source://activesupport//lib/active_support/message_verifier.rb#373 def digest_matches_data?(digest, data); end - # source://activesupport//lib/active_support/message_verifier.rb#194 - def encode(data); end + # source://activesupport//lib/active_support/message_verifier.rb#335 + def extract_encoded(signed); end - # source://activesupport//lib/active_support/message_verifier.rb#202 + # source://activesupport//lib/active_support/message_verifier.rb#352 def generate_digest(data); end - # source://activesupport//lib/active_support/message_verifier.rb#221 - def get_data_and_digest_from(signed_message); end + # @return [Boolean] + # + # source://activesupport//lib/active_support/message_verifier.rb#364 + def separator_at?(signed_message, index); end - # source://activesupport//lib/active_support/message_verifier.rb#214 + # source://activesupport//lib/active_support/message_verifier.rb#368 def separator_index_for(signed_message); end + + # source://activesupport//lib/active_support/message_verifier.rb#330 + def sign_encoded(encoded); end end -# source://activesupport//lib/active_support/message_verifier.rb#105 +# source://activesupport//lib/active_support/message_verifier.rb#113 class ActiveSupport::MessageVerifier::InvalidSignature < ::StandardError; end -# source://activesupport//lib/active_support/message_verifier.rb#107 +# source://activesupport//lib/active_support/message_verifier.rb#115 ActiveSupport::MessageVerifier::SEPARATOR = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/message_verifier.rb#108 +# source://activesupport//lib/active_support/message_verifier.rb#116 ActiveSupport::MessageVerifier::SEPARATOR_LENGTH = T.let(T.unsafe(nil), Integer) -# source://activesupport//lib/active_support/messages/metadata.rb#6 +# source://activesupport//lib/active_support/message_verifiers.rb#6 +class ActiveSupport::MessageVerifiers < ::ActiveSupport::Messages::RotationCoordinator + private + + # source://activesupport//lib/active_support/message_verifiers.rb#185 + def build(salt, secret_generator:, secret_generator_options:, **options); end +end + +# source://activesupport//lib/active_support/messages/rotation_coordinator.rb#6 module ActiveSupport::Messages; end -# source://activesupport//lib/active_support/messages/metadata.rb#7 -class ActiveSupport::Messages::Metadata - # @return [Metadata] a new instance of Metadata +# source://activesupport//lib/active_support/messages/codec.rb#9 +class ActiveSupport::Messages::Codec + include ::ActiveSupport::Messages::Metadata + + # @return [Codec] a new instance of Codec # - # source://activesupport//lib/active_support/messages/metadata.rb#8 - def initialize(message, expires_at = T.unsafe(nil), purpose = T.unsafe(nil)); end + # source://activesupport//lib/active_support/messages/codec.rb#15 + def initialize(**options); end - # source://activesupport//lib/active_support/messages/metadata.rb#13 - def as_json(options = T.unsafe(nil)); end + private + + # source://activesupport//lib/active_support/messages/codec.rb#45 + def catch_and_ignore(throwable, &block); end + + # source://activesupport//lib/active_support/messages/codec.rb#52 + def catch_and_raise(throwable, as: T.unsafe(nil), &block); end + + # source://activesupport//lib/active_support/messages/codec.rb#29 + def decode(encoded, url_safe: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/messages/codec.rb#39 + def deserialize(serialized); end + + # source://activesupport//lib/active_support/messages/codec.rb#25 + def encode(data, url_safe: T.unsafe(nil)); end + + # source://activesupport//lib/active_support/messages/codec.rb#35 + def serialize(data); end + + # Returns the value of attribute serializer. + # + # source://activesupport//lib/active_support/messages/codec.rb#23 + def serializer; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/codec.rb#60 + def use_message_serializer_for_metadata?; end + + class << self + # source://activesupport//lib/active_support/messages/codec.rb#12 + def default_serializer; end + + # source://activesupport//lib/active_support/messages/codec.rb#12 + def default_serializer=(value); end + + private + + # source://activesupport//lib/active_support/messages/codec.rb#12 + def __class_attr_default_serializer; end - # source://activesupport//lib/active_support/messages/metadata.rb#58 - def verify(purpose); end + # source://activesupport//lib/active_support/messages/codec.rb#12 + def __class_attr_default_serializer=(new_value); end + end +end +# source://activesupport//lib/active_support/messages/metadata.rb#9 +module ActiveSupport::Messages::Metadata private + # source://activesupport//lib/active_support/messages/metadata.rb#128 + def deserialize_from_json(serialized); end + + # source://activesupport//lib/active_support/messages/metadata.rb#141 + def deserialize_from_json_safe_string(string); end + + # source://activesupport//lib/active_support/messages/metadata.rb#43 + def deserialize_with_metadata(message, **expected_metadata); end + # @return [Boolean] # - # source://activesupport//lib/active_support/messages/metadata.rb#67 - def fresh?; end + # source://activesupport//lib/active_support/messages/metadata.rb#96 + def dual_serialized_metadata_envelope_json?(string); end + + # source://activesupport//lib/active_support/messages/metadata.rb#78 + def extract_from_metadata_envelope(envelope, purpose: T.unsafe(nil)); end # @return [Boolean] # - # source://activesupport//lib/active_support/messages/metadata.rb#63 - def match?(purpose); end + # source://activesupport//lib/active_support/messages/metadata.rb#92 + def metadata_envelope?(object); end - # source://activesupport//lib/active_support/messages/metadata.rb#71 - def parse_expires_at(expires_at); end + # source://activesupport//lib/active_support/messages/metadata.rb#114 + def parse_expiry(expires_at); end - class << self - # source://activesupport//lib/active_support/messages/metadata.rb#26 - def verify(message, purpose); end + # source://activesupport//lib/active_support/messages/metadata.rb#100 + def pick_expiry(expires_at, expires_in); end - # source://activesupport//lib/active_support/messages/metadata.rb#18 - def wrap(message, expires_at: T.unsafe(nil), expires_in: T.unsafe(nil), purpose: T.unsafe(nil)); end + # source://activesupport//lib/active_support/messages/metadata.rb#124 + def serialize_to_json(data); end - private + # source://activesupport//lib/active_support/messages/metadata.rb#137 + def serialize_to_json_safe_string(data); end + + # source://activesupport//lib/active_support/messages/metadata.rb#30 + def serialize_with_metadata(data, **metadata); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/metadata.rb#60 + def use_message_serializer_for_metadata?; end - # source://activesupport//lib/active_support/messages/metadata.rb#53 - def decode(message); end + # source://activesupport//lib/active_support/messages/metadata.rb#64 + def wrap_in_metadata_envelope(hash, expires_at: T.unsafe(nil), expires_in: T.unsafe(nil), purpose: T.unsafe(nil)); end - # source://activesupport//lib/active_support/messages/metadata.rb#49 - def encode(message); end + # source://activesupport//lib/active_support/messages/metadata.rb#71 + def wrap_in_metadata_legacy_envelope(hash, expires_at: T.unsafe(nil), expires_in: T.unsafe(nil), purpose: T.unsafe(nil)); end - # source://activesupport//lib/active_support/messages/metadata.rb#39 - def extract_metadata(message); end + class << self + # source://activesupport//lib/active_support/messages/metadata.rb#10 + def use_message_serializer_for_metadata; end - # source://activesupport//lib/active_support/messages/metadata.rb#31 - def pick_expiry(expires_at, expires_in); end + # source://activesupport//lib/active_support/messages/metadata.rb#10 + def use_message_serializer_for_metadata=(_arg0); end end end +# source://activesupport//lib/active_support/messages/metadata.rb#12 +ActiveSupport::Messages::Metadata::ENVELOPE_SERIALIZERS = T.let(T.unsafe(nil), Array) + +# source://activesupport//lib/active_support/messages/metadata.rb#19 +ActiveSupport::Messages::Metadata::TIMESTAMP_SERIALIZERS = T.let(T.unsafe(nil), Array) + # source://activesupport//lib/active_support/messages/rotation_configuration.rb#5 class ActiveSupport::Messages::RotationConfiguration # @return [RotationConfiguration] a new instance of RotationConfiguration @@ -7348,52 +9876,240 @@ class ActiveSupport::Messages::RotationConfiguration def signed; end end +# source://activesupport//lib/active_support/messages/rotation_coordinator.rb#7 +class ActiveSupport::Messages::RotationCoordinator + # @raise [ArgumentError] + # @return [RotationCoordinator] a new instance of RotationCoordinator + # + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#10 + def initialize(&secret_generator); end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#18 + def [](salt); end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#22 + def []=(salt, codec); end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#48 + def clear_rotations; end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#54 + def on_rotation(&callback); end + + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#35 + def prepend(**options, &block); end + + # @raise [ArgumentError] + # + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#26 + def rotate(**options, &block); end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#44 + def rotate_defaults; end + + # Returns the value of attribute transitional. + # + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#8 + def transitional; end + + # Sets the attribute transitional + # + # @param value the value to set the attribute transitional to. + # + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#8 + def transitional=(_arg0); end + + private + + # @raise [NotImplementedError] + # + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#97 + def build(salt, secret_generator:, secret_generator_options:, **options); end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#85 + def build_with_rotations(salt); end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#60 + def changing_configuration!; end + + # source://activesupport//lib/active_support/messages/rotation_coordinator.rb#71 + def normalize_options(options); end +end + # source://activesupport//lib/active_support/messages/rotator.rb#5 module ActiveSupport::Messages::Rotator # source://activesupport//lib/active_support/messages/rotator.rb#6 - def initialize(*secrets, on_rotation: T.unsafe(nil), **options); end + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # source://activesupport//lib/active_support/messages/rotator.rb#23 + def fall_back_to(fallback); end + + # source://activesupport//lib/active_support/messages/rotator.rb#18 + def on_rotation(&on_rotation); end + + # source://activesupport//lib/active_support/messages/rotator.rb#28 + def read_message(message, on_rotation: T.unsafe(nil), **options); end # source://activesupport//lib/active_support/messages/rotator.rb#14 - def rotate(*secrets, **options); end + def rotate(*args, **options); end private - # source://activesupport//lib/active_support/messages/rotator.rb#47 - def run_rotations(on_rotation); end + # source://activesupport//lib/active_support/messages/rotator.rb#54 + def build_rotation(*args, **options); end + + # source://activesupport//lib/active_support/messages/rotator.rb#58 + def catch_rotation_error(&block); end + + # source://activesupport//lib/active_support/messages/rotator.rb#48 + def initialize_dup(*_arg0); end end -# source://activesupport//lib/active_support/messages/rotator.rb#18 -module ActiveSupport::Messages::Rotator::Encryptor - include ::ActiveSupport::Messages::Rotator +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#8 +module ActiveSupport::Messages::SerializerWithFallback + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#17 + def load(dumped); end + + private + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#33 + def detect_format(dumped); end - # source://activesupport//lib/active_support/messages/rotator.rb#21 - def decrypt_and_verify(*args, on_rotation: T.unsafe(nil), **options); end + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#44 + def fallback?(format); end + + class << self + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#9 + def [](format); end + end +end +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#48 +module ActiveSupport::Messages::SerializerWithFallback::AllowMarshal private - # source://activesupport//lib/active_support/messages/rotator.rb#28 - def build_rotation(secret = T.unsafe(nil), sign_secret = T.unsafe(nil), options); end + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#50 + def fallback?(format); end end -# source://activesupport//lib/active_support/messages/rotator.rb#33 -module ActiveSupport::Messages::Rotator::Verifier - include ::ActiveSupport::Messages::Rotator +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#78 +module ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#90 + def _load(dumped); end + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#86 + def dump(object); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#96 + def dumped?(dumped); end + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#82 + def format; end + + private + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#101 + def detect_format(dumped); end +end + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#94 +ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback::JSON_START_WITH = T.let(T.unsafe(nil), Regexp) + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#107 +module ActiveSupport::Messages::SerializerWithFallback::JsonWithFallbackAllowMarshal + include ::ActiveSupport::Messages::SerializerWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback::JsonWithFallbackAllowMarshal +end + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#55 +module ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#67 + def _load(dumped); end + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#63 + def dump(object); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#73 + def dumped?(dumped); end + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#59 + def format; end +end - # source://activesupport//lib/active_support/messages/rotator.rb#36 - def verified(*args, on_rotation: T.unsafe(nil), **options); end +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#71 +ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#113 +module ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#125 + def _load(dumped); end + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#121 + def dump(object); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#129 + def dumped?(dumped); end + + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#117 + def format; end private - # source://activesupport//lib/active_support/messages/rotator.rb#41 - def build_rotation(secret = T.unsafe(nil), options); end + # @return [Boolean] + # + # source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#134 + def available?; end +end + +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#143 +module ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallbackAllowMarshal + include ::ActiveSupport::Messages::SerializerWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + include ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallback + extend ::ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + extend ::ActiveSupport::Messages::SerializerWithFallback::MessagePackWithFallbackAllowMarshal end +# source://activesupport//lib/active_support/messages/serializer_with_fallback.rb#149 +ActiveSupport::Messages::SerializerWithFallback::SERIALIZERS = T.let(T.unsafe(nil), Hash) + # source://activesupport//lib/active_support/multibyte.rb#4 module ActiveSupport::Multibyte class << self # Returns the current proxy class. # - # source://activesupport//lib/active_support/multibyte.rb#19 + # source://activesupport//lib/active_support/multibyte.rb#23 def proxy_class; end # The proxy class returned when calling mb_chars. You can use this accessor @@ -7408,6 +10124,8 @@ module ActiveSupport::Multibyte end end +# = Active Support \Multibyte \Chars +# # Chars enables you to work transparently with UTF-8 encoding in the Ruby # String class without having extensive knowledge about the encoding. A # Chars object accepts a string upon initialization and proxies String @@ -7444,7 +10162,7 @@ end # # ActiveSupport::Multibyte.proxy_class = CharsForUTF32 # -# source://activesupport//lib/active_support/multibyte/chars.rb#45 +# source://activesupport//lib/active_support/multibyte/chars.rb#47 class ActiveSupport::Multibyte::Chars include ::Comparable @@ -7452,19 +10170,19 @@ class ActiveSupport::Multibyte::Chars # # @return [Chars] a new instance of Chars # - # source://activesupport//lib/active_support/multibyte/chars.rb#54 - def initialize(string); end + # source://activesupport//lib/active_support/multibyte/chars.rb#56 + def initialize(string, deprecation: T.unsafe(nil)); end - # source://activesupport//lib/active_support/multibyte/chars.rb#51 - def <=>(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/multibyte/chars.rb#53 + def <=>(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/multibyte/chars.rb#51 - def =~(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/multibyte/chars.rb#53 + def =~(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/multibyte/chars.rb#51 - def acts_like_string?(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/multibyte/chars.rb#53 + def acts_like_string?(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/multibyte/chars.rb#159 + # source://activesupport//lib/active_support/multibyte/chars.rb#171 def as_json(options = T.unsafe(nil)); end # Performs composition on all the characters. @@ -7472,7 +10190,7 @@ class ActiveSupport::Multibyte::Chars # 'é'.length # => 1 # 'é'.mb_chars.compose.to_s.length # => 1 # - # source://activesupport//lib/active_support/multibyte/chars.rb#138 + # source://activesupport//lib/active_support/multibyte/chars.rb#150 def compose; end # Performs canonical decomposition on all the characters. @@ -7480,7 +10198,7 @@ class ActiveSupport::Multibyte::Chars # 'é'.length # => 1 # 'é'.mb_chars.decompose.to_s.length # => 2 # - # source://activesupport//lib/active_support/multibyte/chars.rb#130 + # source://activesupport//lib/active_support/multibyte/chars.rb#142 def decompose; end # Returns the number of grapheme clusters in the string. @@ -7488,7 +10206,7 @@ class ActiveSupport::Multibyte::Chars # 'क्षि'.mb_chars.length # => 4 # 'क्षि'.mb_chars.grapheme_length # => 2 # - # source://activesupport//lib/active_support/multibyte/chars.rb#146 + # source://activesupport//lib/active_support/multibyte/chars.rb#158 def grapheme_length; end # Limits the byte size of the string to a number of bytes without breaking @@ -7497,25 +10215,25 @@ class ActiveSupport::Multibyte::Chars # # 'こんにちは'.mb_chars.limit(7).to_s # => "こん" # - # source://activesupport//lib/active_support/multibyte/chars.rb#113 + # source://activesupport//lib/active_support/multibyte/chars.rb#125 def limit(limit); end - # source://activesupport//lib/active_support/multibyte/chars.rb#51 - def match?(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/multibyte/chars.rb#53 + def match?(*_arg0, **_arg1, &_arg2); end # Forward all undefined methods to the wrapped string. # - # source://activesupport//lib/active_support/multibyte/chars.rb#60 - def method_missing(method, *args, &block); end + # source://activesupport//lib/active_support/multibyte/chars.rb#72 + def method_missing(method, *_arg1, **_arg2, &_arg3); end # Reverses all characters in the string. # # 'Café'.mb_chars.reverse.to_s # => 'éfaC' # - # source://activesupport//lib/active_support/multibyte/chars.rb#104 + # source://activesupport//lib/active_support/multibyte/chars.rb#116 def reverse; end - # source://activesupport//lib/active_support/multibyte/chars.rb#164 + # source://activesupport//lib/active_support/multibyte/chars.rb#176 def reverse!(*args); end # Works like String#slice!, but returns an instance of @@ -7528,7 +10246,7 @@ class ActiveSupport::Multibyte::Chars # string.mb_chars.slice!(0..3) # => # # string # => 'me' # - # source://activesupport//lib/active_support/multibyte/chars.rb#94 + # source://activesupport//lib/active_support/multibyte/chars.rb#106 def slice!(*args); end # Works just like String#split, with the exception that the items @@ -7537,7 +10255,7 @@ class ActiveSupport::Multibyte::Chars # # 'Café périferôl'.mb_chars.split(/é/).map { |part| part.upcase.to_s } # => ["CAF", " P", "RIFERÔL"] # - # source://activesupport//lib/active_support/multibyte/chars.rb#81 + # source://activesupport//lib/active_support/multibyte/chars.rb#93 def split(*args); end # Replaces all ISO-8859-1 or CP1252 characters by their UTF-8 equivalent @@ -7546,10 +10264,10 @@ class ActiveSupport::Multibyte::Chars # Passing +true+ will forcibly tidy all bytes, assuming that the string's # encoding is entirely CP1252 or ISO-8859-1. # - # source://activesupport//lib/active_support/multibyte/chars.rb#155 + # source://activesupport//lib/active_support/multibyte/chars.rb#167 def tidy_bytes(force = T.unsafe(nil)); end - # source://activesupport//lib/active_support/multibyte/chars.rb#164 + # source://activesupport//lib/active_support/multibyte/chars.rb#176 def tidy_bytes!(*args); end # Capitalizes the first letter of every word, when possible. @@ -7557,7 +10275,7 @@ class ActiveSupport::Multibyte::Chars # "ÉL QUE SE ENTERÓ".mb_chars.titleize.to_s # => "Él Que Se Enteró" # "日本語".mb_chars.titleize.to_s # => "日本語" # - # source://activesupport//lib/active_support/multibyte/chars.rb#121 + # source://activesupport//lib/active_support/multibyte/chars.rb#136 def titlecase; end # Capitalizes the first letter of every word, when possible. @@ -7565,27 +10283,27 @@ class ActiveSupport::Multibyte::Chars # "ÉL QUE SE ENTERÓ".mb_chars.titleize.to_s # => "Él Que Se Enteró" # "日本語".mb_chars.titleize.to_s # => "日本語" # - # source://activesupport//lib/active_support/multibyte/chars.rb#121 + # source://activesupport//lib/active_support/multibyte/chars.rb#133 def titleize; end # Returns the value of attribute wrapped_string. # - # source://activesupport//lib/active_support/multibyte/chars.rb#47 + # source://activesupport//lib/active_support/multibyte/chars.rb#50 def to_s; end # Returns the value of attribute wrapped_string. # - # source://activesupport//lib/active_support/multibyte/chars.rb#47 + # source://activesupport//lib/active_support/multibyte/chars.rb#51 def to_str; end # Returns the value of attribute wrapped_string. # - # source://activesupport//lib/active_support/multibyte/chars.rb#47 + # source://activesupport//lib/active_support/multibyte/chars.rb#49 def wrapped_string; end private - # source://activesupport//lib/active_support/multibyte/chars.rb#171 + # source://activesupport//lib/active_support/multibyte/chars.rb#183 def chars(string); end # Returns +true+ if _obj_ responds to the given method. Private methods @@ -7594,7 +10312,7 @@ class ActiveSupport::Multibyte::Chars # # @return [Boolean] # - # source://activesupport//lib/active_support/multibyte/chars.rb#72 + # source://activesupport//lib/active_support/multibyte/chars.rb#84 def respond_to_missing?(method, include_private); end end @@ -7618,12 +10336,12 @@ module ActiveSupport::Multibyte::Unicode # Passing +true+ will forcibly tidy all bytes, assuming that the string's # encoding is entirely CP1252 or ISO-8859-1. # - # source://activesupport//lib/active_support/multibyte/unicode.rb#32 + # source://activesupport//lib/active_support/multibyte/unicode.rb#30 def tidy_bytes(string, force = T.unsafe(nil)); end private - # source://activesupport//lib/active_support/multibyte/unicode.rb#65 + # source://activesupport//lib/active_support/multibyte/unicode.rb#37 def recode_windows1252_chars(string); end end @@ -7634,7 +10352,7 @@ ActiveSupport::Multibyte::Unicode::UNICODE_VERSION = T.let(T.unsafe(nil), String # = \Notifications # -# ActiveSupport::Notifications provides an instrumentation API for +# +ActiveSupport::Notifications+ provides an instrumentation API for # Ruby. # # == Instrumenters @@ -7657,6 +10375,16 @@ ActiveSupport::Multibyte::Unicode::UNICODE_VERSION = T.let(T.unsafe(nil), String # You can consume those events and the information they provide by registering # a subscriber. # +# ActiveSupport::Notifications.subscribe('render') do |event| +# event.name # => "render" +# event.duration # => 10 (in milliseconds) +# event.payload # => { extra: :information } +# event.allocations # => 1826 (objects) +# end +# +# +Event+ objects record CPU time and allocations. If you don't need this +# it's also possible to pass a block that accepts five arguments: +# # ActiveSupport::Notifications.subscribe('render') do |name, start, finish, id, payload| # name # => String, name of the event (such as 'render' from above) # start # => Time, when the instrumented block started execution @@ -7670,20 +10398,18 @@ ActiveSupport::Multibyte::Unicode::UNICODE_VERSION = T.let(T.unsafe(nil), String # # ActiveSupport::Notifications.monotonic_subscribe('render') do |name, start, finish, id, payload| # name # => String, name of the event (such as 'render' from above) -# start # => Monotonic time, when the instrumented block started execution -# finish # => Monotonic time, when the instrumented block ended execution +# start # => Float, monotonic time when the instrumented block started execution +# finish # => Float, monotonic time when the instrumented block ended execution # id # => String, unique ID for the instrumenter that fired the event # payload # => Hash, the payload # end # -# The +start+ and +finish+ values above represent monotonic time. -# # For instance, let's store all "render" events in an array: # # events = [] # -# ActiveSupport::Notifications.subscribe('render') do |*args| -# events << ActiveSupport::Notifications::Event.new(*args) +# ActiveSupport::Notifications.subscribe('render') do |event| +# events << event # end # # That code returns right away, you are just subscribing to "render" events. @@ -7694,14 +10420,10 @@ ActiveSupport::Multibyte::Unicode::UNICODE_VERSION = T.let(T.unsafe(nil), String # end # # event = events.first -# event.name # => "render" -# event.duration # => 10 (in milliseconds) -# event.payload # => { extra: :information } -# -# The block in the subscribe call gets the name of the event, start -# timestamp, end timestamp, a string with a unique identifier for that event's instrumenter -# (something like "535801666f04d0298cd6"), and a hash with the payload, in -# that order. +# event.name # => "render" +# event.duration # => 10 (in milliseconds) +# event.payload # => { extra: :information } +# event.allocations # => 1826 (objects) # # If an exception happens during that particular instrumentation the payload will # have a key :exception with an array of two elements as value: a string with @@ -7766,7 +10488,7 @@ ActiveSupport::Multibyte::Unicode::UNICODE_VERSION = T.let(T.unsafe(nil), String # You can subscribe to some event temporarily while some block runs. For # example, in # -# callback = lambda {|*args| ... } +# callback = lambda {|event| ... } # ActiveSupport::Notifications.subscribed(callback, "sql.active_record") do # ... # end @@ -7789,7 +10511,7 @@ ActiveSupport::Multibyte::Unicode::UNICODE_VERSION = T.let(T.unsafe(nil), String # # The +subscribe+ method returns a subscriber object: # -# subscriber = ActiveSupport::Notifications.subscribe("render") do |*args| +# subscriber = ActiveSupport::Notifications.subscribe("render") do |event| # ... # end # @@ -7817,13 +10539,13 @@ ActiveSupport::Multibyte::Unicode::UNICODE_VERSION = T.let(T.unsafe(nil), String # Notifications ships with a queue implementation that consumes and publishes events # to all log subscribers. You can use any queue implementation you want. # -# source://activesupport//lib/active_support/notifications/instrumenter.rb#6 +# source://activesupport//lib/active_support/notifications/instrumenter.rb#7 module ActiveSupport::Notifications class << self - # source://activesupport//lib/active_support/notifications.rb#204 + # source://activesupport//lib/active_support/notifications.rb#208 def instrument(name, payload = T.unsafe(nil)); end - # source://activesupport//lib/active_support/notifications.rb#268 + # source://activesupport//lib/active_support/notifications.rb#269 def instrumenter; end # Performs the same functionality as #subscribe, but the +start+ and @@ -7833,25 +10555,25 @@ module ActiveSupport::Notifications # duration is important. For example, computing elapsed time between # two events. # - # source://activesupport//lib/active_support/notifications.rb#253 + # source://activesupport//lib/active_support/notifications.rb#254 def monotonic_subscribe(pattern = T.unsafe(nil), callback = T.unsafe(nil), &block); end # Returns the value of attribute notifier. # - # source://activesupport//lib/active_support/notifications.rb#194 + # source://activesupport//lib/active_support/notifications.rb#198 def notifier; end # Sets the attribute notifier # # @param value the value to set the attribute notifier to. # - # source://activesupport//lib/active_support/notifications.rb#194 + # source://activesupport//lib/active_support/notifications.rb#198 def notifier=(_arg0); end - # source://activesupport//lib/active_support/notifications.rb#196 + # source://activesupport//lib/active_support/notifications.rb#200 def publish(name, *args); end - # source://activesupport//lib/active_support/notifications.rb#200 + # source://activesupport//lib/active_support/notifications.rb#204 def publish_event(event); end # Subscribe to a given event name with the passed +block+. @@ -7859,11 +10581,15 @@ module ActiveSupport::Notifications # You can subscribe to events by passing a String to match exact event # names, or by passing a Regexp to match all events that match a pattern. # - # ActiveSupport::Notifications.subscribe(/render/) do |*args| - # @event = ActiveSupport::Notifications::Event.new(*args) + # If the block passed to the method only takes one argument, + # it will yield an +Event+ object to the block: + # + # ActiveSupport::Notifications.subscribe(/render/) do |event| + # @event = event # end # - # The +block+ will receive five parameters with information about the event: + # Otherwise the +block+ will receive five arguments with information + # about the event: # # ActiveSupport::Notifications.subscribe('render') do |name, start, finish, id, payload| # name # => String, name of the event (such as 'render' from above) @@ -7873,66 +10599,51 @@ module ActiveSupport::Notifications # payload # => Hash, the payload # end # - # If the block passed to the method only takes one parameter, - # it will yield an event object to the block: - # - # ActiveSupport::Notifications.subscribe(/render/) do |event| - # @event = event - # end - # # Raises an error if invalid event name type is passed: # - # ActiveSupport::Notifications.subscribe(:render) {|*args| ...} - # #=> ArgumentError (pattern must be specified as a String, Regexp or empty) + # ActiveSupport::Notifications.subscribe(:render) {|event| ...} + # #=> ArgumentError (pattern must be specified as a String, Regexp or empty) # - # source://activesupport//lib/active_support/notifications.rb#243 + # source://activesupport//lib/active_support/notifications.rb#244 def subscribe(pattern = T.unsafe(nil), callback = T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/notifications.rb#257 + # source://activesupport//lib/active_support/notifications.rb#258 def subscribed(callback, pattern = T.unsafe(nil), monotonic: T.unsafe(nil), &block); end - # source://activesupport//lib/active_support/notifications.rb#264 + # source://activesupport//lib/active_support/notifications.rb#265 def unsubscribe(subscriber_or_name); end private - # source://activesupport//lib/active_support/notifications.rb#273 + # source://activesupport//lib/active_support/notifications.rb#274 def registry; end end end -# source://activesupport//lib/active_support/notifications/instrumenter.rb#58 +# source://activesupport//lib/active_support/notifications/instrumenter.rb#106 class ActiveSupport::Notifications::Event # @return [Event] a new instance of Event # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#62 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#110 def initialize(name, start, ending, transaction_id, payload); end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#136 - def <<(event); end - - # Returns the number of allocations made since the call to +start!+ and - # the call to +finish!+ + # Returns the number of allocations made between the call to #start! and + # the call to #finish!. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#116 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#176 def allocations; end - # Returns the value of attribute children. - # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#59 - def children; end - - # Returns the CPU time (in milliseconds) passed since the call to - # +start!+ and the call to +finish!+ + # Returns the CPU time (in milliseconds) passed between the call to + # #start! and the call to #finish!. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#104 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#163 def cpu_time; end # Returns the difference in milliseconds between when the execution of the # event started and when it ended. # - # ActiveSupport::Notifications.subscribe('wait') do |*args| - # @event = ActiveSupport::Notifications::Event.new(*args) + # ActiveSupport::Notifications.subscribe('wait') do |event| + # @event = event # end # # ActiveSupport::Notifications.instrument('wait') do @@ -7941,77 +10652,77 @@ class ActiveSupport::Notifications::Event # # @event.duration # => 1000.138 # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#132 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#198 def duration; end - # Returns the value of attribute end. - # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#59 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#128 def end; end # Record information at the time this event finishes # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#96 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#154 def finish!; end - # Returns the idle time time (in milliseconds) passed since the call to - # +start!+ and the call to +finish!+ + # Returns the time spent in GC (in milliseconds) between the call to #start! + # and the call to #finish! # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#110 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#182 + def gc_time; end + + # Returns the idle time (in milliseconds) passed between the call to + # #start! and the call to #finish!. + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#169 def idle_time; end # Returns the value of attribute name. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#59 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#107 def name; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#140 - def parent_of?(event); end - # Returns the value of attribute payload. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#60 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#108 def payload; end # Sets the attribute payload # # @param value the value to set the attribute payload to. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#60 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#108 def payload=(_arg0); end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#75 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#132 def record; end # Record information at the time this event starts # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#89 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#146 def start!; end - # Returns the value of attribute time. - # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#59 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#124 def time; end # Returns the value of attribute transaction_id. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#59 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#107 def transaction_id; end private - # source://activesupport//lib/active_support/notifications/instrumenter.rb#145 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#203 def now; end # Likely on JRuby, TruffleRuby # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#162 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#230 def now_allocations; end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#152 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#210 def now_cpu; end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#220 + def now_gc; end end # This is a default queue implementation that ships with Notifications. @@ -8019,218 +10730,349 @@ end # # This class is thread safe. All methods are reentrant. # -# source://activesupport//lib/active_support/notifications/fanout.rb#24 +# source://activesupport//lib/active_support/notifications/fanout.rb#55 class ActiveSupport::Notifications::Fanout - include ::Mutex_m + include ::ActiveSupport::Notifications::FanoutIteration # @return [Fanout] a new instance of Fanout # - # source://activesupport//lib/active_support/notifications/fanout.rb#27 + # source://activesupport//lib/active_support/notifications/fanout.rb#56 def initialize; end - # source://activesupport//lib/active_support/notifications/fanout.rb#75 + # source://activesupport//lib/active_support/notifications/fanout.rb#319 + def all_listeners_for(name); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#286 + def build_handle(name, id, payload); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#106 + def clear_cache(key = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#305 def finish(name, id, payload, listeners = T.unsafe(nil)); end - # source://activesupport//lib/active_support/notifications/fanout.rb#87 - def iterate_guarding_exceptions(listeners); end + # source://activesupport//lib/active_support/notifications/fanout.rb#190 + def group_listeners(listeners); end - # source://activesupport//lib/active_support/notifications/fanout.rb#108 + # source://activesupport//lib/active_support/notifications/fanout.rb#196 + def groups_for(name); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#64 + def inspect; end + + # source://activesupport//lib/active_support/notifications/fanout.rb#328 def listeners_for(name); end # @return [Boolean] # - # source://activesupport//lib/active_support/notifications/fanout.rb#117 + # source://activesupport//lib/active_support/notifications/fanout.rb#332 def listening?(name); end - # source://mutex_m/0.1.0/mutex_m.rb#92 - def lock; end - - # source://mutex_m/0.1.0/mutex_m.rb#82 - def locked?; end - - # source://activesupport//lib/active_support/notifications/fanout.rb#79 - def publish(name, *args); end + # source://activesupport//lib/active_support/notifications/fanout.rb#311 + def publish(name, *_arg1, **_arg2, &_arg3); end - # source://activesupport//lib/active_support/notifications/fanout.rb#83 + # source://activesupport//lib/active_support/notifications/fanout.rb#315 def publish_event(event); end - # source://activesupport//lib/active_support/notifications/fanout.rb#71 + # source://activesupport//lib/active_support/notifications/fanout.rb#298 def start(name, id, payload); end - # source://activesupport//lib/active_support/notifications/fanout.rb#34 + # source://activesupport//lib/active_support/notifications/fanout.rb#69 def subscribe(pattern = T.unsafe(nil), callable = T.unsafe(nil), monotonic: T.unsafe(nil), &block); end - # source://mutex_m/0.1.0/mutex_m.rb#77 - def synchronize(&block); end - - # source://mutex_m/0.1.0/mutex_m.rb#87 - def try_lock; end - - # source://mutex_m/0.1.0/mutex_m.rb#97 - def unlock; end - - # source://activesupport//lib/active_support/notifications/fanout.rb#51 + # source://activesupport//lib/active_support/notifications/fanout.rb#86 def unsubscribe(subscriber_or_name); end # This is a sync queue, so there is no waiting. # - # source://activesupport//lib/active_support/notifications/fanout.rb#122 + # source://activesupport//lib/active_support/notifications/fanout.rb#337 def wait; end end -# source://activesupport//lib/active_support/notifications/fanout.rb#125 -module ActiveSupport::Notifications::Fanout::Subscribers - class << self - # source://activesupport//lib/active_support/notifications/fanout.rb#126 - def new(pattern, listener, monotonic); end - end +# source://activesupport//lib/active_support/notifications/fanout.rb#116 +class ActiveSupport::Notifications::Fanout::BaseGroup + include ::ActiveSupport::Notifications::FanoutIteration + + # @return [BaseGroup] a new instance of BaseGroup + # + # source://activesupport//lib/active_support/notifications/fanout.rb#119 + def initialize(listeners, name, id, payload); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#123 + def each(&block); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#257 -class ActiveSupport::Notifications::Fanout::Subscribers::EventObject < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented - # source://activesupport//lib/active_support/notifications/fanout.rb#265 +# source://activesupport//lib/active_support/notifications/fanout.rb#128 +class ActiveSupport::Notifications::Fanout::BaseTimeGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # source://activesupport//lib/active_support/notifications/fanout.rb#133 def finish(name, id, payload); end - # source://activesupport//lib/active_support/notifications/fanout.rb#273 - def publish_event(event); end + # source://activesupport//lib/active_support/notifications/fanout.rb#129 + def start(name, id, payload); end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#169 +class ActiveSupport::Notifications::Fanout::EventObjectGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # source://activesupport//lib/active_support/notifications/fanout.rb#175 + def finish(name, id, payload); end - # source://activesupport//lib/active_support/notifications/fanout.rb#258 + # source://activesupport//lib/active_support/notifications/fanout.rb#170 def start(name, id, payload); end private - # source://activesupport//lib/active_support/notifications/fanout.rb#278 + # source://activesupport//lib/active_support/notifications/fanout.rb#185 def build_event(name, id, payload); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#182 -class ActiveSupport::Notifications::Fanout::Subscribers::Evented - # @return [Evented] a new instance of Evented - # - # source://activesupport//lib/active_support/notifications/fanout.rb#185 - def initialize(pattern, delegate); end - - # source://activesupport//lib/active_support/notifications/fanout.rb#210 +# source://activesupport//lib/active_support/notifications/fanout.rb#155 +class ActiveSupport::Notifications::Fanout::EventedGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # source://activesupport//lib/active_support/notifications/fanout.rb#162 def finish(name, id, payload); end - # Returns the value of attribute pattern. + # source://activesupport//lib/active_support/notifications/fanout.rb#156 + def start(name, id, payload); end +end + +# A +Handle+ is used to record the start and finish time of event. +# +# Both #start and #finish must each be called exactly once. +# +# Where possible, it's best to use the block form: ActiveSupport::Notifications.instrument. +# +Handle+ is a low-level API intended for cases where the block form can't be used. +# +# handle = ActiveSupport::Notifications.instrumenter.build_handle("my.event", {}) +# begin +# handle.start +# # work to be instrumented +# ensure +# handle.finish +# end +# +# source://activesupport//lib/active_support/notifications/fanout.rb#230 +class ActiveSupport::Notifications::Fanout::Handle + include ::ActiveSupport::Notifications::FanoutIteration + + # @return [Handle] a new instance of Handle # - # source://activesupport//lib/active_support/notifications/fanout.rb#183 - def pattern; end + # source://activesupport//lib/active_support/notifications/fanout.rb#233 + def initialize(notifier, name, id, groups, payload); end - # source://activesupport//lib/active_support/notifications/fanout.rb#192 - def publish(name, *args); end + # source://activesupport//lib/active_support/notifications/fanout.rb#250 + def finish; end - # source://activesupport//lib/active_support/notifications/fanout.rb#198 - def publish_event(event); end + # source://activesupport//lib/active_support/notifications/fanout.rb#254 + def finish_with_values(name, id, payload); end - # source://activesupport//lib/active_support/notifications/fanout.rb#206 - def start(name, id, payload); end + # source://activesupport//lib/active_support/notifications/fanout.rb#241 + def start; end - # @return [Boolean] - # - # source://activesupport//lib/active_support/notifications/fanout.rb#214 - def subscribed_to?(name); end + private - # source://activesupport//lib/active_support/notifications/fanout.rb#218 + # source://activesupport//lib/active_support/notifications/fanout.rb#264 + def ensure_state!(expected); end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#141 +class ActiveSupport::Notifications::Fanout::MonotonicTimedGroup < ::ActiveSupport::Notifications::Fanout::BaseTimeGroup + private + + # source://activesupport//lib/active_support/notifications/fanout.rb#143 + def now; end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#271 +module ActiveSupport::Notifications::Fanout::NullHandle + extend ::ActiveSupport::Notifications::Fanout::NullHandle + + # source://activesupport//lib/active_support/notifications/fanout.rb#277 + def finish; end + + # source://activesupport//lib/active_support/notifications/fanout.rb#280 + def finish_with_values(_name, _id, _payload); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#274 + def start; end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#340 +module ActiveSupport::Notifications::Fanout::Subscribers + class << self + # source://activesupport//lib/active_support/notifications/fanout.rb#341 + def new(pattern, listener, monotonic); end + end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#455 +class ActiveSupport::Notifications::Fanout::Subscribers::EventObject < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented + # source://activesupport//lib/active_support/notifications/fanout.rb#456 + def group_class; end + + # source://activesupport//lib/active_support/notifications/fanout.rb#460 + def publish_event(event); end +end + +# source://activesupport//lib/active_support/notifications/fanout.rb#397 +class ActiveSupport::Notifications::Fanout::Subscribers::Evented + # @return [Evented] a new instance of Evented + # + # source://activesupport//lib/active_support/notifications/fanout.rb#400 + def initialize(pattern, delegate); end + + # Returns the value of attribute delegate. + # + # source://activesupport//lib/active_support/notifications/fanout.rb#398 + def delegate; end + + # source://activesupport//lib/active_support/notifications/fanout.rb#408 + def group_class; end + + # Returns the value of attribute pattern. + # + # source://activesupport//lib/active_support/notifications/fanout.rb#398 + def pattern; end + + # source://activesupport//lib/active_support/notifications/fanout.rb#412 + def publish(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#418 + def publish_event(event); end + + # Returns the value of attribute silenceable. + # + # source://activesupport//lib/active_support/notifications/fanout.rb#398 + def silenceable; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/notifications/fanout.rb#426 + def silenced?(name); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/notifications/fanout.rb#430 + def subscribed_to?(name); end + + # source://activesupport//lib/active_support/notifications/fanout.rb#434 def unsubscribe!(name); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#145 +# source://activesupport//lib/active_support/notifications/fanout.rb#360 class ActiveSupport::Notifications::Fanout::Subscribers::Matcher # @return [Matcher] a new instance of Matcher # - # source://activesupport//lib/active_support/notifications/fanout.rb#158 + # source://activesupport//lib/active_support/notifications/fanout.rb#373 def initialize(pattern); end - # source://activesupport//lib/active_support/notifications/fanout.rb#167 + # source://activesupport//lib/active_support/notifications/fanout.rb#382 def ===(name); end # Returns the value of attribute exclusions. # - # source://activesupport//lib/active_support/notifications/fanout.rb#146 + # source://activesupport//lib/active_support/notifications/fanout.rb#361 def exclusions; end # Returns the value of attribute pattern. # - # source://activesupport//lib/active_support/notifications/fanout.rb#146 + # source://activesupport//lib/active_support/notifications/fanout.rb#361 def pattern; end - # source://activesupport//lib/active_support/notifications/fanout.rb#163 + # source://activesupport//lib/active_support/notifications/fanout.rb#378 def unsubscribe!(name); end class << self - # source://activesupport//lib/active_support/notifications/fanout.rb#148 + # source://activesupport//lib/active_support/notifications/fanout.rb#363 def wrap(pattern); end end end -# source://activesupport//lib/active_support/notifications/fanout.rb#171 +# source://activesupport//lib/active_support/notifications/fanout.rb#386 class ActiveSupport::Notifications::Fanout::Subscribers::Matcher::AllMessages - # source://activesupport//lib/active_support/notifications/fanout.rb#172 + # source://activesupport//lib/active_support/notifications/fanout.rb#387 def ===(name); end - # source://activesupport//lib/active_support/notifications/fanout.rb#176 + # source://activesupport//lib/active_support/notifications/fanout.rb#391 def unsubscribe!(*_arg0); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#240 -class ActiveSupport::Notifications::Fanout::Subscribers::MonotonicTimed < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented - # source://activesupport//lib/active_support/notifications/fanout.rb#250 - def finish(name, id, payload); end +# source://activesupport//lib/active_support/notifications/fanout.rb#449 +class ActiveSupport::Notifications::Fanout::Subscribers::MonotonicTimed < ::ActiveSupport::Notifications::Fanout::Subscribers::Timed + # source://activesupport//lib/active_support/notifications/fanout.rb#450 + def group_class; end +end - # source://activesupport//lib/active_support/notifications/fanout.rb#241 - def publish(name, *args); end +# source://activesupport//lib/active_support/notifications/fanout.rb#439 +class ActiveSupport::Notifications::Fanout::Subscribers::Timed < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented + # source://activesupport//lib/active_support/notifications/fanout.rb#440 + def group_class; end - # source://activesupport//lib/active_support/notifications/fanout.rb#245 - def start(name, id, payload); end + # source://activesupport//lib/active_support/notifications/fanout.rb#444 + def publish(*_arg0, **_arg1, &_arg2); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#223 -class ActiveSupport::Notifications::Fanout::Subscribers::Timed < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented - # source://activesupport//lib/active_support/notifications/fanout.rb#233 - def finish(name, id, payload); end +# source://activesupport//lib/active_support/notifications/fanout.rb#148 +class ActiveSupport::Notifications::Fanout::TimedGroup < ::ActiveSupport::Notifications::Fanout::BaseTimeGroup + private + + # source://activesupport//lib/active_support/notifications/fanout.rb#150 + def now; end +end - # source://activesupport//lib/active_support/notifications/fanout.rb#224 - def publish(name, *args); end +# source://activesupport//lib/active_support/notifications/fanout.rb#18 +module ActiveSupport::Notifications::FanoutIteration + private - # source://activesupport//lib/active_support/notifications/fanout.rb#228 - def start(name, id, payload); end + # source://activesupport//lib/active_support/notifications/fanout.rb#20 + def iterate_guarding_exceptions(collection, &block); end end -# source://activesupport//lib/active_support/notifications/fanout.rb#10 +# source://activesupport//lib/active_support/notifications/fanout.rb#8 class ActiveSupport::Notifications::InstrumentationSubscriberError < ::RuntimeError # @return [InstrumentationSubscriberError] a new instance of InstrumentationSubscriberError # - # source://activesupport//lib/active_support/notifications/fanout.rb#13 + # source://activesupport//lib/active_support/notifications/fanout.rb#11 def initialize(exceptions); end # Returns the value of attribute exceptions. # - # source://activesupport//lib/active_support/notifications/fanout.rb#11 + # source://activesupport//lib/active_support/notifications/fanout.rb#9 def exceptions; end end # Instrumenters are stored in a thread local. # -# source://activesupport//lib/active_support/notifications/instrumenter.rb#8 +# source://activesupport//lib/active_support/notifications/instrumenter.rb#9 class ActiveSupport::Notifications::Instrumenter # @return [Instrumenter] a new instance of Instrumenter # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#11 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#12 def initialize(notifier); end + # Returns a "handle" for an event with the given +name+ and +payload+. + # + # #start and #finish must each be called exactly once on the returned object. + # + # Where possible, it's best to use #instrument, which will record the + # start and finish of the event and correctly handle any exceptions. + # +build_handle+ is a low-level API intended for cases where using + # +instrument+ isn't possible. + # + # See ActiveSupport::Notifications::Fanout::Handle. + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#78 + def build_handle(name, payload); end + # Send a finish notification with +name+ and +payload+. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#44 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#92 def finish(name, payload); end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#48 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#96 def finish_with_state(listeners_state, name, payload); end # Returns the value of attribute id. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#9 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#10 def id; end # Given a block, instrument it by measuring the time taken to execute @@ -8238,494 +11080,615 @@ class ActiveSupport::Notifications::Instrumenter # notifier. Notice that events get sent even if an error occurs in the # passed-in block. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#20 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#54 def instrument(name, payload = T.unsafe(nil)); end - # source://activesupport//lib/active_support/notifications/instrumenter.rb#34 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#82 def new_event(name, payload = T.unsafe(nil)); end # Send a start notification with +name+ and +payload+. # - # source://activesupport//lib/active_support/notifications/instrumenter.rb#39 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#87 def start(name, payload); end private - # source://activesupport//lib/active_support/notifications/instrumenter.rb#53 + # source://activesupport//lib/active_support/notifications/instrumenter.rb#101 def unique_id; end end -# source://activesupport//lib/active_support/number_helper.rb#4 +# source://activesupport//lib/active_support/notifications/instrumenter.rb#21 +class ActiveSupport::Notifications::Instrumenter::LegacyHandle + # @return [LegacyHandle] a new instance of LegacyHandle + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#34 + def initialize(notifier, name, id, payload); end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#45 + def finish; end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#41 + def start; end +end + +# source://activesupport//lib/active_support/notifications/instrumenter.rb#22 +class ActiveSupport::Notifications::Instrumenter::LegacyHandle::Wrapper + # @return [Wrapper] a new instance of Wrapper + # + # source://activesupport//lib/active_support/notifications/instrumenter.rb#23 + def initialize(notifier); end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#27 + def build_handle(name, id, payload); end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#31 + def finish(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/notifications/instrumenter.rb#31 + def start(*_arg0, **_arg1, &_arg2); end +end + +# = Number Helper +# +# Provides methods for formatting numbers into currencies, percentages, +# phone numbers, and more. +# +# Example usage in a class: +# class Topic +# include ActiveSupport::NumberHelper +# +# def price +# number_to_currency(@price) +# end +# end +# +# Example usage in a module: +# require "active_support/number_helper" +# +# module NumberFormatting +# def format_price(price) +# ActiveSupport::NumberHelper.number_to_currency(price) +# end +# end +# +# source://activesupport//lib/active_support/number_helper.rb#26 module ActiveSupport::NumberHelper extend ::ActiveSupport::Autoload extend ::ActiveSupport::NumberHelper - # Formats a +number+ into a currency string (e.g., $13.65). You - # can customize the format in the +options+ hash. + # Formats a +number+ into a currency string. + # + # number_to_currency(1234567890.50) # => "$1,234,567,890.50" + # number_to_currency(1234567890.506) # => "$1,234,567,890.51" + # number_to_currency("12x34") # => "$12x34" + # + # number_to_currency(1234567890.50, unit: "£", separator: ",", delimiter: "") + # # => "£1234567890,50" # # The currency unit and number formatting of the current locale will be used - # unless otherwise specified in the provided options. No currency conversion - # is performed. If the user is given a way to change their locale, they will + # unless otherwise specified via options. No currency conversion is + # performed. If the user is given a way to change their locale, they will # also be able to change the relative value of the currency displayed with # this helper. If your application will ever support multiple locales, you - # may want to specify a constant :locale option or consider - # using a library capable of currency conversion. + # may want to specify a constant +:locale+ option or consider using a + # library capable of currency conversion. # # ==== Options # - # * :locale - Sets the locale to be used for formatting - # (defaults to current locale). - # * :precision - Sets the level of precision (defaults - # to 2). - # * :round_mode - Determine how rounding is performed - # (defaults to :default. See BigDecimal::mode) - # * :unit - Sets the denomination of the currency - # (defaults to "$"). - # * :separator - Sets the separator between the units - # (defaults to "."). - # * :delimiter - Sets the thousands delimiter (defaults - # to ","). - # * :format - Sets the format for non-negative numbers - # (defaults to "%u%n"). Fields are %u for the - # currency, and %n for the number. - # * :negative_format - Sets the format for negative - # numbers (defaults to prepending a hyphen to the formatted - # number given by :format). Accepts the same fields - # than :format, except %n is here the - # absolute value of the number. - # * :strip_insignificant_zeros - If +true+ removes - # insignificant zeros after the decimal separator (defaults to - # +false+). + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. # - # ==== Examples + # number_to_currency(1234567890.506, locale: :fr) + # # => "1 234 567 890,51 €" # - # number_to_currency(1234567890.50) # => "$1,234,567,890.50" - # number_to_currency(1234567890.506) # => "$1,234,567,890.51" - # number_to_currency(1234567890.506, precision: 3) # => "$1,234,567,890.506" - # number_to_currency(1234567890.506, locale: :fr) # => "1 234 567 890,51 €" - # number_to_currency('123a456') # => "$123a456" - # - # number_to_currency(-0.456789, precision: 0) - # # => "$0" - # number_to_currency(-1234567890.50, negative_format: '(%u%n)') - # # => "($1,234,567,890.50)" - # number_to_currency(1234567890.50, unit: '£', separator: ',', delimiter: '') - # # => "£1234567890,50" - # number_to_currency(1234567890.50, unit: '£', separator: ',', delimiter: '', format: '%n %u') - # # => "1234567890,50 £" - # number_to_currency(1234567890.50, strip_insignificant_zeros: true) - # # => "$1,234,567,890.5" - # number_to_currency(1234567890.50, precision: 0, round_mode: :up) - # # => "$1,234,567,891" - # - # source://activesupport//lib/active_support/number_helper.rb#114 + # [+:precision+] + # The level of precision. Defaults to 2. + # + # number_to_currency(1234567890.123, precision: 3) # => "$1,234,567,890.123" + # number_to_currency(0.456789, precision: 0) # => "$0" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_currency(1234567890.01, precision: 0, round_mode: :up) + # # => "$1,234,567,891" + # + # [+:unit+] + # The denomination of the currency. Defaults to "$". + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:format+] + # The format for non-negative numbers. %u represents the currency, + # and %n represents the number. Defaults to "%u%n". + # + # number_to_currency(1234567890.50, format: "%n %u") + # # => "1,234,567,890.50 $" + # + # [+:negative_format+] + # The format for negative numbers. %u and %n behave the + # same as in +:format+, but %n represents the absolute value of + # the number. Defaults to the value of +:format+ prepended with -. + # + # number_to_currency(-1234567890.50, negative_format: "(%u%n)") + # # => "($1,234,567,890.50)" + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to false. + # + # number_to_currency(1234567890.50, strip_insignificant_zeros: true) + # # => "$1,234,567,890.5" + # + # source://activesupport//lib/active_support/number_helper.rb#161 def number_to_currency(number, options = T.unsafe(nil)); end - # Formats a +number+ with grouped thousands using +delimiter+ - # (e.g., 12,324). You can customize the format in the +options+ - # hash. + # Formats +number+ by grouping thousands with a delimiter. + # + # number_to_delimited(12345678) # => "12,345,678" + # number_to_delimited("123456") # => "123,456" + # number_to_delimited(12345678.9876) # => "12,345,678.9876" + # number_to_delimited("12x34") # => "12x34" + # + # number_to_delimited(12345678.9876, delimiter: ".", separator: ",") + # # => "12.345.678,9876" # # ==== Options # - # * :locale - Sets the locale to be used for formatting - # (defaults to current locale). - # * :delimiter - Sets the thousands delimiter (defaults - # to ","). - # * :separator - Sets the separator between the - # fractional and integer digits (defaults to "."). - # * :delimiter_pattern - Sets a custom regular expression used for - # deriving the placement of delimiter. Helpful when using currency formats - # like INR. + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. # - # ==== Examples + # number_to_delimited(12345678.05, locale: :fr) + # # => "12 345 678,05" + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # number_to_delimited(12345678, delimiter: ".") + # # => "12.345.678" + # + # [+:separator+] + # The decimal separator. Defaults to ".". # - # number_to_delimited(12345678) # => "12,345,678" - # number_to_delimited('123456') # => "123,456" - # number_to_delimited(12345678.05) # => "12,345,678.05" - # number_to_delimited(12345678, delimiter: '.') # => "12.345.678" - # number_to_delimited(12345678, delimiter: ',') # => "12,345,678" - # number_to_delimited(12345678.05, separator: ' ') # => "12,345,678 05" - # number_to_delimited(12345678.05, locale: :fr) # => "12 345 678,05" - # number_to_delimited('112a') # => "112a" - # number_to_delimited(98765432.98, delimiter: ' ', separator: ',') - # # => "98 765 432,98" - # number_to_delimited("123456.78", - # delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/) - # # => "1,23,456.78" - # - # source://activesupport//lib/active_support/number_helper.rb#189 + # number_to_delimited(12345678.05, separator: " ") + # # => "12,345,678 05" + # + # [+:delimiter_pattern+] + # A regexp to determine the placement of delimiters. Helpful when using + # currency formats like INR. + # + # number_to_delimited("123456.78", delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/) + # # => "1,23,456.78" + # + # source://activesupport//lib/active_support/number_helper.rb#264 def number_to_delimited(number, options = T.unsafe(nil)); end - # Pretty prints (formats and approximates) a number in a way it - # is more readable by humans (e.g.: 1200000000 becomes "1.2 - # Billion"). This is useful for numbers that can get very large - # (and too hard to read). + # Formats +number+ into a more human-friendly representation. Useful for + # numbers that can become very large and too hard to read. # - # See number_to_human_size if you want to print a file - # size. + # number_to_human(123) # => "123" + # number_to_human(1234) # => "1.23 Thousand" + # number_to_human(12345) # => "12.3 Thousand" + # number_to_human(1234567) # => "1.23 Million" + # number_to_human(1234567890) # => "1.23 Billion" + # number_to_human(1234567890123) # => "1.23 Trillion" + # number_to_human(1234567890123456) # => "1.23 Quadrillion" + # number_to_human(1234567890123456789) # => "1230 Quadrillion" # - # You can also define your own unit-quantifier names if you want - # to use other decimal units (e.g.: 1500 becomes "1.5 - # kilometers", 0.150 becomes "150 milliliters", etc). You may - # define a wide range of unit quantifiers, even fractional ones - # (centi, deci, mili, etc). + # See #number_to_human_size if you want to pretty-print a file size. # # ==== Options # - # * :locale - Sets the locale to be used for formatting - # (defaults to current locale). - # * :precision - Sets the precision of the number - # (defaults to 3). - # * :round_mode - Determine how rounding is performed - # (defaults to :default. See BigDecimal::mode) - # * :significant - If +true+, precision will be the number - # of significant_digits. If +false+, the number of fractional - # digits (defaults to +true+) - # * :separator - Sets the separator between the - # fractional and integer digits (defaults to "."). - # * :delimiter - Sets the thousands delimiter (defaults - # to ""). - # * :strip_insignificant_zeros - If +true+ removes - # insignificant zeros after the decimal separator (defaults to - # +true+) - # * :units - A Hash of unit quantifier names. Or a - # string containing an i18n scope where to find this hash. It - # might have the following keys: - # * *integers*: :unit, :ten, - # :hundred, :thousand, :million, - # :billion, :trillion, - # :quadrillion - # * *fractionals*: :deci, :centi, - # :mili, :micro, :nano, - # :pico, :femto - # * :format - Sets the format of the output string - # (defaults to "%n %u"). The field types are: - # * %u - The quantifier (ex.: 'thousand') - # * %n - The number - # - # ==== Examples - # - # number_to_human(123) # => "123" - # number_to_human(1234) # => "1.23 Thousand" - # number_to_human(12345) # => "12.3 Thousand" - # number_to_human(1234567) # => "1.23 Million" - # number_to_human(1234567890) # => "1.23 Billion" - # number_to_human(1234567890123) # => "1.23 Trillion" - # number_to_human(1234567890123456) # => "1.23 Quadrillion" - # number_to_human(1234567890123456789) # => "1230 Quadrillion" - # number_to_human(489939, precision: 2) # => "490 Thousand" - # number_to_human(489939, precision: 4) # => "489.9 Thousand" - # number_to_human(489939, precision: 2 - # , round_mode: :down) # => "480 Thousand" - # number_to_human(1234567, precision: 4, - # significant: false) # => "1.2346 Million" - # number_to_human(1234567, precision: 1, - # separator: ',', - # significant: false) # => "1,2 Million" - # - # number_to_human(500000000, precision: 5) # => "500 Million" - # number_to_human(12345012345, significant: false) # => "12.345 Billion" - # - # Non-significant zeros after the decimal separator are stripped - # out by default (set :strip_insignificant_zeros to - # +false+ to change that): - # - # number_to_human(12.00001) # => "12" - # number_to_human(12.00001, strip_insignificant_zeros: false) # => "12.0" - # - # ==== Custom Unit Quantifiers - # - # You can also use your own custom unit quantifiers: - # number_to_human(500000, units: { unit: 'ml', thousand: 'lt' }) # => "500 lt" - # - # If in your I18n locale you have: - # - # distance: - # centi: - # one: "centimeter" - # other: "centimeters" - # unit: - # one: "meter" - # other: "meters" - # thousand: - # one: "kilometer" - # other: "kilometers" - # billion: "gazillion-distance" - # - # Then you could do: - # - # number_to_human(543934, units: :distance) # => "544 kilometers" - # number_to_human(54393498, units: :distance) # => "54400 kilometers" - # number_to_human(54393498000, units: :distance) # => "54.4 gazillion-distance" - # number_to_human(343, units: :distance, precision: 1) # => "300 meters" - # number_to_human(1, units: :distance) # => "1 meter" - # number_to_human(0.34, units: :distance) # => "34 centimeters" - # - # source://activesupport//lib/active_support/number_helper.rb#391 + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. + # + # [+:precision+] + # The level of precision. Defaults to 3. + # + # number_to_human(123456, precision: 2) # => "120 Thousand" + # number_to_human(123456, precision: 4) # => "123.5 Thousand" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_human(123456, precision: 2, round_mode: :up) + # # => "130 Thousand" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to true. + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # number_to_human(123456, precision: 4, separator: ",") + # # => "123,5 Thousand" + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to true. + # + # number_to_human(1000000) # => "1 Million" + # number_to_human(1000000, strip_insignificant_zeros: false) # => "1.00 Million" + # number_to_human(10.01) # => "10" + # number_to_human(10.01, strip_insignificant_zeros: false) # => "10.0" + # + # [+:format+] + # The format of the output. %n represents the number, and + # %u represents the quantifier (e.g., "Thousand"). Defaults to + # "%n %u". + # + # [+:units+] + # A Hash of custom unit quantifier names. + # + # number_to_human(1, units: { unit: "m", thousand: "km" }) # => "1 m" + # number_to_human(100, units: { unit: "m", thousand: "km" }) # => "100 m" + # number_to_human(1000, units: { unit: "m", thousand: "km" }) # => "1 km" + # number_to_human(100000, units: { unit: "m", thousand: "km" }) # => "100 km" + # number_to_human(10000000, units: { unit: "m", thousand: "km" }) # => "10000 km" + # + # The following keys are supported for integer units: +:unit+, +:ten+, + # +:hundred+, +:thousand+, +:million+, +:billion+, +:trillion+, + # +:quadrillion+. Additionally, the following keys are supported for + # fractional units: +:deci+, +:centi+, +:mili+, +:micro+, +:nano+, + # +:pico+, +:femto+. + # + # The Hash can also be defined as a scope in an I18n locale. For example: + # + # en: + # distance: + # centi: + # one: "centimeter" + # other: "centimeters" + # unit: + # one: "meter" + # other: "meters" + # thousand: + # one: "kilometer" + # other: "kilometers" + # + # Then it can be specified by name: + # + # number_to_human(1, units: :distance) # => "1 meter" + # number_to_human(100, units: :distance) # => "100 meters" + # number_to_human(1000, units: :distance) # => "1 kilometer" + # number_to_human(100000, units: :distance) # => "100 kilometers" + # number_to_human(10000000, units: :distance) # => "10000 kilometers" + # number_to_human(0.1, units: :distance) # => "10 centimeters" + # number_to_human(0.01, units: :distance) # => "1 centimeter" + # + # source://activesupport//lib/active_support/number_helper.rb#475 def number_to_human(number, options = T.unsafe(nil)); end - # Formats the bytes in +number+ into a more understandable - # representation (e.g., giving it 1500 yields 1.46 KB). This - # method is useful for reporting file sizes to users. You can - # customize the format in the +options+ hash. + # Formats +number+ as bytes into a more human-friendly representation. + # Useful for reporting file sizes to users. # - # See number_to_human if you want to pretty-print a - # generic number. + # number_to_human_size(123) # => "123 Bytes" + # number_to_human_size(1234) # => "1.21 KB" + # number_to_human_size(12345) # => "12.1 KB" + # number_to_human_size(1234567) # => "1.18 MB" + # number_to_human_size(1234567890) # => "1.15 GB" + # number_to_human_size(1234567890123) # => "1.12 TB" + # number_to_human_size(1234567890123456) # => "1.1 PB" + # number_to_human_size(1234567890123456789) # => "1.07 EB" + # + # See #number_to_human if you want to pretty-print a generic number. # # ==== Options # - # * :locale - Sets the locale to be used for formatting - # (defaults to current locale). - # * :precision - Sets the precision of the number - # (defaults to 3). - # * :round_mode - Determine how rounding is performed - # (defaults to :default. See BigDecimal::mode) - # * :significant - If +true+, precision will be the number - # of significant_digits. If +false+, the number of fractional - # digits (defaults to +true+) - # * :separator - Sets the separator between the - # fractional and integer digits (defaults to "."). - # * :delimiter - Sets the thousands delimiter (defaults - # to ""). - # * :strip_insignificant_zeros - If +true+ removes - # insignificant zeros after the decimal separator (defaults to - # +true+) + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. # - # ==== Examples + # [+:precision+] + # The level of precision. Defaults to 3. # - # number_to_human_size(123) # => "123 Bytes" - # number_to_human_size(1234) # => "1.21 KB" - # number_to_human_size(12345) # => "12.1 KB" - # number_to_human_size(1234567) # => "1.18 MB" - # number_to_human_size(1234567890) # => "1.15 GB" - # number_to_human_size(1234567890123) # => "1.12 TB" - # number_to_human_size(1234567890123456) # => "1.1 PB" - # number_to_human_size(1234567890123456789) # => "1.07 EB" - # number_to_human_size(1234567, precision: 2) # => "1.2 MB" - # number_to_human_size(483989, precision: 2) # => "470 KB" - # number_to_human_size(483989, precision: 2, round_mode: :up) # => "480 KB" - # number_to_human_size(1234567, precision: 2, separator: ',') # => "1,2 MB" - # number_to_human_size(1234567890123, precision: 5) # => "1.1228 TB" - # number_to_human_size(524288000, precision: 5) # => "500 MB" - # - # source://activesupport//lib/active_support/number_helper.rb#283 + # number_to_human_size(123456, precision: 2) # => "120 KB" + # number_to_human_size(1234567, precision: 2) # => "1.2 MB" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_human_size(123456, precision: 2, round_mode: :up) + # # => "130 KB" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to true. + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # number_to_human_size(1234567, separator: ",") + # # => "1,18 MB" + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to true. + # + # source://activesupport//lib/active_support/number_helper.rb#373 def number_to_human_size(number, options = T.unsafe(nil)); end - # Formats a +number+ as a percentage string (e.g., 65%). You can - # customize the format in the +options+ hash. + # Formats +number+ as a percentage string. + # + # number_to_percentage(100) # => "100.000%" + # number_to_percentage("99") # => "99.000%" + # number_to_percentage("99x") # => "99x%" + # + # number_to_percentage(12345.6789, delimiter: ".", separator: ",", precision: 2) + # # => "12.345,68%" # # ==== Options # - # * :locale - Sets the locale to be used for formatting - # (defaults to current locale). - # * :precision - Sets the precision of the number - # (defaults to 3). Keeps the number's precision if +nil+. - # * :round_mode - Determine how rounding is performed - # (defaults to :default. See BigDecimal::mode) - # * :significant - If +true+, precision will be the number - # of significant_digits. If +false+, the number of fractional - # digits (defaults to +false+). - # * :separator - Sets the separator between the - # fractional and integer digits (defaults to "."). - # * :delimiter - Sets the thousands delimiter (defaults - # to ""). - # * :strip_insignificant_zeros - If +true+ removes - # insignificant zeros after the decimal separator (defaults to - # +false+). - # * :format - Specifies the format of the percentage - # string The number field is %n (defaults to "%n%"). + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. # - # ==== Examples + # number_to_percentage(1000, locale: :fr) + # # => "1000,000%" + # + # [+:precision+] + # The level of precision, or +nil+ to preserve +number+'s precision. + # Defaults to 2. + # + # number_to_percentage(12.3456789, precision: 4) # => "12.3457%" + # number_to_percentage(99.999, precision: 0) # => "100%" + # number_to_percentage(99.999, precision: nil) # => "99.999%" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_percentage(12.3456789, precision: 4, round_mode: :down) + # # => "12.3456%" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to false. # - # number_to_percentage(100) # => "100.000%" - # number_to_percentage('98') # => "98.000%" - # number_to_percentage(100, precision: 0) # => "100%" - # number_to_percentage(1000, delimiter: '.', separator: ',') # => "1.000,000%" - # number_to_percentage(302.24398923423, precision: 5) # => "302.24399%" - # number_to_percentage(1000, locale: :fr) # => "1000,000%" - # number_to_percentage(1000, precision: nil) # => "1000%" - # number_to_percentage('98a') # => "98a%" - # number_to_percentage(100, format: '%n %') # => "100.000 %" - # number_to_percentage(302.24398923423, precision: 5, round_mode: :down) # => "302.24398%" - # - # source://activesupport//lib/active_support/number_helper.rb#154 + # number_to_percentage(12345.6789) # => "12345.679%" + # number_to_percentage(12345.6789, significant: true) # => "12300%" + # number_to_percentage(12345.6789, precision: 2) # => "12345.68%" + # number_to_percentage(12345.6789, precision: 2, significant: true) # => "12000%" + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to false. + # + # [+:format+] + # The format of the output. %n represents the number. Defaults to + # "%n%". + # + # number_to_percentage(100, format: "%n %") + # # => "100.000 %" + # + # source://activesupport//lib/active_support/number_helper.rb#223 def number_to_percentage(number, options = T.unsafe(nil)); end - # Formats a +number+ into a phone number (US by default e.g., (555) - # 123-9876). You can customize the format in the +options+ hash. + # Formats +number+ into a phone number. + # + # number_to_phone(5551234) # => "555-1234" + # number_to_phone("5551234") # => "555-1234" + # number_to_phone(1235551234) # => "123-555-1234" + # number_to_phone("12x34") # => "12x34" + # + # number_to_phone(1235551234, delimiter: ".", country_code: 1, extension: 1343) + # # => "+1.123.555.1234 x 1343" # # ==== Options # - # * :area_code - Adds parentheses around the area code. - # * :delimiter - Specifies the delimiter to use - # (defaults to "-"). - # * :extension - Specifies an extension to add to the - # end of the generated number. - # * :country_code - Sets the country code for the phone - # number. - # * :pattern - Specifies how the number is divided into three - # groups with the custom regexp to override the default format. - # ==== Examples + # [+:area_code+] + # Whether to use parentheses for the area code. Defaults to false. # - # number_to_phone(5551234) # => "555-1234" - # number_to_phone('5551234') # => "555-1234" - # number_to_phone(1235551234) # => "123-555-1234" - # number_to_phone(1235551234, area_code: true) # => "(123) 555-1234" - # number_to_phone(1235551234, delimiter: ' ') # => "123 555 1234" - # number_to_phone(1235551234, area_code: true, extension: 555) # => "(123) 555-1234 x 555" - # number_to_phone(1235551234, country_code: 1) # => "+1-123-555-1234" - # number_to_phone('123a456') # => "123a456" + # number_to_phone(1235551234, area_code: true) + # # => "(123) 555-1234" # - # number_to_phone(1235551234, country_code: 1, extension: 1343, delimiter: '.') - # # => "+1.123.555.1234 x 1343" + # [+:delimiter+] + # The digit group delimiter to use. Defaults to "-". + # + # number_to_phone(1235551234, delimiter: " ") + # # => "123 555 1234" + # + # [+:country_code+] + # A country code to prepend. + # + # number_to_phone(1235551234, country_code: 1) + # # => "+1-123-555-1234" + # + # [+:extension+] + # An extension to append. + # + # number_to_phone(1235551234, extension: 555) + # # => "123-555-1234 x 555" # - # number_to_phone(75561234567, pattern: /(\d{1,4})(\d{4})(\d{4})$/, area_code: true) - # # => "(755) 6123-4567" - # number_to_phone(13312345678, pattern: /(\d{3})(\d{4})(\d{4})$/) - # # => "133-1234-5678" + # [+:pattern+] + # A regexp that specifies how the digits should be grouped. The first + # three captures from the regexp are treated as digit groups. # - # source://activesupport//lib/active_support/number_helper.rb#53 + # number_to_phone(13312345678, pattern: /(\d{3})(\d{4})(\d{4})$/) + # # => "133-1234-5678" + # number_to_phone(75561234567, pattern: /(\d{1,4})(\d{4})(\d{4})$/, area_code: true) + # # => "(755) 6123-4567" + # + # source://activesupport//lib/active_support/number_helper.rb#88 def number_to_phone(number, options = T.unsafe(nil)); end - # Formats a +number+ with the specified level of - # :precision (e.g., 112.32 has a precision of 2 if - # +:significant+ is +false+, and 5 if +:significant+ is +true+). - # You can customize the format in the +options+ hash. + # Formats +number+ to a specific level of precision. + # + # number_to_rounded(12345.6789) # => "12345.679" + # number_to_rounded(12345.6789, precision: 2) # => "12345.68" + # number_to_rounded(12345.6789, precision: 0) # => "12345" + # number_to_rounded(12345, precision: 5) # => "12345.00000" # # ==== Options # - # * :locale - Sets the locale to be used for formatting - # (defaults to current locale). - # * :precision - Sets the precision of the number - # (defaults to 3). Keeps the number's precision if +nil+. - # * :round_mode - Determine how rounding is performed - # (defaults to :default. See BigDecimal::mode) - # * :significant - If +true+, precision will be the number - # of significant_digits. If +false+, the number of fractional - # digits (defaults to +false+). - # * :separator - Sets the separator between the - # fractional and integer digits (defaults to "."). - # * :delimiter - Sets the thousands delimiter (defaults - # to ""). - # * :strip_insignificant_zeros - If +true+ removes - # insignificant zeros after the decimal separator (defaults to - # +false+). + # [+:locale+] + # The locale to use for formatting. Defaults to the current locale. # - # ==== Examples + # number_to_rounded(111.234, locale: :fr) + # # => "111,234" + # + # [+:precision+] + # The level of precision, or +nil+ to preserve +number+'s precision. + # Defaults to 3. + # + # number_to_rounded(12345.6789, precision: nil) + # # => "12345.6789" + # + # [+:round_mode+] + # Specifies how rounding is performed. See +BigDecimal.mode+. Defaults to + # +:default+. + # + # number_to_rounded(12.34, precision: 0, round_mode: :up) + # # => "13" + # + # [+:significant+] + # Whether +:precision+ should be applied to significant digits instead of + # fractional digits. Defaults to false. # - # number_to_rounded(111.2345) # => "111.235" - # number_to_rounded(111.2345, precision: 2) # => "111.23" - # number_to_rounded(13, precision: 5) # => "13.00000" - # number_to_rounded(389.32314, precision: 0) # => "389" - # number_to_rounded(111.2345, significant: true) # => "111" - # number_to_rounded(111.2345, precision: 1, significant: true) # => "100" - # number_to_rounded(13, precision: 5, significant: true) # => "13.000" - # number_to_rounded(13, precision: nil) # => "13" - # number_to_rounded(389.32314, precision: 0, round_mode: :up) # => "390" - # number_to_rounded(111.234, locale: :fr) # => "111,234" - # - # number_to_rounded(13, precision: 5, significant: true, strip_insignificant_zeros: true) - # # => "13" - # - # number_to_rounded(389.32314, precision: 4, significant: true) # => "389.3" - # number_to_rounded(1111.2345, precision: 2, separator: ',', delimiter: '.') - # # => "1.111,23" - # - # source://activesupport//lib/active_support/number_helper.rb#236 + # number_to_rounded(12345.6789) # => "12345.679" + # number_to_rounded(12345.6789, significant: true) # => "12300" + # number_to_rounded(12345.6789, precision: 2) # => "12345.68" + # number_to_rounded(12345.6789, precision: 2, significant: true) # => "12000" + # + # [+:separator+] + # The decimal separator. Defaults to ".". + # + # [+:delimiter+] + # The thousands delimiter. Defaults to ",". + # + # [+:strip_insignificant_zeros+] + # Whether to remove insignificant zeros after the decimal separator. + # Defaults to false. + # + # number_to_rounded(12.34, strip_insignificant_zeros: false) # => "12.340" + # number_to_rounded(12.34, strip_insignificant_zeros: true) # => "12.34" + # number_to_rounded(12.3456, strip_insignificant_zeros: true) # => "12.346" + # + # source://activesupport//lib/active_support/number_helper.rb#320 def number_to_rounded(number, options = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/number_helper/number_converter.rb#11 +# source://activesupport//lib/active_support/number_helper/number_converter.rb#12 class ActiveSupport::NumberHelper::NumberConverter # @return [NumberConverter] a new instance of NumberConverter # - # source://activesupport//lib/active_support/number_helper/number_converter.rb#123 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#124 def initialize(number, options); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#128 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#130 def execute; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#13 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 def namespace; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#13 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 def namespace=(_arg0); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#13 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 def namespace?; end # Returns the value of attribute number. # - # source://activesupport//lib/active_support/number_helper/number_converter.rb#18 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#19 def number; end # Returns the value of attribute opts. # - # source://activesupport//lib/active_support/number_helper/number_converter.rb#18 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#19 def opts; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#16 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 def validate_float; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#16 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 def validate_float=(_arg0); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#16 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 def validate_float?; end private - # source://activesupport//lib/active_support/number_helper/number_converter.rb#147 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#149 def default_format_options; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#172 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#174 def default_value(key); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#143 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#145 def format_options; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#153 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#155 def i18n_format_options; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#139 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#141 def options; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#168 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#170 def translate_in_locale(key, **i18n_options); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#164 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#166 def translate_number_value_with_default(key, **i18n_options); end - # @return [Boolean] - # - # source://activesupport//lib/active_support/number_helper/number_converter.rb#176 - def valid_float?; end + # source://activesupport//lib/active_support/number_helper/number_converter.rb#178 + def valid_bigdecimal; end class << self - # source://activesupport//lib/active_support/number_helper/number_converter.rb#119 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#120 def convert(number, options); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#13 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 def namespace; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#13 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 def namespace=(value); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#13 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 def namespace?; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#16 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 def validate_float; end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#16 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 def validate_float=(value); end - # source://activesupport//lib/active_support/number_helper/number_converter.rb#16 + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 def validate_float?; end + + private + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + def __class_attr_namespace; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#14 + def __class_attr_namespace=(new_value); end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + def __class_attr_validate_float; end + + # source://activesupport//lib/active_support/number_helper/number_converter.rb#17 + def __class_attr_validate_float=(new_value); end end end -# source://activesupport//lib/active_support/number_helper/number_converter.rb#20 +# source://activesupport//lib/active_support/number_helper/number_converter.rb#21 ActiveSupport::NumberHelper::NumberConverter::DEFAULTS = T.let(T.unsafe(nil), Hash) # source://activesupport//lib/active_support/number_helper/number_to_currency_converter.rb#7 @@ -8742,8 +11705,13 @@ class ActiveSupport::NumberHelper::NumberToCurrencyConverter < ::ActiveSupport:: def options; end class << self - # source://activesupport//lib/active_support/number_helper/number_converter.rb#13 - def namespace; end + private + + # source://activesupport//lib/active_support/number_helper/number_to_currency_converter.rb#8 + def __class_attr_namespace; end + + # source://activesupport//lib/active_support/number_helper/number_to_currency_converter.rb#8 + def __class_attr_namespace=(new_value); end end end @@ -8761,8 +11729,13 @@ class ActiveSupport::NumberHelper::NumberToDelimitedConverter < ::ActiveSupport: def parts; end class << self - # source://activesupport//lib/active_support/number_helper/number_converter.rb#16 - def validate_float; end + private + + # source://activesupport//lib/active_support/number_helper/number_to_delimited_converter.rb#8 + def __class_attr_validate_float; end + + # source://activesupport//lib/active_support/number_helper/number_to_delimited_converter.rb#8 + def __class_attr_validate_float=(new_value); end end end @@ -8789,11 +11762,19 @@ class ActiveSupport::NumberHelper::NumberToHumanConverter < ::ActiveSupport::Num def unit_exponents(units); end class << self - # source://activesupport//lib/active_support/number_helper/number_converter.rb#13 - def namespace; end + private - # source://activesupport//lib/active_support/number_helper/number_converter.rb#16 - def validate_float; end + # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#12 + def __class_attr_namespace; end + + # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#12 + def __class_attr_namespace=(new_value); end + + # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#13 + def __class_attr_validate_float; end + + # source://activesupport//lib/active_support/number_helper/number_to_human_converter.rb#13 + def __class_attr_validate_float=(new_value); end end end @@ -8831,11 +11812,19 @@ class ActiveSupport::NumberHelper::NumberToHumanSizeConverter < ::ActiveSupport: def unit; end class << self - # source://activesupport//lib/active_support/number_helper/number_converter.rb#13 - def namespace; end + private - # source://activesupport//lib/active_support/number_helper/number_converter.rb#16 - def validate_float; end + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#10 + def __class_attr_namespace; end + + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#10 + def __class_attr_namespace=(new_value); end + + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#11 + def __class_attr_validate_float; end + + # source://activesupport//lib/active_support/number_helper/number_to_human_size_converter.rb#11 + def __class_attr_validate_float=(new_value); end end end @@ -8848,42 +11837,47 @@ class ActiveSupport::NumberHelper::NumberToPercentageConverter < ::ActiveSupport def convert; end class << self - # source://activesupport//lib/active_support/number_helper/number_converter.rb#13 - def namespace; end + private + + # source://activesupport//lib/active_support/number_helper/number_to_percentage_converter.rb#8 + def __class_attr_namespace; end + + # source://activesupport//lib/active_support/number_helper/number_to_percentage_converter.rb#8 + def __class_attr_namespace=(new_value); end end end -# source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#7 +# source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#8 class ActiveSupport::NumberHelper::NumberToPhoneConverter < ::ActiveSupport::NumberHelper::NumberConverter - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#8 + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#9 def convert; end private - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#15 + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#16 def convert_to_phone_number(number); end - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#23 + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#24 def convert_with_area_code(number); end - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#30 + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#31 def convert_without_area_code(number); end - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#46 + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#47 def country_code(code); end - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#42 + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#43 def delimiter; end - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#50 + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#51 def phone_ext(ext); end - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#54 + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#55 def regexp_pattern(default_pattern); end # @return [Boolean] # - # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#38 + # source://activesupport//lib/active_support/number_helper/number_to_phone_converter.rb#39 def start_with_delimiter?(number); end end @@ -8901,11 +11895,19 @@ class ActiveSupport::NumberHelper::NumberToRoundedConverter < ::ActiveSupport::N def strip_insignificant_zeros; end class << self - # source://activesupport//lib/active_support/number_helper/number_converter.rb#13 - def namespace; end + private - # source://activesupport//lib/active_support/number_helper/number_converter.rb#16 - def validate_float; end + # source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#8 + def __class_attr_namespace; end + + # source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#8 + def __class_attr_namespace=(new_value); end + + # source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#9 + def __class_attr_validate_float; end + + # source://activesupport//lib/active_support/number_helper/number_to_rounded_converter.rb#9 + def __class_attr_validate_float=(new_value); end end end @@ -8936,223 +11938,6 @@ class ActiveSupport::NumberHelper::RoundingHelper def convert_to_decimal(number); end end -# source://activesupport//lib/active_support/core_ext/numeric/conversions.rb#7 -module ActiveSupport::NumericWithFormat - # Provides options for converting numbers into formatted strings. - # Options are provided for phone numbers, currency, percentage, - # precision, positional notation, file size, and pretty printing. - # - # This method is aliased to to_formatted_s. - # - # ==== Options - # - # For details on which formats use which options, see ActiveSupport::NumberHelper - # - # ==== Examples - # - # Phone Numbers: - # 5551234.to_fs(:phone) # => "555-1234" - # 1235551234.to_fs(:phone) # => "123-555-1234" - # 1235551234.to_fs(:phone, area_code: true) # => "(123) 555-1234" - # 1235551234.to_fs(:phone, delimiter: ' ') # => "123 555 1234" - # 1235551234.to_fs(:phone, area_code: true, extension: 555) # => "(123) 555-1234 x 555" - # 1235551234.to_fs(:phone, country_code: 1) # => "+1-123-555-1234" - # 1235551234.to_fs(:phone, country_code: 1, extension: 1343, delimiter: '.') - # # => "+1.123.555.1234 x 1343" - # - # Currency: - # 1234567890.50.to_fs(:currency) # => "$1,234,567,890.50" - # 1234567890.506.to_fs(:currency) # => "$1,234,567,890.51" - # 1234567890.506.to_fs(:currency, precision: 3) # => "$1,234,567,890.506" - # 1234567890.506.to_fs(:currency, round_mode: :down) # => "$1,234,567,890.50" - # 1234567890.506.to_fs(:currency, locale: :fr) # => "1 234 567 890,51 €" - # -1234567890.50.to_fs(:currency, negative_format: '(%u%n)') - # # => "($1,234,567,890.50)" - # 1234567890.50.to_fs(:currency, unit: '£', separator: ',', delimiter: '') - # # => "£1234567890,50" - # 1234567890.50.to_fs(:currency, unit: '£', separator: ',', delimiter: '', format: '%n %u') - # # => "1234567890,50 £" - # - # Percentage: - # 100.to_fs(:percentage) # => "100.000%" - # 100.to_fs(:percentage, precision: 0) # => "100%" - # 1000.to_fs(:percentage, delimiter: '.', separator: ',') # => "1.000,000%" - # 302.24398923423.to_fs(:percentage, precision: 5) # => "302.24399%" - # 302.24398923423.to_fs(:percentage, round_mode: :down) # => "302.243%" - # 1000.to_fs(:percentage, locale: :fr) # => "1 000,000%" - # 100.to_fs(:percentage, format: '%n %') # => "100.000 %" - # - # Delimited: - # 12345678.to_fs(:delimited) # => "12,345,678" - # 12345678.05.to_fs(:delimited) # => "12,345,678.05" - # 12345678.to_fs(:delimited, delimiter: '.') # => "12.345.678" - # 12345678.to_fs(:delimited, delimiter: ',') # => "12,345,678" - # 12345678.05.to_fs(:delimited, separator: ' ') # => "12,345,678 05" - # 12345678.05.to_fs(:delimited, locale: :fr) # => "12 345 678,05" - # 98765432.98.to_fs(:delimited, delimiter: ' ', separator: ',') - # # => "98 765 432,98" - # - # Rounded: - # 111.2345.to_fs(:rounded) # => "111.235" - # 111.2345.to_fs(:rounded, precision: 2) # => "111.23" - # 111.2345.to_fs(:rounded, precision: 2, round_mode: :up) # => "111.24" - # 13.to_fs(:rounded, precision: 5) # => "13.00000" - # 389.32314.to_fs(:rounded, precision: 0) # => "389" - # 111.2345.to_fs(:rounded, significant: true) # => "111" - # 111.2345.to_fs(:rounded, precision: 1, significant: true) # => "100" - # 13.to_fs(:rounded, precision: 5, significant: true) # => "13.000" - # 111.234.to_fs(:rounded, locale: :fr) # => "111,234" - # 13.to_fs(:rounded, precision: 5, significant: true, strip_insignificant_zeros: true) - # # => "13" - # 389.32314.to_fs(:rounded, precision: 4, significant: true) # => "389.3" - # 1111.2345.to_fs(:rounded, precision: 2, separator: ',', delimiter: '.') - # # => "1.111,23" - # - # Human-friendly size in Bytes: - # 123.to_fs(:human_size) # => "123 Bytes" - # 1234.to_fs(:human_size) # => "1.21 KB" - # 12345.to_fs(:human_size) # => "12.1 KB" - # 1234567.to_fs(:human_size) # => "1.18 MB" - # 1234567890.to_fs(:human_size) # => "1.15 GB" - # 1234567890123.to_fs(:human_size) # => "1.12 TB" - # 1234567890123456.to_fs(:human_size) # => "1.1 PB" - # 1234567890123456789.to_fs(:human_size) # => "1.07 EB" - # 1234567.to_fs(:human_size, precision: 2) # => "1.2 MB" - # 1234567.to_fs(:human_size, precision: 2, round_mode: :up) # => "1.3 MB" - # 483989.to_fs(:human_size, precision: 2) # => "470 KB" - # 1234567.to_fs(:human_size, precision: 2, separator: ',') # => "1,2 MB" - # 1234567890123.to_fs(:human_size, precision: 5) # => "1.1228 TB" - # 524288000.to_fs(:human_size, precision: 5) # => "500 MB" - # - # Human-friendly format: - # 123.to_fs(:human) # => "123" - # 1234.to_fs(:human) # => "1.23 Thousand" - # 12345.to_fs(:human) # => "12.3 Thousand" - # 1234567.to_fs(:human) # => "1.23 Million" - # 1234567890.to_fs(:human) # => "1.23 Billion" - # 1234567890123.to_fs(:human) # => "1.23 Trillion" - # 1234567890123456.to_fs(:human) # => "1.23 Quadrillion" - # 1234567890123456789.to_fs(:human) # => "1230 Quadrillion" - # 489939.to_fs(:human, precision: 2) # => "490 Thousand" - # 489939.to_fs(:human, precision: 2, round_mode: :down) # => "480 Thousand" - # 489939.to_fs(:human, precision: 4) # => "489.9 Thousand" - # 1234567.to_fs(:human, precision: 4, - # significant: false) # => "1.2346 Million" - # 1234567.to_fs(:human, precision: 1, - # separator: ',', - # significant: false) # => "1,2 Million" - # - # source://activesupport//lib/active_support/core_ext/numeric/conversions.rb#111 - def to_formatted_s(format = T.unsafe(nil), options = T.unsafe(nil)); end - - # Provides options for converting numbers into formatted strings. - # Options are provided for phone numbers, currency, percentage, - # precision, positional notation, file size, and pretty printing. - # - # This method is aliased to to_formatted_s. - # - # ==== Options - # - # For details on which formats use which options, see ActiveSupport::NumberHelper - # - # ==== Examples - # - # Phone Numbers: - # 5551234.to_fs(:phone) # => "555-1234" - # 1235551234.to_fs(:phone) # => "123-555-1234" - # 1235551234.to_fs(:phone, area_code: true) # => "(123) 555-1234" - # 1235551234.to_fs(:phone, delimiter: ' ') # => "123 555 1234" - # 1235551234.to_fs(:phone, area_code: true, extension: 555) # => "(123) 555-1234 x 555" - # 1235551234.to_fs(:phone, country_code: 1) # => "+1-123-555-1234" - # 1235551234.to_fs(:phone, country_code: 1, extension: 1343, delimiter: '.') - # # => "+1.123.555.1234 x 1343" - # - # Currency: - # 1234567890.50.to_fs(:currency) # => "$1,234,567,890.50" - # 1234567890.506.to_fs(:currency) # => "$1,234,567,890.51" - # 1234567890.506.to_fs(:currency, precision: 3) # => "$1,234,567,890.506" - # 1234567890.506.to_fs(:currency, round_mode: :down) # => "$1,234,567,890.50" - # 1234567890.506.to_fs(:currency, locale: :fr) # => "1 234 567 890,51 €" - # -1234567890.50.to_fs(:currency, negative_format: '(%u%n)') - # # => "($1,234,567,890.50)" - # 1234567890.50.to_fs(:currency, unit: '£', separator: ',', delimiter: '') - # # => "£1234567890,50" - # 1234567890.50.to_fs(:currency, unit: '£', separator: ',', delimiter: '', format: '%n %u') - # # => "1234567890,50 £" - # - # Percentage: - # 100.to_fs(:percentage) # => "100.000%" - # 100.to_fs(:percentage, precision: 0) # => "100%" - # 1000.to_fs(:percentage, delimiter: '.', separator: ',') # => "1.000,000%" - # 302.24398923423.to_fs(:percentage, precision: 5) # => "302.24399%" - # 302.24398923423.to_fs(:percentage, round_mode: :down) # => "302.243%" - # 1000.to_fs(:percentage, locale: :fr) # => "1 000,000%" - # 100.to_fs(:percentage, format: '%n %') # => "100.000 %" - # - # Delimited: - # 12345678.to_fs(:delimited) # => "12,345,678" - # 12345678.05.to_fs(:delimited) # => "12,345,678.05" - # 12345678.to_fs(:delimited, delimiter: '.') # => "12.345.678" - # 12345678.to_fs(:delimited, delimiter: ',') # => "12,345,678" - # 12345678.05.to_fs(:delimited, separator: ' ') # => "12,345,678 05" - # 12345678.05.to_fs(:delimited, locale: :fr) # => "12 345 678,05" - # 98765432.98.to_fs(:delimited, delimiter: ' ', separator: ',') - # # => "98 765 432,98" - # - # Rounded: - # 111.2345.to_fs(:rounded) # => "111.235" - # 111.2345.to_fs(:rounded, precision: 2) # => "111.23" - # 111.2345.to_fs(:rounded, precision: 2, round_mode: :up) # => "111.24" - # 13.to_fs(:rounded, precision: 5) # => "13.00000" - # 389.32314.to_fs(:rounded, precision: 0) # => "389" - # 111.2345.to_fs(:rounded, significant: true) # => "111" - # 111.2345.to_fs(:rounded, precision: 1, significant: true) # => "100" - # 13.to_fs(:rounded, precision: 5, significant: true) # => "13.000" - # 111.234.to_fs(:rounded, locale: :fr) # => "111,234" - # 13.to_fs(:rounded, precision: 5, significant: true, strip_insignificant_zeros: true) - # # => "13" - # 389.32314.to_fs(:rounded, precision: 4, significant: true) # => "389.3" - # 1111.2345.to_fs(:rounded, precision: 2, separator: ',', delimiter: '.') - # # => "1.111,23" - # - # Human-friendly size in Bytes: - # 123.to_fs(:human_size) # => "123 Bytes" - # 1234.to_fs(:human_size) # => "1.21 KB" - # 12345.to_fs(:human_size) # => "12.1 KB" - # 1234567.to_fs(:human_size) # => "1.18 MB" - # 1234567890.to_fs(:human_size) # => "1.15 GB" - # 1234567890123.to_fs(:human_size) # => "1.12 TB" - # 1234567890123456.to_fs(:human_size) # => "1.1 PB" - # 1234567890123456789.to_fs(:human_size) # => "1.07 EB" - # 1234567.to_fs(:human_size, precision: 2) # => "1.2 MB" - # 1234567.to_fs(:human_size, precision: 2, round_mode: :up) # => "1.3 MB" - # 483989.to_fs(:human_size, precision: 2) # => "470 KB" - # 1234567.to_fs(:human_size, precision: 2, separator: ',') # => "1,2 MB" - # 1234567890123.to_fs(:human_size, precision: 5) # => "1.1228 TB" - # 524288000.to_fs(:human_size, precision: 5) # => "500 MB" - # - # Human-friendly format: - # 123.to_fs(:human) # => "123" - # 1234.to_fs(:human) # => "1.23 Thousand" - # 12345.to_fs(:human) # => "12.3 Thousand" - # 1234567.to_fs(:human) # => "1.23 Million" - # 1234567890.to_fs(:human) # => "1.23 Billion" - # 1234567890123.to_fs(:human) # => "1.23 Trillion" - # 1234567890123456.to_fs(:human) # => "1.23 Quadrillion" - # 1234567890123456789.to_fs(:human) # => "1230 Quadrillion" - # 489939.to_fs(:human, precision: 2) # => "490 Thousand" - # 489939.to_fs(:human, precision: 2, round_mode: :down) # => "480 Thousand" - # 489939.to_fs(:human, precision: 4) # => "489.9 Thousand" - # 1234567.to_fs(:human, precision: 4, - # significant: false) # => "1.2346 Million" - # 1234567.to_fs(:human, precision: 1, - # separator: ',', - # significant: false) # => "1,2 Million" - # - # source://activesupport//lib/active_support/core_ext/numeric/conversions.rb#111 - def to_fs(format = T.unsafe(nil), options = T.unsafe(nil)); end -end - # source://activesupport//lib/active_support/option_merger.rb#6 class ActiveSupport::OptionMerger # @return [OptionMerger] a new instance of OptionMerger @@ -9168,10 +11953,10 @@ class ActiveSupport::OptionMerger # @return [Boolean] # # source://activesupport//lib/active_support/option_merger.rb#34 - def respond_to_missing?(*arguments); end + def respond_to_missing?(*_arg0, **_arg1, &_arg2); end end -# DEPRECATED: ActiveSupport::OrderedHash implements a hash that preserves +# DEPRECATED: +ActiveSupport::OrderedHash+ implements a hash that preserves # insertion order. # # oh = ActiveSupport::OrderedHash.new @@ -9181,9 +11966,9 @@ end # # Also, maps the +omap+ feature for YAML files # (See https://yaml.org/type/omap.html) to support ordered items -# when loading from yaml. +# when loading from YAML. # -# ActiveSupport::OrderedHash is namespaced to prevent conflicts +# +ActiveSupport::OrderedHash+ is namespaced to prevent conflicts # with other implementations. # # source://activesupport//lib/active_support/ordered_hash.rb#24 @@ -9211,6 +11996,8 @@ class ActiveSupport::OrderedHash < ::Hash def to_yaml_type; end end +# = Ordered Options +# # +OrderedOptions+ inherits from +Hash+ and provides dynamic accessor methods. # # With a +Hash+, key-value pairs are typically managed like this: @@ -9236,66 +12023,76 @@ end # # h.dog! # => raises KeyError: :dog is blank # -# source://activesupport//lib/active_support/ordered_options.rb#31 +# source://activesupport//lib/active_support/ordered_options.rb#33 class ActiveSupport::OrderedOptions < ::Hash - # source://activesupport//lib/active_support/ordered_options.rb#39 + # source://activesupport//lib/active_support/ordered_options.rb#41 def [](key); end - # source://activesupport//lib/active_support/ordered_options.rb#35 + # source://activesupport//lib/active_support/ordered_options.rb#37 def []=(key, value); end + # source://activesupport//lib/active_support/ordered_options.rb#45 + def dig(key, *identifiers); end + # @return [Boolean] # - # source://activesupport//lib/active_support/ordered_options.rb#62 + # source://activesupport//lib/active_support/ordered_options.rb#64 def extractable_options?; end - # source://activesupport//lib/active_support/ordered_options.rb#66 + # source://activesupport//lib/active_support/ordered_options.rb#68 def inspect; end - # source://activesupport//lib/active_support/ordered_options.rb#43 - def method_missing(name, *args); end + # source://activesupport//lib/active_support/ordered_options.rb#49 + def method_missing(method, *args); end protected # preserve the original #[] method + # + # source://activesupport//lib/active_support/ordered_options.rb#34 def _get(_arg0); end private # @return [Boolean] # - # source://activesupport//lib/active_support/ordered_options.rb#58 + # source://activesupport//lib/active_support/ordered_options.rb#60 def respond_to_missing?(name, include_private); end end -# +ParameterFilter+ allows you to specify keys for sensitive data from -# hash-like object and replace corresponding value. Filtering only certain -# sub-keys from a hash is possible by using the dot notation: -# 'credit_card.number'. If a proc is given, each key and value of a hash and -# all sub-hashes are passed to it, where the value or the key can be replaced -# using String#replace or similar methods. +# = Active Support Parameter Filter # +# +ParameterFilter+ replaces values in a Hash-like object if their +# keys match one of the specified filters. +# +# Matching based on nested keys is possible by using dot notation, e.g. +# "credit_card.number". +# +# If a proc is given as a filter, each key and value of the Hash-like +# and of any nested Hashes will be passed to it. The value or key can +# then be mutated as desired using methods such as String#replace. +# +# # Replaces values with "[FILTERED]" for keys that match /password/i. # ActiveSupport::ParameterFilter.new([:password]) -# => replaces the value to all keys matching /password/i with "[FILTERED]" # +# # Replaces values with "[FILTERED]" for keys that match /foo|bar/i. # ActiveSupport::ParameterFilter.new([:foo, "bar"]) -# => replaces the value to all keys matching /foo|bar/i with "[FILTERED]" # -# ActiveSupport::ParameterFilter.new([/\Apin\z/i, /\Apin_/i]) -# => replaces the value for the exact (case-insensitive) key 'pin' and all -# (case-insensitive) keys beginning with 'pin_', with "[FILTERED]". -# Does not match keys with 'pin' as a substring, such as 'shipping_id'. +# # Replaces values for the exact key "pin" and for keys that begin with +# # "pin_". Does not match keys that otherwise include "pin" as a +# # substring, such as "shipping_id". +# ActiveSupport::ParameterFilter.new([/\Apin\z/, /\Apin_/]) # +# # Replaces the value for :code in `{ credit_card: { code: "xxxx" } }`. +# # Does not change `{ file: { code: "xxxx" } }`. # ActiveSupport::ParameterFilter.new(["credit_card.code"]) -# => replaces { credit_card: {code: "xxxx"} } with "[FILTERED]", does not -# change { file: { code: "xxxx"} } # +# # Reverses values for keys that match /secret/i. # ActiveSupport::ParameterFilter.new([-> (k, v) do # v.reverse! if /secret/i.match?(k) # end]) -# => reverses the value to all keys matching /secret/i # -# source://activesupport//lib/active_support/parameter_filter.rb#32 +# source://activesupport//lib/active_support/parameter_filter.rb#39 class ActiveSupport::ParameterFilter # Create instance with given filters. Supported type of filters are +String+, +Regexp+, and +Proc+. # Other types of filters are treated as +String+ using +to_s+. @@ -9307,131 +12104,58 @@ class ActiveSupport::ParameterFilter # # @return [ParameterFilter] a new instance of ParameterFilter # - # source://activesupport//lib/active_support/parameter_filter.rb#42 + # source://activesupport//lib/active_support/parameter_filter.rb#77 def initialize(filters = T.unsafe(nil), mask: T.unsafe(nil)); end # Mask value of +params+ if key matches one of filters. # - # source://activesupport//lib/active_support/parameter_filter.rb#48 + # source://activesupport//lib/active_support/parameter_filter.rb#83 def filter(params); end # Returns filtered value for given key. For +Proc+ filters, third block argument is not populated. # - # source://activesupport//lib/active_support/parameter_filter.rb#53 + # source://activesupport//lib/active_support/parameter_filter.rb#88 def filter_param(key, value); end private - # source://activesupport//lib/active_support/parameter_filter.rb#58 - def compiled_filter; end -end - -# source://activesupport//lib/active_support/parameter_filter.rb#62 -class ActiveSupport::ParameterFilter::CompiledFilter - # @return [CompiledFilter] a new instance of CompiledFilter - # - # source://activesupport//lib/active_support/parameter_filter.rb#96 - def initialize(regexps, deep_regexps, blocks, mask:); end - - # Returns the value of attribute blocks. - # - # source://activesupport//lib/active_support/parameter_filter.rb#94 - def blocks; end - - # source://activesupport//lib/active_support/parameter_filter.rb#103 - def call(params, parents = T.unsafe(nil), original_params = T.unsafe(nil)); end - - # Returns the value of attribute deep_regexps. - # - # source://activesupport//lib/active_support/parameter_filter.rb#94 - def deep_regexps; end + # source://activesupport//lib/active_support/parameter_filter.rb#125 + def call(params, full_parent_key = T.unsafe(nil), original_params = T.unsafe(nil)); end - # Returns the value of attribute regexps. - # - # source://activesupport//lib/active_support/parameter_filter.rb#94 - def regexps; end + # source://activesupport//lib/active_support/parameter_filter.rb#93 + def compile_filters!(filters); end - # source://activesupport//lib/active_support/parameter_filter.rb#113 - def value_for_key(key, value, parents = T.unsafe(nil), original_params = T.unsafe(nil)); end + # source://activesupport//lib/active_support/parameter_filter.rb#135 + def value_for_key(key, value, full_parent_key = T.unsafe(nil), original_params = T.unsafe(nil)); end class << self - # source://activesupport//lib/active_support/parameter_filter.rb#63 - def compile(filters, mask:); end + # Precompiles an array of filters that otherwise would be passed directly to + # #initialize. Depending on the quantity and types of filters, + # precompilation can improve filtering performance, especially in the case + # where the ParameterFilter instance itself cannot be retained (but the + # precompiled filters can be retained). + # + # filters = [/foo/, :bar, "nested.baz", /nested\.qux/] + # + # precompiled = ActiveSupport::ParameterFilter.precompile_filters(filters) + # # => [/(?-mix:foo)|(?i:bar)/, /(?i:nested\.baz)|(?-mix:nested\.qux)/] + # + # ActiveSupport::ParameterFilter.new(precompiled) + # + # source://activesupport//lib/active_support/parameter_filter.rb#55 + def precompile_filters(filters); end end end -# source://activesupport//lib/active_support/parameter_filter.rb#33 +# source://activesupport//lib/active_support/parameter_filter.rb#40 ActiveSupport::ParameterFilter::FILTERED = T.let(T.unsafe(nil), String) -# NOTE: This approach has been deprecated for end-user code in favor of {thread_mattr_accessor}[rdoc-ref:Module#thread_mattr_accessor] and friends. -# Please use that approach instead. -# -# This module is used to encapsulate access to thread local variables. -# -# Instead of polluting the thread locals namespace: -# -# Thread.current[:connection_handler] -# -# you define a class that extends this module: +# source://activesupport//lib/active_support/railtie.rb#7 +class ActiveSupport::Railtie < ::Rails::Railtie; end + +# = \Range With Format # -# module ActiveRecord -# class RuntimeRegistry -# extend ActiveSupport::PerThreadRegistry -# -# attr_accessor :connection_handler -# end -# end -# -# and invoke the declared instance accessors as class methods. So -# -# ActiveRecord::RuntimeRegistry.connection_handler = connection_handler -# -# sets a connection handler local to the current thread, and -# -# ActiveRecord::RuntimeRegistry.connection_handler -# -# returns a connection handler local to the current thread. -# -# This feature is accomplished by instantiating the class and storing the -# instance as a thread local keyed by the class name. In the example above -# a key "ActiveRecord::RuntimeRegistry" is stored in Thread.current. -# The class methods proxy to said thread local instance. -# -# If the class has an initializer, it must accept no arguments. -# -# source://activesupport//lib/active_support/per_thread_registry.rb#41 -module ActiveSupport::PerThreadRegistry - # source://activesupport//lib/active_support/per_thread_registry.rb#50 - def instance; end - - private - - # source://activesupport//lib/active_support/per_thread_registry.rb#55 - def method_missing(name, *args, &block); end - - class << self - # @private - # - # source://activesupport//lib/active_support/per_thread_registry.rb#42 - def extended(object); end - end -end - -# A class with no predefined methods that behaves similarly to Builder's -# BlankSlate. Used for proxy classes. -# -# source://activesupport//lib/active_support/proxy_object.rb#6 -class ActiveSupport::ProxyObject < ::BasicObject - # Let ActiveSupport::ProxyObject at least raise exceptions. - # - # source://activesupport//lib/active_support/proxy_object.rb#11 - def raise(*args); end -end - -# source://activesupport//lib/active_support/railtie.rb#7 -class ActiveSupport::Railtie < ::Rails::Railtie; end - -# source://activesupport//lib/active_support/core_ext/range/conversions.rb#4 +# source://activesupport//lib/active_support/core_ext/range/conversions.rb#5 module ActiveSupport::RangeWithFormat # Convert range to a formatted string. See RANGE_FORMATS for predefined formats. # @@ -9440,16 +12164,22 @@ module ActiveSupport::RangeWithFormat # range = (1..100) # => 1..100 # # range.to_s # => "1..100" - # range.to_fs(:db) # => "BETWEEN '1' AND '100'" + # range.to_fs(:db) # => "BETWEEN '1' AND '100'" + # + # range = (1..) # => 1.. + # range.to_fs(:db) # => ">= '1'" # - # == Adding your own range formats to to_s + # range = (..100) # => ..100 + # range.to_fs(:db) # => "<= '100'" + # + # == Adding your own range formats to to_fs # You can add your own formats to the Range::RANGE_FORMATS hash. # Use the format name as the hash key and a Proc instance. # # # config/initializers/range_formats.rb # Range::RANGE_FORMATS[:short] = ->(start, stop) { "Between #{start.to_fs(:db)} and #{stop.to_fs(:db)}" } # - # source://activesupport//lib/active_support/core_ext/range/conversions.rb#30 + # source://activesupport//lib/active_support/core_ext/range/conversions.rb#58 def to_formatted_s(format = T.unsafe(nil)); end # Convert range to a formatted string. See RANGE_FORMATS for predefined formats. @@ -9459,23 +12189,30 @@ module ActiveSupport::RangeWithFormat # range = (1..100) # => 1..100 # # range.to_s # => "1..100" - # range.to_fs(:db) # => "BETWEEN '1' AND '100'" + # range.to_fs(:db) # => "BETWEEN '1' AND '100'" + # + # range = (1..) # => 1.. + # range.to_fs(:db) # => ">= '1'" # - # == Adding your own range formats to to_s + # range = (..100) # => ..100 + # range.to_fs(:db) # => "<= '100'" + # + # == Adding your own range formats to to_fs # You can add your own formats to the Range::RANGE_FORMATS hash. # Use the format name as the hash key and a Proc instance. # # # config/initializers/range_formats.rb # Range::RANGE_FORMATS[:short] = ->(start, stop) { "Between #{start.to_fs(:db)} and #{stop.to_fs(:db)}" } # - # source://activesupport//lib/active_support/core_ext/range/conversions.rb#30 + # source://activesupport//lib/active_support/core_ext/range/conversions.rb#51 def to_fs(format = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/range/conversions.rb#5 +# source://activesupport//lib/active_support/core_ext/range/conversions.rb#6 ActiveSupport::RangeWithFormat::RANGE_FORMATS = T.let(T.unsafe(nil), Hash) -# -- +# = Active Support \Reloader +# # This class defines several callbacks: # # to_prepare -- Run once at application startup, and also from @@ -9495,139 +12232,167 @@ ActiveSupport::RangeWithFormat::RANGE_FORMATS = T.let(T.unsafe(nil), Hash) # after_class_unload -- Run immediately after the classes are # unloaded. # -# source://activesupport//lib/active_support/reloader.rb#27 +# source://activesupport//lib/active_support/reloader.rb#28 class ActiveSupport::Reloader < ::ActiveSupport::ExecutionWrapper # @return [Reloader] a new instance of Reloader # - # source://activesupport//lib/active_support/reloader.rb#91 + # source://activesupport//lib/active_support/reloader.rb#99 def initialize; end - # source://activesupport//lib/active_support/callbacks.rb#940 + # source://activesupport//lib/active_support/reloader.rb#31 def _class_unload_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#940 + # source://activesupport//lib/active_support/reloader.rb#29 def _prepare_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#928 - def _run_class_unload_callbacks(&block); end + # source://activesupport//lib/active_support/reloader.rb#31 + def _run_class_unload_callbacks; end + + # source://activesupport//lib/active_support/reloader.rb#31 + def _run_class_unload_callbacks!(&block); end - # source://activesupport//lib/active_support/callbacks.rb#928 - def _run_prepare_callbacks(&block); end + # source://activesupport//lib/active_support/reloader.rb#29 + def _run_prepare_callbacks; end - # source://activesupport//lib/active_support/reloader.rb#77 + # source://activesupport//lib/active_support/reloader.rb#29 + def _run_prepare_callbacks!(&block); end + + # source://activesupport//lib/active_support/reloader.rb#48 + def _run_run_callbacks(&block); end + + # source://activesupport//lib/active_support/reloader.rb#85 def check; end - # source://activesupport//lib/active_support/reloader.rb#77 + # source://activesupport//lib/active_support/reloader.rb#85 def check=(_arg0); end - # source://activesupport//lib/active_support/reloader.rb#77 + # source://activesupport//lib/active_support/reloader.rb#85 def check?; end - # source://activesupport//lib/active_support/reloader.rb#118 + # source://activesupport//lib/active_support/reloader.rb#126 def class_unload!(&block); end - # source://activesupport//lib/active_support/reloader.rb#123 + # source://activesupport//lib/active_support/reloader.rb#131 def complete!; end - # source://activesupport//lib/active_support/reloader.rb#76 + # source://activesupport//lib/active_support/reloader.rb#84 def executor; end - # source://activesupport//lib/active_support/reloader.rb#76 + # source://activesupport//lib/active_support/reloader.rb#84 def executor=(_arg0); end - # source://activesupport//lib/active_support/reloader.rb#76 + # source://activesupport//lib/active_support/reloader.rb#84 def executor?; end # Release the unload lock if it has been previously obtained # - # source://activesupport//lib/active_support/reloader.rb#106 + # source://activesupport//lib/active_support/reloader.rb#114 def release_unload_lock!; end # Acquire the ActiveSupport::Dependencies::Interlock unload lock, # ensuring it will be released automatically # - # source://activesupport//lib/active_support/reloader.rb#98 + # source://activesupport//lib/active_support/reloader.rb#106 def require_unload_lock!; end - # source://activesupport//lib/active_support/reloader.rb#113 + # source://activesupport//lib/active_support/reloader.rb#121 def run!; end class << self - # source://activesupport//lib/active_support/callbacks.rb#68 - def __callbacks; end - - # source://activesupport//lib/active_support/callbacks.rb#932 + # source://activesupport//lib/active_support/reloader.rb#31 def _class_unload_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#936 + # source://activesupport//lib/active_support/reloader.rb#31 def _class_unload_callbacks=(value); end - # source://activesupport//lib/active_support/callbacks.rb#932 + # source://activesupport//lib/active_support/reloader.rb#29 def _prepare_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#936 + # source://activesupport//lib/active_support/reloader.rb#29 def _prepare_callbacks=(value); end # Registers a callback that will run immediately after the classes are unloaded. # - # source://activesupport//lib/active_support/reloader.rb#43 + # source://activesupport//lib/active_support/reloader.rb#44 def after_class_unload(*args, &block); end # Registers a callback that will run immediately before the classes are unloaded. # - # source://activesupport//lib/active_support/reloader.rb#38 + # source://activesupport//lib/active_support/reloader.rb#39 def before_class_unload(*args, &block); end - # source://activesupport//lib/active_support/reloader.rb#77 + # source://activesupport//lib/active_support/reloader.rb#85 def check; end - # source://activesupport//lib/active_support/reloader.rb#79 + # source://activesupport//lib/active_support/reloader.rb#87 def check!; end - # source://activesupport//lib/active_support/reloader.rb#77 + # source://activesupport//lib/active_support/reloader.rb#85 def check=(value); end - # source://activesupport//lib/active_support/reloader.rb#77 + # source://activesupport//lib/active_support/reloader.rb#85 def check?; end - # source://activesupport//lib/active_support/reloader.rb#76 + # source://activesupport//lib/active_support/reloader.rb#84 def executor; end - # source://activesupport//lib/active_support/reloader.rb#76 + # source://activesupport//lib/active_support/reloader.rb#84 def executor=(value); end - # source://activesupport//lib/active_support/reloader.rb#76 + # source://activesupport//lib/active_support/reloader.rb#84 def executor?; end - # source://activesupport//lib/active_support/reloader.rb#87 + # source://activesupport//lib/active_support/reloader.rb#95 def prepare!; end # Initiate a manual reload # - # source://activesupport//lib/active_support/reloader.rb#50 + # source://activesupport//lib/active_support/reloader.rb#51 def reload!; end - # source://activesupport//lib/active_support/reloader.rb#83 + # source://activesupport//lib/active_support/reloader.rb#91 def reloaded!; end - # source://activesupport//lib/active_support/reloader.rb#61 + # source://activesupport//lib/active_support/reloader.rb#62 def run!(reset: T.unsafe(nil)); end # Registers a callback that will run once at application startup and every time the code is reloaded. # - # source://activesupport//lib/active_support/reloader.rb#33 + # source://activesupport//lib/active_support/reloader.rb#34 def to_prepare(*args, &block); end # Run the supplied block as a work unit, reloading code as needed # - # source://activesupport//lib/active_support/reloader.rb#70 - def wrap; end + # source://activesupport//lib/active_support/reloader.rb#71 + def wrap(**kwargs); end + + private + + # source://activesupport//lib/active_support/reloader.rb#29 + def __class_attr___callbacks; end + + # source://activesupport//lib/active_support/reloader.rb#29 + def __class_attr___callbacks=(new_value); end + + # source://activesupport//lib/active_support/reloader.rb#85 + def __class_attr_check; end + + # source://activesupport//lib/active_support/reloader.rb#85 + def __class_attr_check=(new_value); end + + # source://activesupport//lib/active_support/reloader.rb#84 + def __class_attr_executor; end + + # source://activesupport//lib/active_support/reloader.rb#84 + def __class_attr_executor=(new_value); end end end +# = Active Support \Rescuable +# # Rescuable module adds support for easier exception handling. # -# source://activesupport//lib/active_support/rescuable.rb#9 +# source://activesupport//lib/active_support/rescuable.rb#11 module ActiveSupport::Rescuable extend ::ActiveSupport::Concern include GeneratedInstanceMethods @@ -9638,13 +12403,13 @@ module ActiveSupport::Rescuable # Internal handler lookup. Delegates to class method. Some libraries call # this directly, so keeping it around for compatibility. # - # source://activesupport//lib/active_support/rescuable.rb#170 + # source://activesupport//lib/active_support/rescuable.rb#172 def handler_for_rescue(exception); end # Delegates to the class method, but uses the instance as the subject for # rescue_from handlers (method calls, +instance_exec+ blocks). # - # source://activesupport//lib/active_support/rescuable.rb#164 + # source://activesupport//lib/active_support/rescuable.rb#166 def rescue_with_handler(exception); end module GeneratedClassMethods @@ -9660,9 +12425,9 @@ module ActiveSupport::Rescuable end end -# source://activesupport//lib/active_support/rescuable.rb#16 +# source://activesupport//lib/active_support/rescuable.rb#18 module ActiveSupport::Rescuable::ClassMethods - # source://activesupport//lib/active_support/rescuable.rb#103 + # source://activesupport//lib/active_support/rescuable.rb#105 def handler_for_rescue(exception, object: T.unsafe(nil)); end # Registers exception classes with a handler to be called by rescue_with_handler. @@ -9700,7 +12465,7 @@ module ActiveSupport::Rescuable::ClassMethods # # Exceptions raised inside exception handlers are not propagated up. # - # source://activesupport//lib/active_support/rescuable.rb#51 + # source://activesupport//lib/active_support/rescuable.rb#53 def rescue_from(*klasses, with: T.unsafe(nil), &block); end # Matches an exception to a handler based on the exception class. @@ -9718,256 +12483,260 @@ module ActiveSupport::Rescuable::ClassMethods # # Returns the exception if it was handled and +nil+ if it was not. # - # source://activesupport//lib/active_support/rescuable.rb#88 + # source://activesupport//lib/active_support/rescuable.rb#90 def rescue_with_handler(exception, object: T.unsafe(nil), visited_exceptions: T.unsafe(nil)); end private - # source://activesupport//lib/active_support/rescuable.rb#137 + # source://activesupport//lib/active_support/rescuable.rb#139 def constantize_rescue_handler_class(class_or_name); end - # source://activesupport//lib/active_support/rescuable.rb#122 + # source://activesupport//lib/active_support/rescuable.rb#124 def find_rescue_handler(exception); end end -# source://activesupport//lib/active_support/ruby_features.rb#4 -module ActiveSupport::RubyFeatures; end - -# RUBY_VERSION >= "3.1" -# -# source://activesupport//lib/active_support/ruby_features.rb#5 -ActiveSupport::RubyFeatures::CLASS_SUBCLASSES = T.let(T.unsafe(nil), FalseClass) - -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#162 +# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#19 class ActiveSupport::SafeBuffer < ::String # @return [SafeBuffer] a new instance of SafeBuffer # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#200 - def initialize(str = T.unsafe(nil)); end + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#70 + def initialize(_str = T.unsafe(nil)); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#253 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#124 def %(args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#246 - def *(*_arg0); end + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#115 + def *(_); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#242 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#111 def +(other); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#214 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#85 def <<(value); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#181 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#38 def [](*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#234 - def []=(*args); end + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#103 + def []=(arg1, arg2, arg3 = T.unsafe(nil)); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#143 + def as_json(*_arg0); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#87 + def bytesplice(*args, value); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def capitalize(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def capitalize!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def chomp(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def chomp!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def chop(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def chop!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#210 - def clone_empty; end + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#59 + def chr; end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#214 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#79 def concat(value); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def delete(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def delete!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def delete_prefix(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def delete_prefix!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def delete_suffix(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def delete_suffix!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def downcase(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def downcase!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#276 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#151 def encode_with(coder); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#297 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#171 def gsub(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#308 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#171 def gsub!(*args, &block); end # @return [Boolean] # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#264 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#135 def html_safe?; end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#222 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#91 def insert(index, value); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def lstrip(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def lstrip!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def next(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def next!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#226 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#95 def prepend(value); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#230 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#99 def replace(value); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def reverse(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def reverse!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def rstrip(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def rstrip!(*args); end # @raise [SafeConcatError] # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#195 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#65 def safe_concat(value); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def scrub(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def scrub!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 - def slice(*args, &block); end + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#49 + def slice(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#51 def slice!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def squeeze(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def squeeze!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def strip(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def strip!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#297 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#171 def sub(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#308 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#171 def sub!(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def succ(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def succ!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def swapcase(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def swapcase!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#272 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#147 def to_param; end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#268 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#139 def to_s; end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def tr(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def tr!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def tr_s(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def tr_s!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def unicode_normalize(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def unicode_normalize!(*args); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#283 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def upcase(*args, &block); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#287 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#157 def upcase!(*args); end private - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#323 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#198 def explicit_html_escape_interpolated_argument(arg); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#327 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#202 def implicit_html_escape_interpolated_argument(arg); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#205 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#74 def initialize_copy(other); end + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#28 def original_concat(*_arg0); end - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#350 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#210 def set_block_back_references(block, match_data); end + + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#216 + def string_into_safe_buffer(new_string, is_html_safe); end end # Raised when ActiveSupport::SafeBuffer#safe_concat is called on unsafe buffers. # -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#175 +# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#32 class ActiveSupport::SafeBuffer::SafeConcatError < ::StandardError # @return [SafeConcatError] a new instance of SafeConcatError # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#176 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#33 def initialize; end end -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#163 +# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#20 ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#169 +# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#26 ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS_WITH_BACKREF = T.let(T.unsafe(nil), Array) +# = Secure Compare Rotator +# # The ActiveSupport::SecureCompareRotator is a wrapper around ActiveSupport::SecurityUtils.secure_compare # and allows you to rotate a previously defined value to a new one. # @@ -9992,26 +12761,23 @@ ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS_WITH_BACKREF = T.let(T.unsafe(n # end # end # -# source://activesupport//lib/active_support/secure_compare_rotator.rb#30 +# source://activesupport//lib/active_support/secure_compare_rotator.rb#32 class ActiveSupport::SecureCompareRotator - include ::ActiveSupport::Messages::Rotator include ::ActiveSupport::SecurityUtils # @return [SecureCompareRotator] a new instance of SecureCompareRotator # - # source://activesupport//lib/active_support/messages/rotator.rb#6 - def initialize(*secrets, on_rotation: T.unsafe(nil), **options); end + # source://activesupport//lib/active_support/secure_compare_rotator.rb#37 + def initialize(value, on_rotation: T.unsafe(nil)); end - # source://activesupport//lib/active_support/secure_compare_rotator.rb#40 - def secure_compare!(other_value, on_rotation: T.unsafe(nil)); end - - private + # source://activesupport//lib/active_support/secure_compare_rotator.rb#43 + def rotate(previous_value); end # source://activesupport//lib/active_support/secure_compare_rotator.rb#47 - def build_rotation(previous_value, _options); end + def secure_compare!(other_value, on_rotation: T.unsafe(nil)); end end -# source://activesupport//lib/active_support/secure_compare_rotator.rb#34 +# source://activesupport//lib/active_support/secure_compare_rotator.rb#35 class ActiveSupport::SecureCompareRotator::InvalidMatch < ::StandardError; end # source://activesupport//lib/active_support/security_utils.rb#4 @@ -10020,7 +12786,7 @@ module ActiveSupport::SecurityUtils # @raise [ArgumentError] # - # source://activesupport//lib/active_support/security_utils.rb#15 + # source://activesupport//lib/active_support/security_utils.rb#11 def fixed_length_secure_compare(a, b); end # Secure string comparison for strings of variable length. @@ -10036,7 +12802,7 @@ module ActiveSupport::SecurityUtils class << self # @raise [ArgumentError] # - # source://activesupport//lib/active_support/security_utils.rb#15 + # source://activesupport//lib/active_support/security_utils.rb#25 def fixed_length_secure_compare(a, b); end # Secure string comparison for strings of variable length. @@ -10046,11 +12812,13 @@ module ActiveSupport::SecurityUtils # the secret length. This should be considered when using secure_compare # to compare weak, short secrets to user input. # - # source://activesupport//lib/active_support/security_utils.rb#33 + # source://activesupport//lib/active_support/security_utils.rb#36 def secure_compare(a, b); end end end +# = \String Inquirer +# # Wrapping a string in this class gives you a prettier way to test # for equality. The value returned by Rails.env is wrapped # in a StringInquirer object, so instead of calling this: @@ -10061,26 +12829,126 @@ end # # Rails.env.production? # -# == Instantiating a new StringInquirer +# == Instantiating a new \StringInquirer # # vehicle = ActiveSupport::StringInquirer.new('car') # vehicle.car? # => true # vehicle.bike? # => false # -# source://activesupport//lib/active_support/string_inquirer.rb#19 +# source://activesupport//lib/active_support/string_inquirer.rb#21 class ActiveSupport::StringInquirer < ::String private - # source://activesupport//lib/active_support/string_inquirer.rb#25 - def method_missing(method_name, *arguments); end + # source://activesupport//lib/active_support/string_inquirer.rb#27 + def method_missing(method_name, *_arg1, **_arg2, &_arg3); end # @return [Boolean] # - # source://activesupport//lib/active_support/string_inquirer.rb#21 + # source://activesupport//lib/active_support/string_inquirer.rb#23 def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end end -# ActiveSupport::Subscriber is an object set to consume +# = Active Support Structured Event \Subscriber +# +# +ActiveSupport::StructuredEventSubscriber+ consumes ActiveSupport::Notifications +# in order to emit structured events via +Rails.event+. +# +# An example would be the Action Controller structured event subscriber, responsible for +# emitting request processing events: +# +# module ActionController +# class StructuredEventSubscriber < ActiveSupport::StructuredEventSubscriber +# attach_to :action_controller +# +# def start_processing(event) +# emit_event("controller.request_started", +# controller: event.payload[:controller], +# action: event.payload[:action], +# format: event.payload[:format] +# ) +# end +# end +# end +# +# After configured, whenever a "start_processing.action_controller" notification is published, +# it will properly dispatch the event (+ActiveSupport::Notifications::Event+) to the +start_processing+ method. +# The subscriber can then emit a structured event via the +emit_event+ method. +# +# source://activesupport//lib/active_support/structured_event_subscriber.rb#31 +class ActiveSupport::StructuredEventSubscriber < ::ActiveSupport::Subscriber + # @return [StructuredEventSubscriber] a new instance of StructuredEventSubscriber + # + # source://activesupport//lib/active_support/structured_event_subscriber.rb#56 + def initialize; end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#88 + def call(event); end + + # Like +emit_event+, but only emits when the event reporter is in debug mode + # + # source://activesupport//lib/active_support/structured_event_subscriber.rb#82 + def emit_debug_event(name, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # Emit a structured event via Rails.event.notify. + # + # ==== Arguments + # + # * +name+ - The event name as a string or symbol + # * +payload+ - The event payload as a hash or object + # * +caller_depth+ - Stack depth for source location (default: 1) + # * +kwargs+ - Additional payload data merged with the payload hash + # + # source://activesupport//lib/active_support/structured_event_subscriber.rb#75 + def emit_event(name, payload = T.unsafe(nil), caller_depth: T.unsafe(nil), **kwargs); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/structured_event_subscriber.rb#61 + def silenced?(event); end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#65 + def silenced_events=(_arg0); end + + private + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#95 + def handle_event_error(name, error); end + + class << self + # source://activesupport//lib/active_support/structured_event_subscriber.rb#37 + def attach_to(*_arg0, **_arg1, &_arg2); end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#32 + def debug_methods; end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#32 + def debug_methods=(value); end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#32 + def debug_methods?; end + + private + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#32 + def __class_attr_debug_methods; end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#32 + def __class_attr_debug_methods=(new_value); end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#50 + def debug_only(method); end + + # source://activesupport//lib/active_support/structured_event_subscriber.rb#44 + def set_silenced_events; end + end +end + +# source://activesupport//lib/active_support/structured_event_subscriber.rb#34 +ActiveSupport::StructuredEventSubscriber::DEBUG_CHECK = T.let(T.unsafe(nil), Proc) + +# = Active Support \Subscriber +# +# +ActiveSupport::Subscriber+ is an object set to consume # ActiveSupport::Notifications. The subscriber dispatches notifications to # a registered object based on its given namespace. # @@ -10097,109 +12965,167 @@ end # end # end # -# After configured, whenever a "sql.active_record" notification is published, -# it will properly dispatch the event (ActiveSupport::Notifications::Event) to -# the +sql+ method. +# After configured, whenever a "sql.active_record" notification is +# published, it will properly dispatch the event +# (ActiveSupport::Notifications::Event) to the +sql+ method. # # We can detach a subscriber as well: # # ActiveRecord::StatsSubscriber.detach_from(:active_record) # -# source://activesupport//lib/active_support/subscriber.rb#30 +# source://activesupport//lib/active_support/subscriber.rb#32 class ActiveSupport::Subscriber # @return [Subscriber] a new instance of Subscriber # - # source://activesupport//lib/active_support/subscriber.rb#128 + # source://activesupport//lib/active_support/subscriber.rb#70 def initialize; end - # source://activesupport//lib/active_support/subscriber.rb#143 - def finish(name, id, payload); end + # source://activesupport//lib/active_support/subscriber.rb#70 + def call(event); end - # source://activesupport//lib/active_support/subscriber.rb#126 + # source://activesupport//lib/active_support/subscriber.rb#70 def patterns; end - # source://activesupport//lib/active_support/subscriber.rb#152 - def publish_event(event); end - - # source://activesupport//lib/active_support/subscriber.rb#134 - def start(name, id, payload); end - - private - - # source://activesupport//lib/active_support/subscriber.rb#158 - def event_stack; end - class << self # Attach the subscriber to a namespace. # - # source://activesupport//lib/active_support/subscriber.rb#33 + # source://activesupport//lib/active_support/subscriber.rb#35 def attach_to(namespace, subscriber = T.unsafe(nil), notifier = T.unsafe(nil), inherit_all: T.unsafe(nil)); end # Detach the subscriber from a namespace. # - # source://activesupport//lib/active_support/subscriber.rb#48 + # source://activesupport//lib/active_support/subscriber.rb#50 def detach_from(namespace, notifier = T.unsafe(nil)); end # Adds event subscribers for all new methods added to the class. # - # source://activesupport//lib/active_support/subscriber.rb#67 + # source://activesupport//lib/active_support/subscriber.rb#69 def method_added(event); end - # source://activesupport//lib/active_support/subscriber.rb#76 + # source://activesupport//lib/active_support/subscriber.rb#79 def subscribers; end private - # source://activesupport//lib/active_support/subscriber.rb#83 + # source://activesupport//lib/active_support/subscriber.rb#86 def add_event_subscriber(event); end - # source://activesupport//lib/active_support/subscriber.rb#121 + # source://activesupport//lib/active_support/subscriber.rb#124 def fetch_public_methods(subscriber, inherit_all); end - # source://activesupport//lib/active_support/subscriber.rb#105 + # source://activesupport//lib/active_support/subscriber.rb#108 def find_attached_subscriber; end # @return [Boolean] # - # source://activesupport//lib/active_support/subscriber.rb#109 + # source://activesupport//lib/active_support/subscriber.rb#112 def invalid_event?(event); end # Returns the value of attribute namespace. # - # source://activesupport//lib/active_support/subscriber.rb#81 + # source://activesupport//lib/active_support/subscriber.rb#84 def namespace; end # Returns the value of attribute notifier. # - # source://activesupport//lib/active_support/subscriber.rb#81 + # source://activesupport//lib/active_support/subscriber.rb#84 def notifier; end # @return [Boolean] # - # source://activesupport//lib/active_support/subscriber.rb#117 + # source://activesupport//lib/active_support/subscriber.rb#120 def pattern_subscribed?(pattern); end - # source://activesupport//lib/active_support/subscriber.rb#113 + # source://activesupport//lib/active_support/subscriber.rb#116 def prepare_pattern(event); end - # source://activesupport//lib/active_support/subscriber.rb#94 + # source://activesupport//lib/active_support/subscriber.rb#97 def remove_event_subscriber(event); end # Returns the value of attribute subscriber. # - # source://activesupport//lib/active_support/subscriber.rb#81 + # source://activesupport//lib/active_support/subscriber.rb#84 def subscriber; end end end +# This is a class for wrapping syntax errors. The purpose of this class +# is to enhance the backtraces on SyntaxError exceptions to include the +# source location of the syntax error. That way we can display the error +# source on error pages in development. +# +# source://activesupport//lib/active_support/syntax_error_proxy.rb#10 +class ActiveSupport::SyntaxErrorProxy + # source://activesupport//lib/active_support/syntax_error_proxy.rb#11 + def backtrace; end + + # source://activesupport//lib/active_support/syntax_error_proxy.rb#41 + def backtrace_locations; end + + private + + # source://activesupport//lib/active_support/syntax_error_proxy.rb#54 + def parse_message_for_trace; end +end + +# source://activesupport//lib/active_support/syntax_error_proxy.rb#15 +class ActiveSupport::SyntaxErrorProxy::BacktraceLocation < ::Struct + # source://activesupport//lib/active_support/syntax_error_proxy.rb#25 + def absolute_path; end + + # source://activesupport//lib/active_support/syntax_error_proxy.rb#22 + def base_label; end + + # source://activesupport//lib/active_support/syntax_error_proxy.rb#19 + def label; end + + # source://activesupport//lib/active_support/syntax_error_proxy.rb#16 + def spot(_); end +end + +# source://activesupport//lib/active_support/syntax_error_proxy.rb#30 +class ActiveSupport::SyntaxErrorProxy::BacktraceLocationProxy + # @return [BacktraceLocationProxy] a new instance of BacktraceLocationProxy + # + # source://activesupport//lib/active_support/syntax_error_proxy.rb#31 + def initialize(loc, ex); end + + # source://activesupport//lib/active_support/syntax_error_proxy.rb#36 + def spot(_); end +end + +# source://activesupport//lib/active_support/event_reporter.rb#6 +class ActiveSupport::TagStack + class << self + # source://activesupport//lib/active_support/event_reporter.rb#11 + def tags; end + + # source://activesupport//lib/active_support/event_reporter.rb#15 + def with_tags(*args, **kwargs); end + + private + + # source://activesupport//lib/active_support/event_reporter.rb#30 + def resolve_tags(args, kwargs); end + end +end + +# source://activesupport//lib/active_support/event_reporter.rb#7 +ActiveSupport::TagStack::EMPTY_TAGS = T.let(T.unsafe(nil), Hash) + +# source://activesupport//lib/active_support/event_reporter.rb#8 +ActiveSupport::TagStack::FIBER_KEY = T.let(T.unsafe(nil), Symbol) + +# = Active Support Tagged Logging +# # Wraps any standard Logger object to provide tagging capabilities. # # May be called with a block: # # logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT)) -# logger.tagged('BCX') { logger.info 'Stuff' } # Logs "[BCX] Stuff" -# logger.tagged('BCX', "Jason") { logger.info 'Stuff' } # Logs "[BCX] [Jason] Stuff" -# logger.tagged('BCX') { logger.tagged('Jason') { logger.info 'Stuff' } } # Logs "[BCX] [Jason] Stuff" +# logger.tagged('BCX') { logger.info 'Stuff' } # Logs "[BCX] Stuff" +# logger.tagged('BCX', "Jason") { |tagged_logger| tagged_logger.info 'Stuff' } # Logs "[BCX] [Jason] Stuff" +# logger.tagged('BCX') { logger.tagged('Jason') { logger.info 'Stuff' } } # Logs "[BCX] [Jason] Stuff" # # If called without a block, a new logger will be returned with applied tags: # @@ -10212,84 +13138,122 @@ end # it easy to stamp log lines with subdomains, request ids, and anything else # to aid debugging of multi-user production applications. # -# source://activesupport//lib/active_support/tagged_logging.rb#28 +# source://activesupport//lib/active_support/tagged_logging.rb#29 module ActiveSupport::TaggedLogging - # source://activesupport//lib/active_support/tagged_logging.rb#95 - def clear_tags!(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/tagged_logging.rb#139 + def clear_tags!(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/tagged_logging.rb#108 + # source://activesupport//lib/active_support/tagged_logging.rb#152 def flush; end - # source://activesupport//lib/active_support/tagged_logging.rb#95 - def pop_tags(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/tagged_logging.rb#139 + def pop_tags(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/tagged_logging.rb#95 - def push_tags(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/tagged_logging.rb#139 + def push_tags(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/tagged_logging.rb#97 + # source://activesupport//lib/active_support/tagged_logging.rb#141 def tagged(*tags); end class << self - # source://activesupport//lib/active_support/tagged_logging.rb#81 + # Returns an `ActiveSupport::Logger` that has already been wrapped with tagged logging concern. + # + # source://activesupport//lib/active_support/tagged_logging.rb#117 + def logger(*args, **kwargs); end + + # source://activesupport//lib/active_support/tagged_logging.rb#121 def new(logger); end end end -# source://activesupport//lib/active_support/tagged_logging.rb#29 +# source://activesupport//lib/active_support/tagged_logging.rb#30 module ActiveSupport::TaggedLogging::Formatter # This method is invoked when a log event occurs. # - # source://activesupport//lib/active_support/tagged_logging.rb#31 + # source://activesupport//lib/active_support/tagged_logging.rb#32 def call(severity, timestamp, progname, msg); end - # source://activesupport//lib/active_support/tagged_logging.rb#53 + # source://activesupport//lib/active_support/tagged_logging.rb#51 def clear_tags!; end - # source://activesupport//lib/active_support/tagged_logging.rb#57 + # source://activesupport//lib/active_support/tagged_logging.rb#61 def current_tags; end - # source://activesupport//lib/active_support/tagged_logging.rb#49 - def pop_tags(size = T.unsafe(nil)); end + # source://activesupport//lib/active_support/tagged_logging.rb#47 + def pop_tags(count = T.unsafe(nil)); end - # source://activesupport//lib/active_support/tagged_logging.rb#42 + # source://activesupport//lib/active_support/tagged_logging.rb#43 def push_tags(*tags); end - # source://activesupport//lib/active_support/tagged_logging.rb#35 + # source://activesupport//lib/active_support/tagged_logging.rb#55 + def tag_stack; end + + # source://activesupport//lib/active_support/tagged_logging.rb#36 def tagged(*tags); end - # source://activesupport//lib/active_support/tagged_logging.rb#63 + # source://activesupport//lib/active_support/tagged_logging.rb#65 def tags_text; end end -# source://activesupport//lib/active_support/tagged_logging.rb#73 +# source://activesupport//lib/active_support/tagged_logging.rb#108 module ActiveSupport::TaggedLogging::LocalTagStorage - # Returns the value of attribute current_tags. + # Returns the value of attribute tag_stack. # - # source://activesupport//lib/active_support/tagged_logging.rb#74 - def current_tags; end + # source://activesupport//lib/active_support/tagged_logging.rb#109 + def tag_stack; end - # Sets the attribute current_tags + # Sets the attribute tag_stack # - # @param value the value to set the attribute current_tags to. + # @param value the value to set the attribute tag_stack to. # - # source://activesupport//lib/active_support/tagged_logging.rb#74 - def current_tags=(_arg0); end + # source://activesupport//lib/active_support/tagged_logging.rb#109 + def tag_stack=(_arg0); end class << self # @private # - # source://activesupport//lib/active_support/tagged_logging.rb#76 + # source://activesupport//lib/active_support/tagged_logging.rb#111 def extended(base); end end end -# source://activesupport//lib/active_support/test_case.rb#19 +# source://activesupport//lib/active_support/tagged_logging.rb#70 +class ActiveSupport::TaggedLogging::TagStack + # @return [TagStack] a new instance of TagStack + # + # source://activesupport//lib/active_support/tagged_logging.rb#73 + def initialize; end + + # source://activesupport//lib/active_support/tagged_logging.rb#91 + def clear; end + + # source://activesupport//lib/active_support/tagged_logging.rb#96 + def format_message(message); end + + # source://activesupport//lib/active_support/tagged_logging.rb#86 + def pop_tags(count); end + + # source://activesupport//lib/active_support/tagged_logging.rb#78 + def push_tags(tags); end + + # Returns the value of attribute tags. + # + # source://activesupport//lib/active_support/tagged_logging.rb#71 + def tags; end +end + +# source://activesupport//lib/active_support/test_case.rb#23 class ActiveSupport::TestCase < ::Minitest::Test include ::ActiveSupport::Testing::SetupAndTeardown + include ::ActiveSupport::Testing::TestsWithoutAssertions include ::ActiveSupport::Testing::TaggedLogging include ::ActiveSupport::Callbacks include ::ActiveSupport::Testing::Assertions + include ::ActiveSupport::Testing::ErrorReporterAssertions + include ::ActiveSupport::Testing::EventReporterAssertions + include ::ActiveSupport::Testing::NotificationAssertions include ::ActiveSupport::Testing::Deprecation + include ::ActiveSupport::Testing::ConstantStubbing include ::ActiveSupport::Testing::TimeHelpers include ::ActiveSupport::Testing::FileFixtures extend ::ActiveSupport::Callbacks::ClassMethods @@ -10297,119 +13261,130 @@ class ActiveSupport::TestCase < ::Minitest::Test extend ::ActiveSupport::Testing::SetupAndTeardown::ClassMethods extend ::ActiveSupport::Testing::Declarative - # source://activesupport//lib/active_support/callbacks.rb#68 + # source://activesupport//lib/active_support/test_case.rb#204 def __callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#68 - def __callbacks?; end + # source://activesupport//lib/active_support/test_case.rb#204 + def _run_setup_callbacks; end + + # source://activesupport//lib/active_support/test_case.rb#204 + def _run_setup_callbacks!(&block); end - # source://activesupport//lib/active_support/callbacks.rb#928 - def _run_setup_callbacks(&block); end + # source://activesupport//lib/active_support/test_case.rb#204 + def _run_teardown_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#928 - def _run_teardown_callbacks(&block); end + # source://activesupport//lib/active_support/test_case.rb#204 + def _run_teardown_callbacks!(&block); end - # source://activesupport//lib/active_support/callbacks.rb#940 + # source://activesupport//lib/active_support/test_case.rb#204 def _setup_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#940 + # source://activesupport//lib/active_support/test_case.rb#204 def _teardown_callbacks; end - # source://minitest/5.16.3/lib/minitest/assertions.rb#709 + # source://activesupport//lib/active_support/test_case.rb#302 def assert_no_match(matcher, obj, msg = T.unsafe(nil)); end - # source://minitest/5.16.3/lib/minitest/assertions.rb#638 + # source://activesupport//lib/active_support/test_case.rb#225 def assert_not_empty(obj, msg = T.unsafe(nil)); end - # source://minitest/5.16.3/lib/minitest/assertions.rb#649 + # source://activesupport//lib/active_support/test_case.rb#236 def assert_not_equal(exp, act, msg = T.unsafe(nil)); end - # source://minitest/5.16.3/lib/minitest/assertions.rb#661 + # source://activesupport//lib/active_support/test_case.rb#247 def assert_not_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end - # source://minitest/5.16.3/lib/minitest/assertions.rb#673 - def assert_not_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end + # source://activesupport//lib/active_support/test_case.rb#258 + def assert_not_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end - # source://minitest/5.16.3/lib/minitest/assertions.rb#680 - def assert_not_includes(collection, obj, msg = T.unsafe(nil)); end + # source://activesupport//lib/active_support/test_case.rb#269 + def assert_not_includes(obj, sub, msg = T.unsafe(nil)); end - # source://minitest/5.16.3/lib/minitest/assertions.rb#691 + # source://activesupport//lib/active_support/test_case.rb#280 def assert_not_instance_of(cls, obj, msg = T.unsafe(nil)); end - # source://minitest/5.16.3/lib/minitest/assertions.rb#701 + # source://activesupport//lib/active_support/test_case.rb#291 def assert_not_kind_of(cls, obj, msg = T.unsafe(nil)); end - # source://minitest/5.16.3/lib/minitest/assertions.rb#719 + # source://activesupport//lib/active_support/test_case.rb#313 def assert_not_nil(obj, msg = T.unsafe(nil)); end - # source://minitest/5.16.3/lib/minitest/assertions.rb#730 + # source://activesupport//lib/active_support/test_case.rb#324 def assert_not_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end - # source://minitest/5.16.3/lib/minitest/assertions.rb#753 + # source://activesupport//lib/active_support/test_case.rb#335 def assert_not_predicate(o1, op, msg = T.unsafe(nil)); end - # source://minitest/5.16.3/lib/minitest/assertions.rb#761 - def assert_not_respond_to(obj, meth, msg = T.unsafe(nil)); end + # source://activesupport//lib/active_support/test_case.rb#346 + def assert_not_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end - # source://minitest/5.16.3/lib/minitest/assertions.rb#770 + # source://activesupport//lib/active_support/test_case.rb#357 def assert_not_same(exp, act, msg = T.unsafe(nil)); end - # test/unit backwards compatibility methods - # - # source://minitest/5.16.3/lib/minitest/assertions.rb#396 - def assert_raise(*exp); end - - # source://activesupport//lib/active_support/testing/file_fixtures.rb#20 + # source://activesupport//lib/active_support/test_case.rb#213 def file_fixture_path; end - # source://activesupport//lib/active_support/testing/file_fixtures.rb#20 + # source://activesupport//lib/active_support/test_case.rb#213 def file_fixture_path?; end - # source://activesupport//lib/active_support/test_case.rb#151 + # source://activesupport//lib/active_support/test_case.rb#361 def inspect; end - # source://minitest/5.16.3/lib/minitest.rb#304 + # source://activesupport//lib/active_support/test_case.rb#196 def method_name; end + # Returns the current parallel worker ID if tests are running in parallel + # + # source://activesupport//lib/active_support/test_case.rb#199 + def parallel_worker_id; end + class << self - # source://activesupport//lib/active_support/callbacks.rb#68 + # source://activesupport//lib/active_support/test_case.rb#204 def __callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#68 + # source://activesupport//lib/active_support/test_case.rb#204 def __callbacks=(value); end - # source://activesupport//lib/active_support/callbacks.rb#68 - def __callbacks?; end - - # source://activesupport//lib/active_support/callbacks.rb#932 + # source://activesupport//lib/active_support/test_case.rb#204 def _setup_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#936 + # source://activesupport//lib/active_support/test_case.rb#204 def _setup_callbacks=(value); end - # source://activesupport//lib/active_support/callbacks.rb#932 + # source://activesupport//lib/active_support/test_case.rb#204 def _teardown_callbacks; end - # source://activesupport//lib/active_support/callbacks.rb#936 + # source://activesupport//lib/active_support/test_case.rb#204 def _teardown_callbacks=(value); end - # source://activesupport//lib/active_support/testing/file_fixtures.rb#20 + # source://activesupport//lib/active_support/test_case.rb#213 def file_fixture_path; end - # source://activesupport//lib/active_support/testing/file_fixtures.rb#20 + # source://activesupport//lib/active_support/test_case.rb#213 def file_fixture_path=(value); end - # source://activesupport//lib/active_support/testing/file_fixtures.rb#20 + # source://activesupport//lib/active_support/test_case.rb#213 def file_fixture_path?; end + # Returns the current parallel worker ID if tests are running in parallel, + # nil otherwise. + # + # ActiveSupport::TestCase.parallel_worker_id # => 2 + # + # source://activesupport//lib/active_support/test_case.rb#34 + def parallel_worker_id; end + + # source://activesupport//lib/active_support/test_case.rb#38 + def parallel_worker_id=(value); end + # Parallelizes the test suite. # # Takes a +workers+ argument that controls how many times the process # is forked. For each process a new database will be created suffixed # with the worker number. # - # test-database-0 - # test-database-1 + # test-database_0 + # test-database_1 # # If ENV["PARALLEL_WORKERS"] is set the workers argument will be ignored # and the environment variable will be used instead. This is useful for CI @@ -10425,7 +13400,7 @@ class ActiveSupport::TestCase < ::Minitest::Test # The default parallelization method is to fork processes. If you'd like to # use threads instead you can pass with: :threads to the +parallelize+ # method. Note the threaded parallelization does not create multiple - # database and will not work with system tests at this time. + # databases and will not work with system tests. # # parallelize(workers: :number_of_processors, with: :threads) # @@ -10436,10 +13411,33 @@ class ActiveSupport::TestCase < ::Minitest::Test # number of tests to run is above the +threshold+ param. The default value is # 50, and it's configurable via +config.active_support.test_parallelization_threshold+. # - # source://activesupport//lib/active_support/test_case.rb#79 - def parallelize(workers: T.unsafe(nil), with: T.unsafe(nil), threshold: T.unsafe(nil)); end + # If you want to skip Rails default creation of one database per process in favor of + # writing your own implementation, you can set +parallelize_databases+, or configure it + # via +config.active_support.parallelize_test_databases+. + # + # parallelize(workers: :number_of_processors, parallelize_databases: false) + # + # Note that your test suite may deadlock if you attempt to use only one database + # with multiple processes. + # + # source://activesupport//lib/active_support/test_case.rb#113 + def parallelize(workers: T.unsafe(nil), with: T.unsafe(nil), threshold: T.unsafe(nil), parallelize_databases: T.unsafe(nil)); end + + # Before fork hook for parallel testing. This can be used to run anything + # before the processes are forked. + # + # In your +test_helper.rb+ add the following: + # + # class ActiveSupport::TestCase + # parallelize_before_fork do + # # run this before fork + # end + # end + # + # source://activesupport//lib/active_support/test_case.rb#138 + def parallelize_before_fork(&block); end - # Set up hook for parallel testing. This can be used if you have multiple + # Setup hook for parallel testing. This can be used if you have multiple # databases or any behavior that needs to be run after the process is forked # but before the tests run. # @@ -10453,7 +13451,7 @@ class ActiveSupport::TestCase < ::Minitest::Test # end # end # - # source://activesupport//lib/active_support/test_case.rb#101 + # source://activesupport//lib/active_support/test_case.rb#155 def parallelize_setup(&block); end # Clean up hook for parallel testing. This can be used to drop databases @@ -10470,7 +13468,7 @@ class ActiveSupport::TestCase < ::Minitest::Test # end # end # - # source://activesupport//lib/active_support/test_case.rb#118 + # source://activesupport//lib/active_support/test_case.rb#172 def parallelize_teardown(&block); end # Returns the order in which test cases are run. @@ -10480,7 +13478,7 @@ class ActiveSupport::TestCase < ::Minitest::Test # Possible values are +:random+, +:parallel+, +:alpha+, +:sorted+. # Defaults to +:random+. # - # source://activesupport//lib/active_support/test_case.rb#42 + # source://activesupport//lib/active_support/test_case.rb#61 def test_order; end # Sets the order in which test cases are run. @@ -10493,12 +13491,26 @@ class ActiveSupport::TestCase < ::Minitest::Test # * +:sorted+ (to run tests alphabetically by method name) # * +:alpha+ (equivalent to +:sorted+) # - # source://activesupport//lib/active_support/test_case.rb#32 + # source://activesupport//lib/active_support/test_case.rb#51 def test_order=(new_order); end + + private + + # source://activesupport//lib/active_support/test_case.rb#204 + def __class_attr___callbacks; end + + # source://activesupport//lib/active_support/test_case.rb#204 + def __class_attr___callbacks=(new_value); end + + # source://activesupport//lib/active_support/test_case.rb#213 + def __class_attr_file_fixture_path; end + + # source://activesupport//lib/active_support/test_case.rb#213 + def __class_attr_file_fixture_path=(new_value); end end end -# source://activesupport//lib/active_support/test_case.rb#20 +# source://activesupport//lib/active_support/test_case.rb#24 ActiveSupport::TestCase::Assertion = Minitest::Assertion # source://activesupport//lib/active_support/testing/tagged_logging.rb#4 @@ -10529,19 +13541,31 @@ module ActiveSupport::Testing::Assertions # # The keyword arguments +:from+ and +:to+ can be given to specify the # expected initial value and the expected value after the block was - # executed. + # executed. The comparison is done using case equality (===), which means + # you can specify patterns or classes: # + # # Exact value match # assert_changes :@object, from: nil, to: :foo do # @object = :foo # end # + # # Case equality + # assert_changes -> { user.token }, to: /\w{32}/ do + # user.generate_token + # end + # + # # Type check + # assert_changes -> { current_error }, from: nil, to: RuntimeError do + # raise "Oops" + # end + # # An error message can be specified. # # assert_changes -> { Status.all_good? }, 'Expected the status to be bad' do # post :create, params: { status: { incident: true } } # end # - # source://activesupport//lib/active_support/testing/assertions.rb#175 + # source://activesupport//lib/active_support/testing/assertions.rb#212 def assert_changes(expression, message = T.unsafe(nil), from: T.unsafe(nil), to: T.unsafe(nil), &block); end # Test numeric difference between the return value of an expression as a @@ -10558,25 +13582,25 @@ module ActiveSupport::Testing::Assertions # end # # An arbitrary positive or negative difference can be specified. - # The default is 1. + # The default is +1+. # # assert_difference 'Article.count', -1 do # post :delete, params: { id: ... } # end # - # An array of expressions can also be passed in and evaluated. + # An array of expressions can be passed in and evaluated. # # assert_difference [ 'Article.count', 'Post.count' ], 2 do # post :create, params: { article: {...} } # end # - # A hash of expressions/numeric differences can also be passed in and evaluated. + # A hash of expressions/numeric differences can be passed in and evaluated. # - # assert_difference ->{ Article.count } => 1, ->{ Notification.count } => 2 do + # assert_difference({ 'Article.count' => 1, 'Notification.count' => 2 }) do # post :create, params: { article: {...} } # end # - # A lambda or a list of lambdas can be passed in and evaluated: + # A lambda, a list of lambdas or a hash of lambdas/numeric differences can be passed in and evaluated: # # assert_difference ->{ Article.count }, 2 do # post :create, params: { article: {...} } @@ -10586,13 +13610,17 @@ module ActiveSupport::Testing::Assertions # post :create, params: { article: {...} } # end # + # assert_difference ->{ Article.count } => 1, ->{ Notification.count } => 2 do + # post :create, params: { article: {...} } + # end + # # An error message can be specified. # # assert_difference 'Article.count', -1, 'An Article should be destroyed' do # post :delete, params: { id: ... } # end # - # source://activesupport//lib/active_support/testing/assertions.rb#86 + # source://activesupport//lib/active_support/testing/assertions.rb#105 def assert_difference(expression, *args, &block); end # Assertion that the result of evaluating an expression is not changed before @@ -10602,20 +13630,32 @@ module ActiveSupport::Testing::Assertions # post :create, params: { status: { ok: true } } # end # - # Provide the optional keyword argument :from to specify the expected - # initial value. + # Provide the optional keyword argument +:from+ to specify the expected + # initial value. The comparison is done using case equality (===), which means + # you can specify patterns or classes: # + # # Exact value match # assert_no_changes -> { Status.all_good? }, from: true do # post :create, params: { status: { ok: true } } # end # + # # Case equality + # assert_no_changes -> { user.token }, from: /\w{32}/ do + # user.touch + # end + # + # # Type check + # assert_no_changes -> { current_error }, from: RuntimeError do + # retry_operation + # end + # # An error message can be specified. # # assert_no_changes -> { Status.all_good? }, 'Expected the status to be good' do # post :create, params: { status: { ok: false } } # end # - # source://activesupport//lib/active_support/testing/assertions.rb#222 + # source://activesupport//lib/active_support/testing/assertions.rb#281 def assert_no_changes(expression, message = T.unsafe(nil), from: T.unsafe(nil), &block); end # Assertion that the numeric result of evaluating an expression is not @@ -10643,12 +13683,12 @@ module ActiveSupport::Testing::Assertions # post :create, params: { article: invalid_attributes } # end # - # source://activesupport//lib/active_support/testing/assertions.rb#137 + # source://activesupport//lib/active_support/testing/assertions.rb#162 def assert_no_difference(expression, message = T.unsafe(nil), &block); end - # Asserts that an expression is not truthy. Passes if object is - # +nil+ or +false+. "Truthy" means "considered true in a conditional" - # like if foo. + # Asserts that an expression is not truthy. Passes if +object+ is +nil+ or + # +false+. "Truthy" means "considered true in a conditional" like if + # foo. # # assert_not nil # => true # assert_not false # => true @@ -10669,13 +13709,38 @@ module ActiveSupport::Testing::Assertions # perform_service(param: 'no_exception') # end # - # source://activesupport//lib/active_support/testing/assertions.rb#33 + # source://activesupport//lib/active_support/testing/assertions.rb#48 def assert_nothing_raised; end + # Asserts that a block raises one of +exp+. This is an enhancement of the + # standard Minitest assertion method with the ability to test error + # messages. + # + # assert_raises(ArgumentError, match: /incorrect param/i) do + # perform_service(param: 'exception') + # end + # + # source://activesupport//lib/active_support/testing/assertions.rb#39 + def assert_raise(*exp, match: T.unsafe(nil), &block); end + + # Asserts that a block raises one of +exp+. This is an enhancement of the + # standard Minitest assertion method with the ability to test error + # messages. + # + # assert_raises(ArgumentError, match: /incorrect param/i) do + # perform_service(param: 'exception') + # end + # + # source://activesupport//lib/active_support/testing/assertions.rb#34 + def assert_raises(*exp, match: T.unsafe(nil), &block); end + private - # source://activesupport//lib/active_support/testing/assertions.rb#249 + # source://activesupport//lib/active_support/testing/assertions.rb#316 def _assert_nothing_raised_or_warn(assertion, &block); end + + # source://activesupport//lib/active_support/testing/assertions.rb#331 + def _callable_to_source_string(callable); end end # source://activesupport//lib/active_support/testing/assertions.rb#8 @@ -10710,92 +13775,415 @@ ActiveSupport::Testing::Assertions::UNTRACKED = T.let(T.unsafe(nil), Object) module ActiveSupport::Testing::ConstantLookup extend ::ActiveSupport::Concern - mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods -end + mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods +end + +# source://activesupport//lib/active_support/testing/constant_lookup.rb#35 +module ActiveSupport::Testing::ConstantLookup::ClassMethods + # source://activesupport//lib/active_support/testing/constant_lookup.rb#36 + def determine_constant_from_test_name(test_name); end +end + +# source://activesupport//lib/active_support/testing/constant_stubbing.rb#5 +module ActiveSupport::Testing::ConstantStubbing + # Changes the value of a constant for the duration of a block. Example: + # + # # World::List::Import::LARGE_IMPORT_THRESHOLD = 5000 + # stub_const(World::List::Import, :LARGE_IMPORT_THRESHOLD, 1) do + # assert_equal 1, World::List::Import::LARGE_IMPORT_THRESHOLD + # end + # + # assert_equal 5000, World::List::Import::LARGE_IMPORT_THRESHOLD + # + # Using this method rather than forcing World::List::Import::LARGE_IMPORT_THRESHOLD = 5000 prevents + # warnings from being thrown, and ensures that the old value is returned after the test has completed. + # + # If the constant doesn't already exists, but you need it set for the duration of the block + # you can do so by passing `exists: false`. + # + # stub_const(object, :SOME_CONST, 1, exists: false) do + # assert_equal 1, SOME_CONST + # end + # + # Note: Stubbing a const will stub it across all threads. So if you have concurrent threads + # (like separate test suites running in parallel) that all depend on the same constant, it's possible + # divergent stubbing will trample on each other. + # + # source://activesupport//lib/active_support/testing/constant_stubbing.rb#28 + def stub_const(mod, constant, new_value, exists: T.unsafe(nil)); end +end + +# source://activesupport//lib/active_support/testing/declarative.rb#5 +module ActiveSupport::Testing::Declarative + # Helper to define a test method using a String. Under the hood, it replaces + # spaces with underscores and defines the test method. + # + # test "verify something" do + # ... + # end + # + # source://activesupport//lib/active_support/testing/declarative.rb#13 + def test(name, &block); end +end + +# source://activesupport//lib/active_support/testing/deprecation.rb#7 +module ActiveSupport::Testing::Deprecation + # :call-seq: + # assert_deprecated(deprecator, &block) + # assert_deprecated(match, deprecator, &block) + # + # Asserts that a matching deprecation warning was emitted by the given deprecator during the execution of the yielded block. + # + # assert_deprecated(/foo/, CustomDeprecator) do + # CustomDeprecator.warn "foo should no longer be used" + # end + # + # The +match+ object may be a +Regexp+, or +String+ appearing in the message. + # + # assert_deprecated('foo', CustomDeprecator) do + # CustomDeprecator.warn "foo should no longer be used" + # end + # + # If the +match+ is omitted (or explicitly +nil+), any deprecation warning will match. + # + # assert_deprecated(CustomDeprecator) do + # CustomDeprecator.warn "foo should no longer be used" + # end + # + # source://activesupport//lib/active_support/testing/deprecation.rb#30 + def assert_deprecated(match = T.unsafe(nil), deprecator = T.unsafe(nil), &block); end + + # Asserts that no deprecation warnings are emitted by the given deprecator during the execution of the yielded block. + # + # assert_not_deprecated(CustomDeprecator) do + # CustomDeprecator.warn "message" # fails assertion + # end + # + # assert_not_deprecated(ActiveSupport::Deprecation.new) do + # CustomDeprecator.warn "message" # passes assertion, different deprecator + # end + # + # source://activesupport//lib/active_support/testing/deprecation.rb#55 + def assert_not_deprecated(deprecator, &block); end + + # Returns the return value of the block and an array of all the deprecation warnings emitted by the given + # +deprecator+ during the execution of the yielded block. + # + # collect_deprecations(CustomDeprecator) do + # CustomDeprecator.warn "message" + # ActiveSupport::Deprecation.new.warn "other message" + # :result + # end # => [:result, ["message"]] + # + # source://activesupport//lib/active_support/testing/deprecation.rb#69 + def collect_deprecations(deprecator); end +end + +# source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#5 +module ActiveSupport::Testing::ErrorReporterAssertions + # Assertion that the block should cause at least one exception to be reported + # to +Rails.error+. + # + # Passes if the evaluated code in the yielded block reports a matching exception. + # + # assert_error_reported(IOError) do + # Rails.error.report(IOError.new("Oops")) + # end + # + # To test further details about the reported exception, you can use the return + # value. + # + # report = assert_error_reported(IOError) do + # # ... + # end + # assert_equal "Oops", report.error.message + # assert_equal "admin", report.context[:section] + # assert_equal :warning, report.severity + # assert_predicate report, :handled? + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#88 + def assert_error_reported(error_class = T.unsafe(nil), &block); end + + # Assertion that the block should not cause an exception to be reported + # to +Rails.error+. + # + # Passes if evaluated code in the yielded block reports no exception. + # + # assert_no_error_reported do + # perform_service(param: 'no_exception') + # end + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#62 + def assert_no_error_reported(&block); end + + # Captures reported errors from within the block that match the given + # error class. + # + # reports = capture_error_reports(IOError) do + # Rails.error.report(IOError.new("Oops")) + # Rails.error.report(IOError.new("Oh no")) + # Rails.error.report(StandardError.new) + # end + # + # assert_equal 2, reports.size + # assert_equal "Oops", reports.first.error.message + # assert_equal "Oh no", reports.last.error.message + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#118 + def capture_error_reports(error_class = T.unsafe(nil), &block); end +end + +# source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#6 +module ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector + class << self + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#16 + def record; end + + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#29 + def report(error, **kwargs); end + + private + + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#38 + def subscribe; end + end +end + +# source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 +class ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector::Report < ::Struct + # Returns the value of attribute context + # + # @return [Object] the current value of context + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def context; end + + # Sets the attribute context + # + # @param value [Object] the value to set the attribute context to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def context=(_); end + + # Returns the value of attribute error + # + # @return [Object] the current value of error + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def error; end + + # Sets the attribute error + # + # @param value [Object] the value to set the attribute error to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def error=(_); end + + # Returns the value of attribute handled + # + # @return [Object] the current value of handled + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def handled; end + + # Sets the attribute handled + # + # @param value [Object] the value to set the attribute handled to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def handled=(_); end + + # Returns the value of attribute handled + # + # @return [Object] the current value of handled + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#12 + def handled?; end -# source://activesupport//lib/active_support/testing/constant_lookup.rb#35 -module ActiveSupport::Testing::ConstantLookup::ClassMethods - # source://activesupport//lib/active_support/testing/constant_lookup.rb#36 - def determine_constant_from_test_name(test_name); end -end + # Returns the value of attribute severity + # + # @return [Object] the current value of severity + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def severity; end -# source://activesupport//lib/active_support/testing/declarative.rb#5 -module ActiveSupport::Testing::Declarative - # Helper to define a test method using a String. Under the hood, it replaces - # spaces with underscores and defines the test method. + # Sets the attribute severity # - # test "verify something" do - # ... - # end + # @param value [Object] the value to set the attribute severity to. + # @return [Object] the newly set value # - # source://activesupport//lib/active_support/testing/declarative.rb#13 - def test(name, &block); end + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def severity=(_); end + + # Returns the value of attribute source + # + # @return [Object] the current value of source + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def source; end + + # Sets the attribute source + # + # @param value [Object] the value to set the attribute source to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def source=(_); end + + class << self + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def [](*_arg0); end + + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def inspect; end + + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def keyword_init?; end + + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def members; end + + # source://activesupport//lib/active_support/testing/error_reporter_assertions.rb#10 + def new(*_arg0); end + end end -# source://activesupport//lib/active_support/testing/deprecation.rb#7 -module ActiveSupport::Testing::Deprecation - # Asserts that a matching deprecation warning was emitted by the given deprecator during the execution of the yielded block. +# Provides test helpers for asserting on ActiveSupport::EventReporter events. +# +# source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#6 +module ActiveSupport::Testing::EventReporterAssertions + # Asserts that the block causes an event with the given name to be reported + # to +Rails.event+. # - # assert_deprecated(/foo/, CustomDeprecator) do - # CustomDeprecator.warn "foo should no longer be used" + # Passes if the evaluated code in the yielded block reports a matching event. + # + # assert_event_reported("user.created") do + # Rails.event.notify("user.created", { id: 123 }) # end # - # The +match+ object may be a +Regexp+, or +String+ appearing in the message. + # To test further details about the reported event, you can specify payload and tag matchers. # - # assert_deprecated('foo', CustomDeprecator) do - # CustomDeprecator.warn "foo should no longer be used" + # assert_event_reported("user.created", + # payload: { id: 123, name: "John Doe" }, + # tags: { request_id: /[0-9]+/ } + # ) do + # Rails.event.tagged(request_id: "123") do + # Rails.event.notify("user.created", { id: 123, name: "John Doe" }) + # end # end # - # If the +match+ is omitted (or explicitly +nil+), any deprecation warning will match. + # The matchers support partial matching - only the specified keys need to match. # - # assert_deprecated(nil, CustomDeprecator) do - # CustomDeprecator.warn "foo should no longer be used" + # assert_event_reported("user.created", payload: { id: 123 }) do + # Rails.event.notify("user.created", { id: 123, name: "John Doe" }) # end # - # If no +deprecator+ is given, defaults to ActiveSupport::Deprecation. + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#142 + def assert_event_reported(name, payload: T.unsafe(nil), tags: T.unsafe(nil), &block); end + + # Asserts that the provided events were reported, regardless of order. # - # assert_deprecated do - # ActiveSupport::Deprecation.warn "foo should no longer be used" + # assert_events_reported([ + # { name: "user.created", payload: { id: 123 } }, + # { name: "email.sent", payload: { to: "user@example.com" } } + # ]) do + # create_user_and_send_welcome_email # end # - # source://activesupport//lib/active_support/testing/deprecation.rb#31 - def assert_deprecated(match = T.unsafe(nil), deprecator = T.unsafe(nil), &block); end + # Supports the same payload and tag matching as +assert_event_reported+. + # + # assert_events_reported([ + # { + # name: "process.started", + # payload: { id: 123 }, + # tags: { request_id: /[0-9]+/ } + # }, + # { name: "process.completed" } + # ]) do + # Rails.event.tagged(request_id: "456") do + # start_and_complete_process(123) + # end + # end + # + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#184 + def assert_events_reported(expected_events, &block); end - # Asserts that no deprecation warnings are emitted by the given deprecator during the execution of the yielded block. + # Asserts that the block does not cause an event to be reported to +Rails.event+. # - # assert_not_deprecated(CustomDeprecator) do - # CustomDeprecator.warn "message" # fails assertion + # If no name is provided, passes if evaluated code in the yielded block reports no events. + # + # assert_no_event_reported do + # service_that_does_not_report_events.perform # end # - # If no +deprecator+ is given, defaults to ActiveSupport::Deprecation. + # If a name is provided, passes if evaluated code in the yielded block reports no events + # with that name. # - # assert_not_deprecated do - # ActiveSupport::Deprecation.warn "message" # fails assertion + # assert_no_event_reported("user.created") do + # service_that_does_not_report_events.perform # end # - # assert_not_deprecated do - # CustomDeprecator.warn "message" # passes assertion + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#101 + def assert_no_event_reported(name = T.unsafe(nil), payload: T.unsafe(nil), tags: T.unsafe(nil), &block); end + + # Allows debug events to be reported to +Rails.event+ for the duration of a given block. + # + # with_debug_event_reporting do + # service_that_reports_debug_events.perform # end # - # source://activesupport//lib/active_support/testing/deprecation.rb#56 - def assert_not_deprecated(deprecator = T.unsafe(nil), &block); end + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#222 + def with_debug_event_reporting(&block); end +end - # Returns an array of all the deprecation warnings emitted by the given - # +deprecator+ during the execution of the yielded block. +# source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#7 +module ActiveSupport::Testing::EventReporterAssertions::EventCollector + class << self + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#46 + def emit(event); end + + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#53 + def record; end + + private + + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#81 + def event_recorders; end + + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#66 + def subscribe; end + end +end + +# source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#11 +class ActiveSupport::Testing::EventReporterAssertions::EventCollector::Event + # @return [Event] a new instance of Event # - # collect_deprecations(CustomDeprecator) do - # CustomDeprecator.warn "message" - # end # => ["message"] + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#14 + def initialize(event_data); end + + # Returns the value of attribute event_data. # - # If no +deprecator+ is given, defaults to ActiveSupport::Deprecation. + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#12 + def event_data; end + + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#18 + def inspect; end + + # @return [Boolean] # - # collect_deprecations do - # CustomDeprecator.warn "custom message" - # ActiveSupport::Deprecation.warn "message" - # end # => ["message"] + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#22 + def matches?(name, payload, tags); end + + private + + # @return [Boolean] # - # source://activesupport//lib/active_support/testing/deprecation.rb#75 - def collect_deprecations(deprecator = T.unsafe(nil)); end + # source://activesupport//lib/active_support/testing/event_reporter_assertions.rb#34 + def matches_hash?(expected_hash, event_key); end end # Adds simple access to sample files called file fixtures. @@ -10834,118 +14222,238 @@ module ActiveSupport::Testing::FileFixtures end end -# source://activesupport//lib/active_support/testing/isolation.rb#5 +# source://activesupport//lib/active_support/testing/isolation.rb#7 module ActiveSupport::Testing::Isolation include ::ActiveSupport::Testing::Isolation::Forking - # source://activesupport//lib/active_support/testing/isolation.rb#18 + # source://activesupport//lib/active_support/testing/isolation.rb#20 def run; end class << self # @return [Boolean] # - # source://activesupport//lib/active_support/testing/isolation.rb#14 + # source://activesupport//lib/active_support/testing/isolation.rb#16 def forking_env?; end - # source://activesupport//lib/active_support/testing/isolation.rb#8 + # source://activesupport//lib/active_support/testing/isolation.rb#10 def included(klass); end end end -# source://activesupport//lib/active_support/testing/isolation.rb#26 +# source://activesupport//lib/active_support/testing/isolation.rb#35 module ActiveSupport::Testing::Isolation::Forking - # source://activesupport//lib/active_support/testing/isolation.rb#27 + # source://activesupport//lib/active_support/testing/isolation.rb#36 def run_in_isolation(&blk); end end -# source://activesupport//lib/active_support/testing/isolation.rb#63 +# source://activesupport//lib/active_support/testing/isolation.rb#73 module ActiveSupport::Testing::Isolation::Subprocess - # Complicated H4X to get this working in windows / jruby with + # Complicated H4X to get this working in Windows / JRuby with # no forking. # - # source://activesupport//lib/active_support/testing/isolation.rb#68 + # source://activesupport//lib/active_support/testing/isolation.rb#78 def run_in_isolation(&blk); end end -# source://activesupport//lib/active_support/testing/isolation.rb#64 +# source://activesupport//lib/active_support/testing/isolation.rb#74 ActiveSupport::Testing::Isolation::Subprocess::ORIG_ARGV = T.let(T.unsafe(nil), Array) +# source://activesupport//lib/active_support/testing/isolation.rb#8 +class ActiveSupport::Testing::Isolation::SubprocessCrashed < ::StandardError; end + +# source://activesupport//lib/active_support/testing/notification_assertions.rb#5 +module ActiveSupport::Testing::NotificationAssertions + # Assert no notifications were emitted for a given +pattern+. + # + # You can assert no notifications were emitted by passing a pattern, which accepts + # either a string or regexp, and a block. While the block is executed, if no + # matching notifications are emitted, the assertion will pass. + # + # assert_no_notifications("post.submitted") do + # post.destroy # => emits non-matching notification + # end + # + # source://activesupport//lib/active_support/testing/notification_assertions.rb#66 + def assert_no_notifications(pattern = T.unsafe(nil), &block); end + + # Assert a notification was emitted with a given +pattern+ and optional +payload+. + # + # You can assert that a notification was emitted by passing a pattern, which accepts + # either a string or regexp, an optional payload, and a block. While the block + # is executed, if a matching notification is emitted, the assertion will pass + # and the notification will be returned. + # + # Note that the payload is matched as a subset, meaning that the notification must + # contain at least the specified keys and values, but may contain additional ones. + # + # assert_notification("post.submitted", title: "Cool Post") do + # post.submit(title: "Cool Post", body: "Cool Body") # => emits matching notification + # end + # + # Using the returned notification, you can make more customized assertions. + # + # notification = assert_notification("post.submitted", title: "Cool Post") do + # ActiveSupport::Notifications.instrument("post.submitted", title: "Cool Post", body: Body.new("Cool Body")) + # end + # + # assert_instance_of(Body, notification.payload[:body]) + # + # source://activesupport//lib/active_support/testing/notification_assertions.rb#28 + def assert_notification(pattern, payload = T.unsafe(nil), &block); end + + # Assert the number of notifications emitted with a given +pattern+. + # + # You can assert the number of notifications emitted by passing a pattern, which accepts + # either a string or regexp, a count, and a block. While the block is executed, + # the number of matching notifications emitted will be counted. After the block's + # execution completes, the assertion will pass if the count matches. + # + # assert_notifications_count("post.submitted", 1) do + # post.submit(title: "Cool Post") # => emits matching notification + # end + # + # source://activesupport//lib/active_support/testing/notification_assertions.rb#51 + def assert_notifications_count(pattern, count, &block); end + + # Capture emitted notifications, optionally filtered by a +pattern+. + # + # You can capture emitted notifications, optionally filtered by a pattern, + # which accepts either a string or regexp, and a block. + # + # notifications = capture_notifications("post.submitted") do + # post.submit(title: "Cool Post") # => emits matching notification + # end + # + # source://activesupport//lib/active_support/testing/notification_assertions.rb#85 + def capture_notifications(pattern = T.unsafe(nil), &block); end +end + # source://activesupport//lib/active_support/testing/parallelization/server.rb#8 class ActiveSupport::Testing::Parallelization # @return [Parallelization] a new instance of Parallelization # - # source://activesupport//lib/active_support/testing/parallelization.rb#28 + # source://activesupport//lib/active_support/testing/parallelization.rb#36 def initialize(worker_count); end - # source://activesupport//lib/active_support/testing/parallelization.rb#41 + # source://activesupport//lib/active_support/testing/parallelization.rb#54 def <<(work); end - # source://activesupport//lib/active_support/testing/parallelization.rb#18 + # source://activesupport//lib/active_support/testing/parallelization.rb#26 def after_fork_hooks; end - # source://activesupport//lib/active_support/testing/parallelization.rb#26 + # source://activesupport//lib/active_support/testing/parallelization.rb#43 + def before_fork; end + + # source://activesupport//lib/active_support/testing/parallelization.rb#18 + def before_fork_hooks; end + + # source://activesupport//lib/active_support/testing/parallelization.rb#34 def run_cleanup_hooks; end - # source://activesupport//lib/active_support/testing/parallelization.rb#49 + # source://activesupport//lib/active_support/testing/parallelization.rb#62 def shutdown; end - # source://activesupport//lib/active_support/testing/parallelization.rb#45 + # source://activesupport//lib/active_support/testing/parallelization.rb#58 def size; end - # source://activesupport//lib/active_support/testing/parallelization.rb#35 + # source://activesupport//lib/active_support/testing/parallelization.rb#47 def start; end class << self - # source://activesupport//lib/active_support/testing/parallelization.rb#14 + # source://activesupport//lib/active_support/testing/parallelization.rb#22 def after_fork_hook(&blk); end - # source://activesupport//lib/active_support/testing/parallelization.rb#18 + # source://activesupport//lib/active_support/testing/parallelization.rb#26 def after_fork_hooks; end - # source://activesupport//lib/active_support/testing/parallelization.rb#22 + # source://activesupport//lib/active_support/testing/parallelization.rb#14 + def before_fork_hook(&blk); end + + # source://activesupport//lib/active_support/testing/parallelization.rb#18 + def before_fork_hooks; end + + # source://activesupport//lib/active_support/testing/parallelization.rb#30 def run_cleanup_hook(&blk); end - # source://activesupport//lib/active_support/testing/parallelization.rb#26 + # source://activesupport//lib/active_support/testing/parallelization.rb#34 def run_cleanup_hooks; end end end # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 +class ActiveSupport::Testing::Parallelization::PrerecordResultClass < ::Struct + # Returns the value of attribute name + # + # @return [Object] the current value of name + # + # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 + def name; end + + # Sets the attribute name + # + # @param value [Object] the value to set the attribute name to. + # @return [Object] the newly set value + # + # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 + def name=(_); end + + class << self + # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 + def [](*_arg0); end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 + def inspect; end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 + def keyword_init?; end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 + def members; end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#9 + def new(*_arg0); end + end +end + +# source://activesupport//lib/active_support/testing/parallelization/server.rb#11 class ActiveSupport::Testing::Parallelization::Server include ::DRb::DRbUndumped # @return [Server] a new instance of Server # - # source://activesupport//lib/active_support/testing/parallelization/server.rb#12 + # source://activesupport//lib/active_support/testing/parallelization/server.rb#14 def initialize; end - # source://activesupport//lib/active_support/testing/parallelization/server.rb#28 + # source://activesupport//lib/active_support/testing/parallelization/server.rb#32 def <<(o); end # @return [Boolean] # - # source://activesupport//lib/active_support/testing/parallelization/server.rb#48 + # source://activesupport//lib/active_support/testing/parallelization/server.rb#64 def active_workers?; end - # source://activesupport//lib/active_support/testing/parallelization/server.rb#52 + # source://activesupport//lib/active_support/testing/parallelization/server.rb#68 def interrupt; end - # source://activesupport//lib/active_support/testing/parallelization/server.rb#33 + # source://activesupport//lib/active_support/testing/parallelization/server.rb#37 def pop; end # @raise [DRb::DRbConnError] # - # source://activesupport//lib/active_support/testing/parallelization/server.rb#18 + # source://activesupport//lib/active_support/testing/parallelization/server.rb#21 def record(reporter, result); end - # source://activesupport//lib/active_support/testing/parallelization/server.rb#56 - def shutdown; end + # source://activesupport//lib/active_support/testing/parallelization/server.rb#54 + def remove_dead_workers(dead_pids); end - # source://activesupport//lib/active_support/testing/parallelization/server.rb#40 - def start_worker(worker_id); end + # source://activesupport//lib/active_support/testing/parallelization/server.rb#72 + def shutdown; end # source://activesupport//lib/active_support/testing/parallelization/server.rb#44 - def stop_worker(worker_id); end + def start_worker(worker_id, worker_pid); end + + # source://activesupport//lib/active_support/testing/parallelization/server.rb#49 + def stop_worker(worker_id, worker_pid); end end # source://activesupport//lib/active_support/testing/parallelization/worker.rb#6 @@ -10955,16 +14463,16 @@ class ActiveSupport::Testing::Parallelization::Worker # source://activesupport//lib/active_support/testing/parallelization/worker.rb#7 def initialize(number, url); end - # source://activesupport//lib/active_support/testing/parallelization/worker.rb#80 + # source://activesupport//lib/active_support/testing/parallelization/worker.rb#82 def after_fork; end # source://activesupport//lib/active_support/testing/parallelization/worker.rb#42 def perform_job(job); end - # source://activesupport//lib/active_support/testing/parallelization/worker.rb#86 + # source://activesupport//lib/active_support/testing/parallelization/worker.rb#90 def run_cleanup; end - # source://activesupport//lib/active_support/testing/parallelization/worker.rb#56 + # source://activesupport//lib/active_support/testing/parallelization/worker.rb#58 def safe_record(reporter, result); end # source://activesupport//lib/active_support/testing/parallelization/worker.rb#14 @@ -10975,10 +14483,10 @@ class ActiveSupport::Testing::Parallelization::Worker private - # source://activesupport//lib/active_support/testing/parallelization/worker.rb#93 + # source://activesupport//lib/active_support/testing/parallelization/worker.rb#97 def add_setup_exception(result); end - # source://activesupport//lib/active_support/testing/parallelization/worker.rb#97 + # source://activesupport//lib/active_support/testing/parallelization/worker.rb#101 def set_process_title(status); end end @@ -10989,7 +14497,7 @@ class ActiveSupport::Testing::ParallelizeExecutor # source://activesupport//lib/active_support/testing/parallelize_executor.rb#8 def initialize(size:, with:, threshold: T.unsafe(nil)); end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#21 + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#22 def <<(work); end # Returns the value of attribute parallelize_with. @@ -10997,7 +14505,7 @@ class ActiveSupport::Testing::ParallelizeExecutor # source://activesupport//lib/active_support/testing/parallelize_executor.rb#6 def parallelize_with; end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#25 + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#26 def shutdown; end # Returns the value of attribute size. @@ -11005,7 +14513,7 @@ class ActiveSupport::Testing::ParallelizeExecutor # source://activesupport//lib/active_support/testing/parallelize_executor.rb#6 def size; end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#14 + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#15 def start; end # Returns the value of attribute threshold. @@ -11015,32 +14523,37 @@ class ActiveSupport::Testing::ParallelizeExecutor private - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#34 + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#35 def build_parallel_executor; end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#67 + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#72 def execution_info; end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#30 + # @return [Boolean] + # + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#60 + def many_workers?; end + + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#31 def parallel_executor; end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#46 + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#47 def parallelize; end # @return [Boolean] # - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#51 + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#52 def parallelized?; end # @return [Boolean] # - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#55 + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#56 def should_parallelize?; end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#63 + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#68 def show_execution_info; end - # source://activesupport//lib/active_support/testing/parallelize_executor.rb#59 + # source://activesupport//lib/active_support/testing/parallelize_executor.rb#64 def tests_count; end end @@ -11087,11 +14600,11 @@ end # Manages stubs for TimeHelpers # -# source://activesupport//lib/active_support/testing/time_helpers.rb#10 +# source://activesupport//lib/active_support/testing/time_helpers.rb#9 class ActiveSupport::Testing::SimpleStubs # @return [SimpleStubs] a new instance of SimpleStubs # - # source://activesupport//lib/active_support/testing/time_helpers.rb#13 + # source://activesupport//lib/active_support/testing/time_helpers.rb#12 def initialize; end # Stubs object.method_name with the given block @@ -11102,40 +14615,42 @@ class ActiveSupport::Testing::SimpleStubs # simple_stubs.stub_object(Time, :now) { at(target.to_i) } # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 # - # source://activesupport//lib/active_support/testing/time_helpers.rb#24 + # source://activesupport//lib/active_support/testing/time_helpers.rb#23 def stub_object(object, method_name, &block); end # Returns true if any stubs are set, false if there are none # # @return [Boolean] # - # source://activesupport//lib/active_support/testing/time_helpers.rb#54 + # source://activesupport//lib/active_support/testing/time_helpers.rb#53 def stubbed?; end # Returns the Stub for object#method_name # (nil if it is not stubbed) # - # source://activesupport//lib/active_support/testing/time_helpers.rb#49 + # source://activesupport//lib/active_support/testing/time_helpers.rb#48 def stubbing(object, method_name); end # Remove all object-method stubs held by this instance # - # source://activesupport//lib/active_support/testing/time_helpers.rb#38 + # source://activesupport//lib/active_support/testing/time_helpers.rb#37 def unstub_all!; end private # Restores the original object.method described by the Stub # - # source://activesupport//lib/active_support/testing/time_helpers.rb#60 + # source://activesupport//lib/active_support/testing/time_helpers.rb#59 def unstub_object(stub); end end -# source://activesupport//lib/active_support/testing/time_helpers.rb#11 +# source://activesupport//lib/active_support/testing/time_helpers.rb#10 class ActiveSupport::Testing::SimpleStubs::Stub < ::Struct # Returns the value of attribute method_name # # @return [Object] the current value of method_name + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 def method_name; end # Sets the attribute method_name @@ -11143,12 +14658,14 @@ class ActiveSupport::Testing::SimpleStubs::Stub < ::Struct # @param value [Object] the value to set the attribute method_name to. # @return [Object] the newly set value # - # source://activesupport//lib/active_support/testing/time_helpers.rb#11 + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 def method_name=(_); end # Returns the value of attribute object # # @return [Object] the current value of object + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 def object; end # Sets the attribute object @@ -11156,12 +14673,14 @@ class ActiveSupport::Testing::SimpleStubs::Stub < ::Struct # @param value [Object] the value to set the attribute object to. # @return [Object] the newly set value # - # source://activesupport//lib/active_support/testing/time_helpers.rb#11 + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 def object=(_); end # Returns the value of attribute original_method # # @return [Object] the current value of original_method + # + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 def original_method; end # Sets the attribute original_method @@ -11169,13 +14688,23 @@ class ActiveSupport::Testing::SimpleStubs::Stub < ::Struct # @param value [Object] the value to set the attribute original_method to. # @return [Object] the newly set value # - # source://activesupport//lib/active_support/testing/time_helpers.rb#11 + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 def original_method=(_); end class << self + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 def [](*_arg0); end + + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 def inspect; end + + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 + def keyword_init?; end + + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 def members; end + + # source://activesupport//lib/active_support/testing/time_helpers.rb#10 def new(*_arg0); end end end @@ -11197,19 +14726,33 @@ module ActiveSupport::Testing::TaggedLogging def tagged_logger; end end +# Warns when a test case does not perform any assertions. +# +# This is helpful in detecting broken tests that do not perform intended assertions. +# +# source://activesupport//lib/active_support/testing/tests_without_assertions.rb#8 +module ActiveSupport::Testing::TestsWithoutAssertions + # source://activesupport//lib/active_support/testing/tests_without_assertions.rb#9 + def after_teardown; end +end + # Contains helpers that help you test passage of time. # -# source://activesupport//lib/active_support/testing/time_helpers.rb#69 +# source://activesupport//lib/active_support/testing/time_helpers.rb#68 module ActiveSupport::Testing::TimeHelpers - # source://activesupport//lib/active_support/testing/time_helpers.rb#70 + # source://activesupport//lib/active_support/testing/time_helpers.rb#69 def after_teardown; end - # Calls +travel_to+ with +Time.now+. + # Calls +travel_to+ with +date_or_time+, which defaults to +Time.now+. + # Forwards optional with_usec argument. # # Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00 # freeze_time # sleep(1) # Time.current # => Sun, 09 Jul 2017 15:34:49 EST -05:00 + # freeze_time Time.current + 1.day + # sleep(1) + # Time.current # => Mon, 10 Jul 2017 15:34:49 EST -05:00 # # This method also accepts a block, which will return the current time back to its original # state at the end of the block: @@ -11221,13 +14764,18 @@ module ActiveSupport::Testing::TimeHelpers # end # Time.current # => Sun, 09 Jul 2017 15:34:50 EST -05:00 # - # source://activesupport//lib/active_support/testing/time_helpers.rb#234 - def freeze_time(&block); end + # source://activesupport//lib/active_support/testing/time_helpers.rb#261 + def freeze_time(date_or_time = T.unsafe(nil), with_usec: T.unsafe(nil), &block); end # Changes current time to the time in the future or in the past by a given time difference by # stubbing +Time.now+, +Date.today+, and +DateTime.now+. The stubs are automatically removed # at the end of the test. # + # Note that the usec for the resulting time will be set to 0 to prevent rounding + # errors with external services, like MySQL (which will round instead of floor, + # leading to off-by-one-second errors), unless the with_usec argument + # is set to true. + # # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 # travel 1.day # Time.current # => Sun, 10 Nov 2013 15:34:49 EST -05:00 @@ -11243,8 +14791,8 @@ module ActiveSupport::Testing::TimeHelpers # end # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 # - # source://activesupport//lib/active_support/testing/time_helpers.rb#93 - def travel(duration, &block); end + # source://activesupport//lib/active_support/testing/time_helpers.rb#97 + def travel(duration, with_usec: T.unsafe(nil), &block); end # Returns the current time back to its original state, by removing the stubs added by # +travel+, +travel_to+, and +freeze_time+. @@ -11270,10 +14818,10 @@ module ActiveSupport::Testing::TimeHelpers # # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 # - # source://activesupport//lib/active_support/testing/time_helpers.rb#208 + # source://activesupport//lib/active_support/testing/time_helpers.rb#231 def travel_back; end - # Changes current time to the given time by stubbing +Time.now+, + # Changes current time to the given time by stubbing +Time.now+, +Time.new+, # +Date.today+, and +DateTime.now+ to return the time or date passed into this method. # The stubs are automatically removed at the end of the test. # @@ -11294,7 +14842,8 @@ module ActiveSupport::Testing::TimeHelpers # # Note that the usec for the time passed will be set to 0 to prevent rounding # errors with external services, like MySQL (which will round instead of floor, - # leading to off-by-one-second errors). + # leading to off-by-one-second errors), unless the with_usec argument + # is set to true. # # This method also accepts a block, which will return the current time back to its original # state at the end of the block: @@ -11305,8 +14854,8 @@ module ActiveSupport::Testing::TimeHelpers # end # Time.current # => Sat, 09 Nov 2013 15:34:49 EST -05:00 # - # source://activesupport//lib/active_support/testing/time_helpers.rb#128 - def travel_to(date_or_time); end + # source://activesupport//lib/active_support/testing/time_helpers.rb#133 + def travel_to(date_or_time, with_usec: T.unsafe(nil)); end # Returns the current time back to its original state, by removing the stubs added by # +travel+, +travel_to+, and +freeze_time+. @@ -11332,27 +14881,29 @@ module ActiveSupport::Testing::TimeHelpers # # Time.current # => Wed, 24 Nov 2004 01:04:44 EST -05:00 # - # source://activesupport//lib/active_support/testing/time_helpers.rb#208 + # source://activesupport//lib/active_support/testing/time_helpers.rb#239 def unfreeze_time; end private # Returns the value of attribute in_block. # - # source://activesupport//lib/active_support/testing/time_helpers.rb#243 + # source://activesupport//lib/active_support/testing/time_helpers.rb#270 def in_block; end # Sets the attribute in_block # # @param value the value to set the attribute in_block to. # - # source://activesupport//lib/active_support/testing/time_helpers.rb#243 + # source://activesupport//lib/active_support/testing/time_helpers.rb#270 def in_block=(_arg0); end - # source://activesupport//lib/active_support/testing/time_helpers.rb#239 + # source://activesupport//lib/active_support/testing/time_helpers.rb#266 def simple_stubs; end end +# = Active Support \Time With Zone +# # A Time-like class that can represent a time in any time zone. Necessary # because standard Ruby Time instances are limited to UTC and the # system's ENV['TZ'] zone. @@ -11385,14 +14936,14 @@ end # t.is_a?(Time) # => true # t.is_a?(ActiveSupport::TimeWithZone) # => true # -# source://activesupport//lib/active_support/time_with_zone.rb#42 +# source://activesupport//lib/active_support/time_with_zone.rb#44 class ActiveSupport::TimeWithZone include ::DateAndTime::Compatibility include ::Comparable # @return [TimeWithZone] a new instance of TimeWithZone # - # source://activesupport//lib/active_support/time_with_zone.rb#61 + # source://activesupport//lib/active_support/time_with_zone.rb#51 def initialize(utc_time, time_zone, local_time = T.unsafe(nil), period = T.unsafe(nil)); end # Adds an interval of time to the current object's time and returns that @@ -11412,7 +14963,7 @@ class ActiveSupport::TimeWithZone # now + 24.hours # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 # now + 1.day # => Mon, 03 Nov 2014 01:26:28.725182881 EST -05:00 # - # source://activesupport//lib/active_support/time_with_zone.rb#328 + # source://activesupport//lib/active_support/time_with_zone.rb#314 def +(other); end # Subtracts an interval of time and returns a new TimeWithZone object unless @@ -11438,19 +14989,19 @@ class ActiveSupport::TimeWithZone # # Time.zone.now - 1.day.ago # => 86399.999967 # - # source://activesupport//lib/active_support/time_with_zone.rb#362 + # source://activesupport//lib/active_support/time_with_zone.rb#349 def -(other); end # Use the time in UTC for comparisons. # - # source://activesupport//lib/active_support/time_with_zone.rb#261 + # source://activesupport//lib/active_support/time_with_zone.rb#247 def <=>(other); end # So that +self+ acts_like?(:time). # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#523 + # source://activesupport//lib/active_support/time_with_zone.rb#506 def acts_like_time?; end # Uses Date to provide precise Time calculations for years, months, and days @@ -11475,9 +15026,10 @@ class ActiveSupport::TimeWithZone # now.advance(months: 1) # => Tue, 02 Dec 2014 01:26:28.558049687 EST -05:00 # now.advance(years: 1) # => Mon, 02 Nov 2015 01:26:28.558049687 EST -05:00 # - # source://activesupport//lib/active_support/time_with_zone.rb#451 + # source://activesupport//lib/active_support/time_with_zone.rb#438 def advance(options); end + # source://activesupport//lib/active_support/time_with_zone.rb#251 def after?(_arg0); end # Subtracts an interval of time from the current object's time and returns @@ -11498,7 +15050,7 @@ class ActiveSupport::TimeWithZone # now.ago(24.hours) # => Sun, 02 Nov 2014 01:26:28.725182881 EDT -04:00 # now.ago(1.day) # => Sun, 02 Nov 2014 00:26:28.725182881 EDT -04:00 # - # source://activesupport//lib/active_support/time_with_zone.rb#390 + # source://activesupport//lib/active_support/time_with_zone.rb#377 def ago(other); end # Coerces time to a string for JSON encoding. The default format is ISO 8601. @@ -11507,16 +15059,17 @@ class ActiveSupport::TimeWithZone # to +false+. # # # With ActiveSupport::JSON::Encoding.use_standard_json_time_format = true - # Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").to_json + # Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").as_json # # => "2005-02-01T05:15:10.000-10:00" # # # With ActiveSupport::JSON::Encoding.use_standard_json_time_format = false - # Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").to_json + # Time.utc(2005,2,1,15,15,10).in_time_zone("Hawaii").as_json # # => "2005/02/01 05:15:10 -1000" # - # source://activesupport//lib/active_support/time_with_zone.rb#176 + # source://activesupport//lib/active_support/time_with_zone.rb#182 def as_json(options = T.unsafe(nil)); end + # source://activesupport//lib/active_support/time_with_zone.rb#250 def before?(_arg0); end # Returns true if the current object's time is within the specified @@ -11524,14 +15077,14 @@ class ActiveSupport::TimeWithZone # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#269 + # source://activesupport//lib/active_support/time_with_zone.rb#255 def between?(min, max); end # An instance of ActiveSupport::TimeWithZone is never blank # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#534 + # source://activesupport//lib/active_support/time_with_zone.rb#517 def blank?; end # Returns a new +ActiveSupport::TimeWithZone+ where one or more of the elements have @@ -11547,23 +15100,23 @@ class ActiveSupport::TimeWithZone # # t = Time.zone.now # => Fri, 14 Apr 2017 11:45:15.116992711 EST -05:00 # t.change(year: 2020) # => Tue, 14 Apr 2020 11:45:15.116992711 EST -05:00 - # t.change(hour: 12) # => Fri, 14 Apr 2017 12:00:00.116992711 EST -05:00 - # t.change(min: 30) # => Fri, 14 Apr 2017 11:30:00.116992711 EST -05:00 + # t.change(hour: 12) # => Fri, 14 Apr 2017 12:00:00.000000000 EST -05:00 + # t.change(min: 30) # => Fri, 14 Apr 2017 11:30:00.000000000 EST -05:00 # t.change(offset: "-10:00") # => Fri, 14 Apr 2017 11:45:15.116992711 HST -10:00 # t.change(zone: "Hawaii") # => Fri, 14 Apr 2017 11:45:15.116992711 HST -10:00 # - # source://activesupport//lib/active_support/time_with_zone.rb#411 + # source://activesupport//lib/active_support/time_with_zone.rb#398 def change(options); end # Returns a Time instance of the simultaneous time in the UTC timezone. # - # source://activesupport//lib/active_support/time_with_zone.rb#73 + # source://activesupport//lib/active_support/time_with_zone.rb#72 def comparable_time; end - # source://activesupport//lib/active_support/time_with_zone.rb#463 + # source://activesupport//lib/active_support/time_with_zone.rb#449 def day; end - # Returns true if the current time is within Daylight Savings Time for the + # Returns true if the current time is within Daylight Savings \Time for the # specified time zone. # # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' @@ -11572,17 +15125,17 @@ class ActiveSupport::TimeWithZone # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#104 + # source://activesupport//lib/active_support/time_with_zone.rb#100 def dst?; end - # source://activesupport//lib/active_support/time_with_zone.rb#188 + # source://activesupport//lib/active_support/time_with_zone.rb#194 def encode_with(coder); end # Returns +true+ if +other+ is equal to current object. # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#304 + # source://activesupport//lib/active_support/time_with_zone.rb#290 def eql?(other); end # Returns a formatted string of the offset from UTC, or an alternative @@ -11594,17 +15147,17 @@ class ActiveSupport::TimeWithZone # Time.zone = 'UTC' # => "UTC" # Time.zone.now.formatted_offset(true, "0") # => "0" # - # source://activesupport//lib/active_support/time_with_zone.rb#135 + # source://activesupport//lib/active_support/time_with_zone.rb#131 def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end - # source://activesupport//lib/active_support/time_with_zone.rb#538 + # source://activesupport//lib/active_support/time_with_zone.rb#525 def freeze; end # Returns true if the current object's time is in the future. # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#299 + # source://activesupport//lib/active_support/time_with_zone.rb#285 def future?; end # Returns a Time instance of the simultaneous time in the UTC timezone. @@ -11614,12 +15167,12 @@ class ActiveSupport::TimeWithZone # Returns a Time instance of the simultaneous time in the system timezone. # - # source://activesupport//lib/active_support/time_with_zone.rb#93 + # source://activesupport//lib/active_support/time_with_zone.rb#92 def getlocal(utc_offset = T.unsafe(nil)); end # Returns a Time instance of the simultaneous time in the UTC timezone. # - # source://activesupport//lib/active_support/time_with_zone.rb#73 + # source://activesupport//lib/active_support/time_with_zone.rb#74 def getutc; end # Returns true if the current time zone is set to UTC. @@ -11631,17 +15184,17 @@ class ActiveSupport::TimeWithZone # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#115 + # source://activesupport//lib/active_support/time_with_zone.rb#114 def gmt?; end # Returns the offset from current time to UTC time in seconds. # - # source://activesupport//lib/active_support/time_with_zone.rb#121 + # source://activesupport//lib/active_support/time_with_zone.rb#120 def gmt_offset; end # Returns a Time instance of the simultaneous time in the UTC timezone. # - # source://activesupport//lib/active_support/time_with_zone.rb#73 + # source://activesupport//lib/active_support/time_with_zone.rb#75 def gmtime; end # Returns the offset from current time to UTC time in seconds. @@ -11649,10 +15202,10 @@ class ActiveSupport::TimeWithZone # source://activesupport//lib/active_support/time_with_zone.rb#121 def gmtoff; end - # source://activesupport//lib/active_support/time_with_zone.rb#308 + # source://activesupport//lib/active_support/time_with_zone.rb#294 def hash; end - # source://activesupport//lib/active_support/time_with_zone.rb#463 + # source://activesupport//lib/active_support/time_with_zone.rb#449 def hour; end # Returns a string of the object's date and time in the format used by @@ -11660,7 +15213,7 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.httpdate # => "Tue, 01 Jan 2013 04:39:43 GMT" # - # source://activesupport//lib/active_support/time_with_zone.rb#196 + # source://activesupport//lib/active_support/time_with_zone.rb#202 def httpdate; end # Adds an interval of time to the current object's time and returns that @@ -11680,32 +15233,32 @@ class ActiveSupport::TimeWithZone # now + 24.hours # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 # now + 1.day # => Mon, 03 Nov 2014 01:26:28.725182881 EST -05:00 # - # source://activesupport//lib/active_support/time_with_zone.rb#328 + # source://activesupport//lib/active_support/time_with_zone.rb#324 def in(other); end # Returns the simultaneous time in Time.zone, or the specified zone. # - # source://activesupport//lib/active_support/time_with_zone.rb#87 + # source://activesupport//lib/active_support/time_with_zone.rb#83 def in_time_zone(new_zone = T.unsafe(nil)); end - # source://activesupport//lib/active_support/time_with_zone.rb#184 + # source://activesupport//lib/active_support/time_with_zone.rb#190 def init_with(coder); end # Returns a string of the object's date, time, zone, and offset from UTC. # - # Time.zone.now.inspect # => "Thu, 04 Dec 2014 11:00:25.624541392 EST -05:00" + # Time.zone.now.inspect # => "2024-11-13 07:00:10.528054960 UTC +00:00" # - # source://activesupport//lib/active_support/time_with_zone.rb#150 + # source://activesupport//lib/active_support/time_with_zone.rb#146 def inspect; end # Say we're a Time to thwart type checking. # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#528 + # source://activesupport//lib/active_support/time_with_zone.rb#511 def is_a?(klass); end - # Returns true if the current time is within Daylight Savings Time for the + # Returns true if the current time is within Daylight Savings \Time for the # specified time zone. # # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' @@ -11714,7 +15267,7 @@ class ActiveSupport::TimeWithZone # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#104 + # source://activesupport//lib/active_support/time_with_zone.rb#103 def isdst; end # Returns a string of the object's date and time in the ISO 8601 standard @@ -11722,43 +15275,43 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05:00" # - # source://activesupport//lib/active_support/time_with_zone.rb#158 + # source://activesupport//lib/active_support/time_with_zone.rb#167 def iso8601(fraction_digits = T.unsafe(nil)); end # Say we're a Time to thwart type checking. # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#528 + # source://activesupport//lib/active_support/time_with_zone.rb#514 def kind_of?(klass); end # Returns a Time instance of the simultaneous time in the system timezone. # - # source://activesupport//lib/active_support/time_with_zone.rb#93 + # source://activesupport//lib/active_support/time_with_zone.rb#89 def localtime(utc_offset = T.unsafe(nil)); end - # source://activesupport//lib/active_support/time_with_zone.rb#544 + # source://activesupport//lib/active_support/time_with_zone.rb#531 def marshal_dump; end - # source://activesupport//lib/active_support/time_with_zone.rb#548 + # source://activesupport//lib/active_support/time_with_zone.rb#535 def marshal_load(variables); end - # source://activesupport//lib/active_support/time_with_zone.rb#463 + # source://activesupport//lib/active_support/time_with_zone.rb#449 def mday; end # Send the missing method to +time+ instance, and wrap result in a new # TimeWithZone with the existing +time_zone+. # - # source://activesupport//lib/active_support/time_with_zone.rb#569 - def method_missing(sym, *args, &block); end + # source://activesupport//lib/active_support/time_with_zone.rb#555 + def method_missing(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/time_with_zone.rb#463 + # source://activesupport//lib/active_support/time_with_zone.rb#449 def min; end - # source://activesupport//lib/active_support/time_with_zone.rb#463 + # source://activesupport//lib/active_support/time_with_zone.rb#449 def mon; end - # source://activesupport//lib/active_support/time_with_zone.rb#463 + # source://activesupport//lib/active_support/time_with_zone.rb#449 def month; end # Returns true if the current object's time falls within @@ -11766,30 +15319,35 @@ class ActiveSupport::TimeWithZone # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#286 + # source://activesupport//lib/active_support/time_with_zone.rb#275 def next_day?; end - # source://activesupport//lib/active_support/time_with_zone.rb#463 + # source://activesupport//lib/active_support/time_with_zone.rb#449 def nsec; end # Returns true if the current object's time is in the past. # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#274 + # source://activesupport//lib/active_support/time_with_zone.rb#260 def past?; end - # Returns the underlying TZInfo::TimezonePeriod. + # Returns the underlying +TZInfo::TimezonePeriod+. # - # source://activesupport//lib/active_support/time_with_zone.rb#82 + # source://activesupport//lib/active_support/time_with_zone.rb#78 def period; end + # @return [Boolean] + # + # source://activesupport//lib/active_support/time_with_zone.rb#521 + def present?; end + # Returns true if the current object's time falls within # the previous day (yesterday). # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#293 + # source://activesupport//lib/active_support/time_with_zone.rb#282 def prev_day?; end # respond_to_missing? is not called in some cases, such as when type conversion is @@ -11797,7 +15355,7 @@ class ActiveSupport::TimeWithZone # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#554 + # source://activesupport//lib/active_support/time_with_zone.rb#541 def respond_to?(sym, include_priv = T.unsafe(nil)); end # Returns a string of the object's date and time in the RFC 2822 standard @@ -11805,7 +15363,7 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.rfc2822 # => "Tue, 01 Jan 2013 04:51:39 +0000" # - # source://activesupport//lib/active_support/time_with_zone.rb#204 + # source://activesupport//lib/active_support/time_with_zone.rb#210 def rfc2822; end # Returns a string of the object's date and time in the ISO 8601 standard @@ -11813,7 +15371,7 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05:00" # - # source://activesupport//lib/active_support/time_with_zone.rb#158 + # source://activesupport//lib/active_support/time_with_zone.rb#168 def rfc3339(fraction_digits = T.unsafe(nil)); end # Returns a string of the object's date and time in the RFC 2822 standard @@ -11821,10 +15379,10 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.rfc2822 # => "Tue, 01 Jan 2013 04:51:39 +0000" # - # source://activesupport//lib/active_support/time_with_zone.rb#204 + # source://activesupport//lib/active_support/time_with_zone.rb#213 def rfc822; end - # source://activesupport//lib/active_support/time_with_zone.rb#463 + # source://activesupport//lib/active_support/time_with_zone.rb#449 def sec; end # Adds an interval of time to the current object's time and returns that @@ -11844,23 +15402,23 @@ class ActiveSupport::TimeWithZone # now + 24.hours # => Mon, 03 Nov 2014 00:26:28.725182881 EST -05:00 # now + 1.day # => Mon, 03 Nov 2014 01:26:28.725182881 EST -05:00 # - # source://activesupport//lib/active_support/time_with_zone.rb#328 + # source://activesupport//lib/active_support/time_with_zone.rb#323 def since(other); end # Replaces %Z directive with +zone before passing to Time#strftime, # so that zone information is correct. # - # source://activesupport//lib/active_support/time_with_zone.rb#255 + # source://activesupport//lib/active_support/time_with_zone.rb#241 def strftime(format); end # Returns a Time instance that represents the time in +time_zone+. # - # source://activesupport//lib/active_support/time_with_zone.rb#68 + # source://activesupport//lib/active_support/time_with_zone.rb#64 def time; end # Returns the value of attribute time_zone. # - # source://activesupport//lib/active_support/time_with_zone.rb#59 + # source://activesupport//lib/active_support/time_with_zone.rb#49 def time_zone; end # Returns Array of parts of Time in sequence of @@ -11869,10 +15427,10 @@ class ActiveSupport::TimeWithZone # now = Time.zone.now # => Tue, 18 Aug 2015 02:29:27.485278555 UTC +00:00 # now.to_a # => [27, 29, 2, 18, 8, 2015, 2, 230, false, "UTC"] # - # source://activesupport//lib/active_support/time_with_zone.rb#474 + # source://activesupport//lib/active_support/time_with_zone.rb#461 def to_a; end - # source://activesupport//lib/active_support/time_with_zone.rb#463 + # source://activesupport//lib/active_support/time_with_zone.rb#449 def to_date; end # Returns an instance of DateTime with the timezone's UTC offset @@ -11880,7 +15438,7 @@ class ActiveSupport::TimeWithZone # Time.zone.now.to_datetime # => Tue, 18 Aug 2015 02:32:20 +0000 # Time.current.in_time_zone('Hawaii').to_datetime # => Mon, 17 Aug 2015 16:32:20 -1000 # - # source://activesupport//lib/active_support/time_with_zone.rb#507 + # source://activesupport//lib/active_support/time_with_zone.rb#494 def to_datetime; end # Returns the object's date and time as a floating-point number of seconds @@ -11888,7 +15446,7 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.to_f # => 1417709320.285418 # - # source://activesupport//lib/active_support/time_with_zone.rb#482 + # source://activesupport//lib/active_support/time_with_zone.rb#469 def to_f; end # Returns a string of the object's date and time. @@ -11898,9 +15456,9 @@ class ActiveSupport::TimeWithZone # Accepts an optional format: # * :default - default value, mimics Ruby Time#to_s format. # * :db - format outputs time in UTC :db time. See Time#to_fs(:db). - # * Any key in Time::DATE_FORMATS can be used. See active_support/core_ext/time/conversions.rb. + # * Any key in +Time::DATE_FORMATS+ can be used. See active_support/core_ext/time/conversions.rb. # - # source://activesupport//lib/active_support/time_with_zone.rb#241 + # source://activesupport//lib/active_support/time_with_zone.rb#237 def to_formatted_s(format = T.unsafe(nil)); end # Returns a string of the object's date and time. @@ -11910,9 +15468,9 @@ class ActiveSupport::TimeWithZone # Accepts an optional format: # * :default - default value, mimics Ruby Time#to_s format. # * :db - format outputs time in UTC :db time. See Time#to_fs(:db). - # * Any key in Time::DATE_FORMATS can be used. See active_support/core_ext/time/conversions.rb. + # * Any key in +Time::DATE_FORMATS+ can be used. See active_support/core_ext/time/conversions.rb. # - # source://activesupport//lib/active_support/time_with_zone.rb#241 + # source://activesupport//lib/active_support/time_with_zone.rb#228 def to_fs(format = T.unsafe(nil)); end # Returns the object's date and time as an integer number of seconds @@ -11920,7 +15478,7 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.to_i # => 1417709320 # - # source://activesupport//lib/active_support/time_with_zone.rb#490 + # source://activesupport//lib/active_support/time_with_zone.rb#477 def to_i; end # Returns the object's date and time as a rational number of seconds @@ -11928,19 +15486,19 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.to_r # => (708854548642709/500000) # - # source://activesupport//lib/active_support/time_with_zone.rb#499 + # source://activesupport//lib/active_support/time_with_zone.rb#486 def to_r; end # Returns a string of the object's date and time. # - # source://activesupport//lib/active_support/time_with_zone.rb#212 - def to_s(format = T.unsafe(nil)); end + # source://activesupport//lib/active_support/time_with_zone.rb#216 + def to_s; end - # Returns an instance of +Time+, either with the same UTC offset - # as +self+ or in the local system timezone depending on the setting - # of +ActiveSupport.to_time_preserves_timezone+. + # Returns an instance of +Time+, either with the same timezone as +self+, + # with the same UTC offset as +self+ or in the local system timezone + # depending on the setting of +ActiveSupport.to_time_preserves_timezone+. # - # source://activesupport//lib/active_support/time_with_zone.rb#514 + # source://activesupport//lib/active_support/time_with_zone.rb#501 def to_time; end # Returns true if the current object's time falls within @@ -11948,7 +15506,7 @@ class ActiveSupport::TimeWithZone # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#280 + # source://activesupport//lib/active_support/time_with_zone.rb#266 def today?; end # Returns true if the current object's time falls within @@ -11956,7 +15514,7 @@ class ActiveSupport::TimeWithZone # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#286 + # source://activesupport//lib/active_support/time_with_zone.rb#272 def tomorrow?; end # Returns the object's date and time as an integer number of seconds @@ -11964,15 +15522,15 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.to_i # => 1417709320 # - # source://activesupport//lib/active_support/time_with_zone.rb#490 + # source://activesupport//lib/active_support/time_with_zone.rb#480 def tv_sec; end - # source://activesupport//lib/active_support/time_with_zone.rb#463 + # source://activesupport//lib/active_support/time_with_zone.rb#449 def usec; end # Returns a Time instance of the simultaneous time in the UTC timezone. # - # source://activesupport//lib/active_support/time_with_zone.rb#73 + # source://activesupport//lib/active_support/time_with_zone.rb#69 def utc; end # Returns true if the current time zone is set to UTC. @@ -11984,15 +15542,15 @@ class ActiveSupport::TimeWithZone # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#115 + # source://activesupport//lib/active_support/time_with_zone.rb#111 def utc?; end # Returns the offset from current time to UTC time in seconds. # - # source://activesupport//lib/active_support/time_with_zone.rb#121 + # source://activesupport//lib/active_support/time_with_zone.rb#117 def utc_offset; end - # source://activesupport//lib/active_support/time_with_zone.rb#463 + # source://activesupport//lib/active_support/time_with_zone.rb#449 def wday; end # Returns a string of the object's date and time in the ISO 8601 standard @@ -12000,13 +15558,13 @@ class ActiveSupport::TimeWithZone # # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05:00" # - # source://activesupport//lib/active_support/time_with_zone.rb#158 + # source://activesupport//lib/active_support/time_with_zone.rb#154 def xmlschema(fraction_digits = T.unsafe(nil)); end - # source://activesupport//lib/active_support/time_with_zone.rb#463 + # source://activesupport//lib/active_support/time_with_zone.rb#449 def yday; end - # source://activesupport//lib/active_support/time_with_zone.rb#463 + # source://activesupport//lib/active_support/time_with_zone.rb#449 def year; end # Returns true if the current object's time falls within @@ -12014,7 +15572,7 @@ class ActiveSupport::TimeWithZone # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#293 + # source://activesupport//lib/active_support/time_with_zone.rb#279 def yesterday?; end # Returns the time zone abbreviation. @@ -12022,20 +15580,20 @@ class ActiveSupport::TimeWithZone # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" # Time.zone.now.zone # => "EST" # - # source://activesupport//lib/active_support/time_with_zone.rb#143 + # source://activesupport//lib/active_support/time_with_zone.rb#139 def zone; end private # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#605 + # source://activesupport//lib/active_support/time_with_zone.rb#593 def duration_of_variable_length?(obj); end - # source://activesupport//lib/active_support/time_with_zone.rb#586 + # source://activesupport//lib/active_support/time_with_zone.rb#574 def get_period_and_ensure_valid_local_time(period); end - # source://activesupport//lib/active_support/time_with_zone.rb#578 + # source://activesupport//lib/active_support/time_with_zone.rb#564 def incorporate_utc_offset(time, offset); end # Ensure proxy class responds to all methods that underlying time instance @@ -12043,44 +15601,36 @@ class ActiveSupport::TimeWithZone # # @return [Boolean] # - # source://activesupport//lib/active_support/time_with_zone.rb#562 + # source://activesupport//lib/active_support/time_with_zone.rb#549 def respond_to_missing?(sym, include_priv); end - # source://activesupport//lib/active_support/time_with_zone.rb#599 + # source://activesupport//lib/active_support/time_with_zone.rb#587 def transfer_time_values_to_utc_constructor(time); end - # source://activesupport//lib/active_support/time_with_zone.rb#609 + # source://activesupport//lib/active_support/time_with_zone.rb#597 def wrap_with_time_zone(time); end - - class << self - # Report class name as 'Time' to thwart type checking. - # - # source://activesupport//lib/active_support/time_with_zone.rb#44 - def name; end - end end -# source://activesupport//lib/active_support/time_with_zone.rb#209 -ActiveSupport::TimeWithZone::NOT_SET = T.let(T.unsafe(nil), Object) - -# source://activesupport//lib/active_support/time_with_zone.rb#55 +# source://activesupport//lib/active_support/time_with_zone.rb#45 ActiveSupport::TimeWithZone::PRECISIONS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/time_with_zone.rb#576 +# source://activesupport//lib/active_support/time_with_zone.rb#562 ActiveSupport::TimeWithZone::SECONDS_PER_DAY = T.let(T.unsafe(nil), Integer) -# The TimeZone class serves as a wrapper around TZInfo::Timezone instances. +# = Active Support \Time Zone +# +# The TimeZone class serves as a wrapper around +TZInfo::Timezone+ instances. # It allows us to do the following: # # * Limit the set of zones provided by TZInfo to a meaningful subset of 134 # zones. # * Retrieve and display zones with a friendlier name -# (e.g., "Eastern Time (US & Canada)" instead of "America/New_York"). -# * Lazily load TZInfo::Timezone instances only when they're needed. +# (e.g., "Eastern \Time (US & Canada)" instead of "America/New_York"). +# * Lazily load +TZInfo::Timezone+ instances only when they're needed. # * Create ActiveSupport::TimeWithZone instances via TimeZone's +local+, # +parse+, +at+, and +now+ methods. # -# If you set config.time_zone in the Rails Application, you can +# If you set config.time_zone in the \Rails Application, you can # access this TimeZone object via Time.zone: # # # application.rb: @@ -12092,33 +15642,33 @@ ActiveSupport::TimeWithZone::SECONDS_PER_DAY = T.let(T.unsafe(nil), Integer) # Time.zone.name # => "Eastern Time (US & Canada)" # Time.zone.now # => Sun, 18 May 2008 14:30:44 EDT -04:00 # -# source://activesupport//lib/active_support/values/time_zone.rb#29 +# source://activesupport//lib/active_support/values/time_zone.rb#31 class ActiveSupport::TimeZone include ::Comparable - # Create a new TimeZone object with the given name and offset. The - # offset is the number of seconds that this time zone is offset from UTC - # (GMT). Seconds were chosen as the offset unit because that is the unit - # that Ruby uses to represent time zone offsets (see Time#utc_offset). + # :stopdoc: # # @return [TimeZone] a new instance of TimeZone # - # source://activesupport//lib/active_support/values/time_zone.rb#301 + # source://activesupport//lib/active_support/values/time_zone.rb#310 def initialize(name, utc_offset = T.unsafe(nil), tzinfo = T.unsafe(nil)); end # Compare this time zone to the parameter. The two are compared first on # their offsets, and then by name. # - # source://activesupport//lib/active_support/values/time_zone.rb#324 + # source://activesupport//lib/active_support/values/time_zone.rb#340 def <=>(zone); end # Compare #name and TZInfo identifier to a supplied regexp, returning +true+ # if a match is found. # - # source://activesupport//lib/active_support/values/time_zone.rb#333 + # source://activesupport//lib/active_support/values/time_zone.rb#349 def =~(re); end - # Method for creating new ActiveSupport::TimeWithZone instance in time zone + # source://activesupport//lib/active_support/values/time_zone.rb#574 + def abbr(time); end + + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone # of +self+ from number of seconds since the Unix epoch. # # Time.zone = 'Hawaii' # => "Hawaii" @@ -12130,10 +15680,15 @@ class ActiveSupport::TimeZone # Time.zone = 'Hawaii' # => "Hawaii" # Time.at(946684800, 123456.789).nsec # => 123456789 # - # source://activesupport//lib/active_support/values/time_zone.rb#370 + # source://activesupport//lib/active_support/values/time_zone.rb#386 def at(*args); end - # source://activesupport//lib/active_support/values/time_zone.rb#566 + # @return [Boolean] + # + # source://activesupport//lib/active_support/values/time_zone.rb#578 + def dst?(time); end + + # source://activesupport//lib/active_support/values/time_zone.rb#586 def encode_with(coder); end # Returns a formatted string of the offset from UTC, or an alternative @@ -12143,13 +15698,13 @@ class ActiveSupport::TimeZone # zone.formatted_offset # => "-06:00" # zone.formatted_offset(false) # => "-0600" # - # source://activesupport//lib/active_support/values/time_zone.rb#318 + # source://activesupport//lib/active_support/values/time_zone.rb#334 def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end - # source://activesupport//lib/active_support/values/time_zone.rb#562 + # source://activesupport//lib/active_support/values/time_zone.rb#582 def init_with(coder); end - # Method for creating new ActiveSupport::TimeWithZone instance in time zone + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone # of +self+ from an ISO 8601 string. # # Time.zone = 'Hawaii' # => "Hawaii" @@ -12163,22 +15718,22 @@ class ActiveSupport::TimeZone # If the string is invalid then an +ArgumentError+ will be raised unlike +parse+ # which usually returns +nil+ when given an invalid date string. # - # source://activesupport//lib/active_support/values/time_zone.rb#387 + # source://activesupport//lib/active_support/values/time_zone.rb#403 def iso8601(str); end - # Method for creating new ActiveSupport::TimeWithZone instance in time zone + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone # of +self+ from given values. # # Time.zone = 'Hawaii' # => "Hawaii" # Time.zone.local(2007, 2, 1, 15, 30, 45) # => Thu, 01 Feb 2007 15:30:45 HST -10:00 # - # source://activesupport//lib/active_support/values/time_zone.rb#354 + # source://activesupport//lib/active_support/values/time_zone.rb#370 def local(*args); end # Adjust the given time to the simultaneous time in UTC. Returns a # Time.utc() instance. # - # source://activesupport//lib/active_support/values/time_zone.rb#542 + # source://activesupport//lib/active_support/values/time_zone.rb#558 def local_to_utc(time, dst = T.unsafe(nil)); end # Compare #name and TZInfo identifier to a supplied regexp, returning +true+ @@ -12186,12 +15741,12 @@ class ActiveSupport::TimeZone # # @return [Boolean] # - # source://activesupport//lib/active_support/values/time_zone.rb#339 + # source://activesupport//lib/active_support/values/time_zone.rb#355 def match?(re); end # Returns the value of attribute name. # - # source://activesupport//lib/active_support/values/time_zone.rb#294 + # source://activesupport//lib/active_support/values/time_zone.rb#297 def name; end # Returns an ActiveSupport::TimeWithZone instance representing the current @@ -12200,10 +15755,10 @@ class ActiveSupport::TimeZone # Time.zone = 'Hawaii' # => "Hawaii" # Time.zone.now # => Wed, 23 Jan 2008 20:24:27 HST -10:00 # - # source://activesupport//lib/active_support/values/time_zone.rb#507 + # source://activesupport//lib/active_support/values/time_zone.rb#523 def now; end - # Method for creating new ActiveSupport::TimeWithZone instance in time zone + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone # of +self+ from parsed string. # # Time.zone = 'Hawaii' # => "Hawaii" @@ -12222,25 +15777,19 @@ class ActiveSupport::TimeZone # # If the string is invalid then an +ArgumentError+ could be raised. # - # source://activesupport//lib/active_support/values/time_zone.rb#444 + # source://activesupport//lib/active_support/values/time_zone.rb#460 def parse(str, now = T.unsafe(nil)); end - # Available so that TimeZone instances respond like TZInfo::Timezone - # instances. - # - # source://activesupport//lib/active_support/values/time_zone.rb#554 + # source://activesupport//lib/active_support/values/time_zone.rb#566 def period_for_local(time, dst = T.unsafe(nil)); end - # Available so that TimeZone instances respond like TZInfo::Timezone - # instances. - # - # source://activesupport//lib/active_support/values/time_zone.rb#548 + # source://activesupport//lib/active_support/values/time_zone.rb#562 def period_for_utc(time); end - # source://activesupport//lib/active_support/values/time_zone.rb#558 + # source://activesupport//lib/active_support/values/time_zone.rb#570 def periods_for_local(time); end - # Method for creating new ActiveSupport::TimeWithZone instance in time zone + # \Method for creating new ActiveSupport::TimeWithZone instance in time zone # of +self+ from an RFC 3339 string. # # Time.zone = 'Hawaii' # => "Hawaii" @@ -12255,9 +15804,15 @@ class ActiveSupport::TimeZone # # @raise [ArgumentError] # - # source://activesupport//lib/active_support/values/time_zone.rb#460 + # source://activesupport//lib/active_support/values/time_zone.rb#476 def rfc3339(str); end + # Returns a standard time zone name defined by IANA + # https://www.iana.org/time-zones + # + # source://activesupport//lib/active_support/values/time_zone.rb#319 + def standard_name; end + # Parses +str+ according to +format+ and returns an ActiveSupport::TimeWithZone. # # Assumes that +str+ is a time in the time zone +self+, @@ -12279,32 +15834,32 @@ class ActiveSupport::TimeZone # # Time.zone.strptime('Mar 2000', '%b %Y') # => Wed, 01 Mar 2000 00:00:00 HST -10:00 # - # source://activesupport//lib/active_support/values/time_zone.rb#498 + # source://activesupport//lib/active_support/values/time_zone.rb#514 def strptime(str, format, now = T.unsafe(nil)); end # Returns a textual representation of this time zone. # - # source://activesupport//lib/active_support/values/time_zone.rb#345 + # source://activesupport//lib/active_support/values/time_zone.rb#361 def to_s; end # Returns the current date in this time zone. # - # source://activesupport//lib/active_support/values/time_zone.rb#512 + # source://activesupport//lib/active_support/values/time_zone.rb#528 def today; end # Returns the next date in this time zone. # - # source://activesupport//lib/active_support/values/time_zone.rb#517 + # source://activesupport//lib/active_support/values/time_zone.rb#533 def tomorrow; end # Returns the value of attribute tzinfo. # - # source://activesupport//lib/active_support/values/time_zone.rb#295 + # source://activesupport//lib/active_support/values/time_zone.rb#298 def tzinfo; end # Returns the offset of this time zone from UTC in seconds. # - # source://activesupport//lib/active_support/values/time_zone.rb#308 + # source://activesupport//lib/active_support/values/time_zone.rb#324 def utc_offset; end # Adjust the given time to the simultaneous time in the time zone @@ -12315,22 +15870,22 @@ class ActiveSupport::TimeZone # As of tzinfo 2, utc_to_local returns a Time with a non-zero utc_offset. # See the +utc_to_local_returns_utc_offset_times+ config for more info. # - # source://activesupport//lib/active_support/values/time_zone.rb#533 + # source://activesupport//lib/active_support/values/time_zone.rb#549 def utc_to_local(time); end # Returns the previous date in this time zone. # - # source://activesupport//lib/active_support/values/time_zone.rb#522 + # source://activesupport//lib/active_support/values/time_zone.rb#538 def yesterday; end private # @raise [ArgumentError] # - # source://activesupport//lib/active_support/values/time_zone.rb#572 + # source://activesupport//lib/active_support/values/time_zone.rb#592 def parts_to_time(parts, now); end - # source://activesupport//lib/active_support/values/time_zone.rb#597 + # source://activesupport//lib/active_support/values/time_zone.rb#617 def time_now; end class << self @@ -12340,35 +15895,36 @@ class ActiveSupport::TimeZone # timezone to find. (The first one with that offset will be returned.) # Returns +nil+ if no such time zone is known to the system. # - # source://activesupport//lib/active_support/values/time_zone.rb#230 + # source://activesupport//lib/active_support/values/time_zone.rb#233 def [](arg); end # Returns an array of all TimeZone objects. There are multiple # TimeZone objects per time zone, in many cases, to make it easier # for users to find their own time zone. # - # source://activesupport//lib/active_support/values/time_zone.rb#221 + # source://activesupport//lib/active_support/values/time_zone.rb#224 def all; end - # source://activesupport//lib/active_support/values/time_zone.rb#263 + # source://activesupport//lib/active_support/values/time_zone.rb#266 def clear; end # A convenience method for returning a collection of TimeZone objects # for time zones in the country specified by its ISO 3166-1 Alpha2 code. # - # source://activesupport//lib/active_support/values/time_zone.rb#258 + # source://activesupport//lib/active_support/values/time_zone.rb#261 def country_zones(country_code); end + # source://activesupport//lib/active_support/values/time_zone.rb#212 def create(*_arg0); end - # source://activesupport//lib/active_support/values/time_zone.rb#205 + # source://activesupport//lib/active_support/values/time_zone.rb#208 def find_tzinfo(name); end # Returns a TimeZone instance with the given name, or +nil+ if no # such TimeZone instance exists. (This exists to support the use of # this class with the +composed_of+ macro.) # - # source://activesupport//lib/active_support/values/time_zone.rb#214 + # source://activesupport//lib/active_support/values/time_zone.rb#217 def new(name); end # Assumes self represents an offset from UTC in seconds (as returned from @@ -12376,34 +15932,34 @@ class ActiveSupport::TimeZone # # ActiveSupport::TimeZone.seconds_to_utc_offset(-21_600) # => "-06:00" # - # source://activesupport//lib/active_support/values/time_zone.rb#197 + # source://activesupport//lib/active_support/values/time_zone.rb#200 def seconds_to_utc_offset(seconds, colon = T.unsafe(nil)); end # A convenience method for returning a collection of TimeZone objects # for time zones in the USA. # - # source://activesupport//lib/active_support/values/time_zone.rb#252 + # source://activesupport//lib/active_support/values/time_zone.rb#255 def us_zones; end private - # source://activesupport//lib/active_support/values/time_zone.rb#271 + # source://activesupport//lib/active_support/values/time_zone.rb#274 def load_country_zones(code); end - # source://activesupport//lib/active_support/values/time_zone.rb#285 + # source://activesupport//lib/active_support/values/time_zone.rb#288 def zones_map; end end end -# Keys are Rails TimeZone names, values are TZInfo identifiers. +# Keys are \Rails TimeZone names, values are TZInfo identifiers. # -# source://activesupport//lib/active_support/values/time_zone.rb#31 +# source://activesupport//lib/active_support/values/time_zone.rb#33 ActiveSupport::TimeZone::MAPPING = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/values/time_zone.rb#186 +# source://activesupport//lib/active_support/values/time_zone.rb#189 ActiveSupport::TimeZone::UTC_OFFSET_WITHOUT_COLON = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/values/time_zone.rb#185 +# source://activesupport//lib/active_support/values/time_zone.rb#188 ActiveSupport::TimeZone::UTC_OFFSET_WITH_COLON = T.let(T.unsafe(nil), String) # source://activesupport//lib/active_support/core_ext/object/json.rb#35 @@ -12415,10 +15971,10 @@ end # source://activesupport//lib/active_support/core_ext/object/try.rb#6 module ActiveSupport::Tryable # source://activesupport//lib/active_support/core_ext/object/try.rb#7 - def try(*args, &block); end + def try(*args, **_arg1, &block); end # source://activesupport//lib/active_support/core_ext/object/try.rb#20 - def try!(*args, &block); end + def try!(*args, **_arg1, &block); end end # source://activesupport//lib/active_support/gem_version.rb#9 @@ -12511,73 +16067,74 @@ class ActiveSupport::XMLConverter::DisallowedType < ::StandardError def initialize(type); end end -# = XmlMini +# = \XmlMini # # To use the much faster libxml parser: -# gem 'libxml-ruby', '=0.9.7' +# gem "libxml-ruby" # XmlMini.backend = 'LibXML' # # source://activesupport//lib/active_support/xml_mini.rb#17 module ActiveSupport::XmlMini extend ::ActiveSupport::XmlMini - # source://activesupport//lib/active_support/xml_mini.rb#97 + # source://activesupport//lib/active_support/xml_mini.rb#102 def backend; end - # source://activesupport//lib/active_support/xml_mini.rb#101 + # source://activesupport//lib/active_support/xml_mini.rb#106 def backend=(name); end # Returns the value of attribute depth. # - # source://activesupport//lib/active_support/xml_mini.rb#92 + # source://activesupport//lib/active_support/xml_mini.rb#97 def depth; end # Sets the attribute depth # # @param value the value to set the attribute depth to. # - # source://activesupport//lib/active_support/xml_mini.rb#92 + # source://activesupport//lib/active_support/xml_mini.rb#97 def depth=(_arg0); end - # source://activesupport//lib/active_support/xml_mini.rb#95 - def parse(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/xml_mini.rb#100 + def parse(*_arg0, **_arg1, &_arg2); end - # source://activesupport//lib/active_support/xml_mini.rb#148 + # source://activesupport//lib/active_support/xml_mini.rb#153 def rename_key(key, options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/xml_mini.rb#115 + # source://activesupport//lib/active_support/xml_mini.rb#120 def to_tag(key, value, options); end - # source://activesupport//lib/active_support/xml_mini.rb#107 + # source://activesupport//lib/active_support/xml_mini.rb#112 def with_backend(name); end private - # source://activesupport//lib/active_support/xml_mini.rb#159 + # source://activesupport//lib/active_support/xml_mini.rb#164 def _dasherize(key); end - # TODO: Add support for other encodings - # - # source://activesupport//lib/active_support/xml_mini.rb#166 + # source://activesupport//lib/active_support/xml_mini.rb#170 def _parse_binary(bin, entity); end - # source://activesupport//lib/active_support/xml_mini.rb#175 + # source://activesupport//lib/active_support/xml_mini.rb#181 def _parse_file(file, entity); end - # source://activesupport//lib/active_support/xml_mini.rb#191 + # source://activesupport//lib/active_support/xml_mini.rb#189 + def _parse_hex_binary(bin); end + + # source://activesupport//lib/active_support/xml_mini.rb#201 def cast_backend_name_to_module(name); end - # source://activesupport//lib/active_support/xml_mini.rb#183 + # source://activesupport//lib/active_support/xml_mini.rb#193 def current_thread_backend; end - # source://activesupport//lib/active_support/xml_mini.rb#187 + # source://activesupport//lib/active_support/xml_mini.rb#197 def current_thread_backend=(name); end end # source://activesupport//lib/active_support/xml_mini.rb#34 ActiveSupport::XmlMini::DEFAULT_ENCODINGS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/xml_mini.rb#55 +# source://activesupport//lib/active_support/xml_mini.rb#56 ActiveSupport::XmlMini::FORMATTING = T.let(T.unsafe(nil), Hash) # This module decorates files deserialized using Hash.from_xml with @@ -12598,7 +16155,7 @@ module ActiveSupport::XmlMini::FileLike def original_filename=(_arg0); end end -# source://activesupport//lib/active_support/xml_mini.rb#65 +# source://activesupport//lib/active_support/xml_mini.rb#66 ActiveSupport::XmlMini::PARSING = T.let(T.unsafe(nil), Hash) # source://activesupport//lib/active_support/xml_mini.rb#39 @@ -12692,13 +16249,23 @@ end # source://activesupport//lib/active_support/xml_mini/rexml.rb#11 ActiveSupport::XmlMini_REXML::CONTENT_KEY = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/core_ext/object/blank.rb#83 +# source://activesupport//lib/active_support/core_ext/array/extract.rb#3 class Array include ::Enumerable - # source://activesupport//lib/active_support/core_ext/object/json.rb#158 + # source://activesupport//lib/active_support/core_ext/object/json.rb#164 def as_json(options = T.unsafe(nil)); end + # An array is blank if it's empty: + # + # [].blank? # => true + # [1,2,3].blank? # => false + # + # @return [true, false] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#102 + def blank?; end + # Removes all blank elements from the +Array+ in place and returns self. # Uses Object#blank? for determining if an item is blank. # @@ -12706,7 +16273,7 @@ class Array # a.compact_blank! # # => [1, 2, true] # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#325 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#275 def compact_blank!; end # Returns a deep copy of array. @@ -12782,54 +16349,11 @@ class Array # %w( a b c d ).from(2) # => ["c", "d"] # %w( a b c d ).from(10) # => [] # %w().from(0) # => [] - # %w( a b c d ).from(-2) # => ["c", "d"] - # %w( a b c ).from(-10) # => [] - # - # source://activesupport//lib/active_support/core_ext/array/access.rb#12 - def from(position); end - - # Splits or iterates over the array in +number+ of groups, padding any - # remaining slots with +fill_with+ unless it is +false+. - # - # %w(1 2 3 4 5 6 7 8 9 10).in_groups(3) {|group| p group} - # ["1", "2", "3", "4"] - # ["5", "6", "7", nil] - # ["8", "9", "10", nil] - # - # %w(1 2 3 4 5 6 7 8 9 10).in_groups(3, ' ') {|group| p group} - # ["1", "2", "3", "4"] - # ["5", "6", "7", " "] - # ["8", "9", "10", " "] - # - # %w(1 2 3 4 5 6 7).in_groups(3, false) {|group| p group} - # ["1", "2", "3"] - # ["4", "5"] - # ["6", "7"] - # - # source://activesupport//lib/active_support/core_ext/array/grouping.rb#62 - def in_groups(number, fill_with = T.unsafe(nil), &block); end - - # Splits or iterates over the array in groups of size +number+, - # padding any remaining slots with +fill_with+ unless it is +false+. - # - # %w(1 2 3 4 5 6 7 8 9 10).in_groups_of(3) {|group| p group} - # ["1", "2", "3"] - # ["4", "5", "6"] - # ["7", "8", "9"] - # ["10", nil, nil] - # - # %w(1 2 3 4 5).in_groups_of(2, ' ') {|group| p group} - # ["1", "2"] - # ["3", "4"] - # ["5", " "] - # - # %w(1 2 3 4 5).in_groups_of(2, false) {|group| p group} - # ["1", "2"] - # ["3", "4"] - # ["5"] + # %w( a b c d ).from(-2) # => ["c", "d"] + # %w( a b c ).from(-10) # => [] # - # source://activesupport//lib/active_support/core_ext/array/grouping.rb#22 - def in_groups_of(number, fill_with = T.unsafe(nil), &block); end + # source://activesupport//lib/active_support/core_ext/array/access.rb#12 + def from(position); end # Returns a new array that includes the passed elements. # @@ -12839,19 +16363,10 @@ class Array # source://activesupport//lib/active_support/core_ext/array/access.rb#36 def including(*elements); end - # Wraps the array in an ActiveSupport::ArrayInquirer object, which gives a - # friendlier way to check its string-like contents. - # - # pets = [:cat, :dog].inquiry - # - # pets.cat? # => true - # pets.ferret? # => false - # - # pets.any?(:cat, :ferret) # => true - # pets.any?(:ferret, :alligator) # => false + # @return [Boolean] # - # source://activesupport//lib/active_support/core_ext/array/inquiry.rb#16 - def inquiry; end + # source://activesupport//lib/active_support/core_ext/object/blank.rb#104 + def present?; end # Equal to self[1]. # @@ -12867,18 +16382,6 @@ class Array # source://activesupport//lib/active_support/core_ext/array/access.rb#97 def second_to_last; end - # Divides the array into one or more subarrays based on a delimiting +value+ - # or the result of an optional block. - # - # [1, 2, 3, 4, 5].split(3) # => [[1, 2], [4, 5]] - # (1..10).to_a.split { |i| i % 3 == 0 } # => [[1, 2], [4, 5], [7, 8], [10]] - # - # source://activesupport//lib/active_support/core_ext/array/grouping.rb#93 - def split(value = T.unsafe(nil), &block); end - - # source://activesupport//lib/active_support/core_ext/enumerable.rb#310 - def sum(init = T.unsafe(nil), &block); end - # Equal to self[2]. # # %w( a b c d e ).third # => "c" @@ -12914,7 +16417,7 @@ class Array # Blog.none.to_fs(:db) # => "null" # [1,2].to_fs # => "[1, 2]" # - # source://activesupport//lib/active_support/core_ext/array/conversions.rb#94 + # source://activesupport//lib/active_support/core_ext/array/conversions.rb#106 def to_formatted_s(format = T.unsafe(nil)); end # Extends Array#to_s to convert a collection of elements into a @@ -12932,7 +16435,7 @@ class Array # Calls to_param on all its elements and joins the result with # slashes. This is used by url_for in Action Pack. # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#42 + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#48 def to_param; end # Converts an array into a string suitable for use as a URL query string, @@ -12940,12 +16443,9 @@ class Array # # ['Rails', 'coding'].to_query('hobbies') # => "hobbies%5B%5D=Rails&hobbies%5B%5D=coding" # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#50 + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#56 def to_query(key); end - # source://activesupport//lib/active_support/core_ext/array/deprecated_conversions.rb#5 - def to_s(format = T.unsafe(nil)); end - # Converts the array to a comma-separated sentence where the last element is # joined by the connector word. # @@ -12956,11 +16456,11 @@ class Array # ==== Options # # * :words_connector - The sign or word used to join all but the last - # element in arrays with three or more elements (default: ", "). + # element in arrays with three or more elements (default: ", "). # * :last_word_connector - The sign or word used to join the last element - # in arrays with three or more elements (default: ", and "). + # in arrays with three or more elements (default: ", and "). # * :two_words_connector - The sign or word used to join the elements - # in arrays with two elements (default: " and "). + # in arrays with two elements (default: " and "). # * :locale - If +i18n+ is available, you can set a locale and use # the connector options defined on the 'support.array' namespace in the # corresponding dictionary file. @@ -13076,7 +16576,7 @@ class Array # # # - # source://activesupport//lib/active_support/core_ext/array/conversions.rb#184 + # source://activesupport//lib/active_support/core_ext/array/conversions.rb#183 def to_xml(options = T.unsafe(nil)); end # Returns a copy of the Array excluding the specified elements. @@ -13087,7 +16587,7 @@ class Array # Note: This is an optimization of Enumerable#excluding that uses Array#- # instead of Array#reject for performance reasons. # - # source://activesupport//lib/active_support/core_ext/array/access.rb#47 + # source://activesupport//lib/active_support/core_ext/array/access.rb#50 def without(*elements); end class << self @@ -13132,14 +16632,9 @@ class Array end end -# source://activesupport//lib/active_support/core_ext/array/deprecated_conversions.rb#4 -Array::NOT_SET = T.let(T.unsafe(nil), Object) - -# source://activesupport//lib/active_support/core_ext/object/json.rb#118 +# source://activesupport//lib/active_support/core_ext/object/json.rb#124 class BigDecimal < ::Numeric include ::ActiveSupport::BigDecimalWithDefaultFormat - include ::ActiveSupport::NumericWithFormat - include ::ActiveSupport::DeprecatedNumericWithFormat # A BigDecimal would be naturally represented as a JSON number. Most libraries, # however, parse non-integer JSON numbers directly as floats. Clients using @@ -13151,18 +16646,14 @@ class BigDecimal < ::Numeric # BigDecimal, it still has the chance to post-process the string and get the # real value. # - # source://activesupport//lib/active_support/core_ext/object/json.rb#128 + # source://activesupport//lib/active_support/core_ext/object/json.rb#134 def as_json(options = T.unsafe(nil)); end - - # source://activesupport//lib/active_support/core_ext/numeric/deprecated_conversions.rb#5 - def to_s(format = T.unsafe(nil), options = T.unsafe(nil)); end end -BigDecimal::EXCEPTION_NaN = T.let(T.unsafe(nil), Integer) -BigDecimal::VERSION = T.let(T.unsafe(nil), String) - -# source://activesupport//lib/active_support/core_ext/class/attribute.rb#5 +# source://activesupport//lib/active_support/core_ext/class/attribute.rb#6 class Class < ::Module + include ::ActiveSupport::DescendantsTracker::ReloadedClassesFiltering + # Declare a class-level attribute whose value is inheritable by subclasses. # Subclasses can change their own value and it will not impact parent class. # @@ -13243,7 +16734,7 @@ class Class < ::Module # # class_attribute :settings, default: {} # - # source://activesupport//lib/active_support/core_ext/class/attribute.rb#85 + # source://activesupport//lib/active_support/core_ext/class/attribute.rb#86 def class_attribute(*attrs, instance_accessor: T.unsafe(nil), instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_predicate: T.unsafe(nil), default: T.unsafe(nil)); end # Returns an array with all classes that are < than its receiver. @@ -13260,36 +16751,34 @@ class Class < ::Module # class D < C; end # C.descendants # => [B, A, D] # - # source://activesupport//lib/active_support/core_ext/class/subclasses.rb#24 + # source://activesupport//lib/active_support/core_ext/class/subclasses.rb#19 def descendants; end - # Returns an array with the direct children of +self+. - # - # class Foo; end - # class Bar < Foo; end - # class Baz < Bar; end - # - # Foo.subclasses # => [Bar] - # - # source://activesupport//lib/active_support/core_ext/class/subclasses.rb#38 + # source://activesupport//lib/active_support/descendants_tracker.rb#59 def subclasses; end end +# source://activesupport//lib/active_support/core_ext/object/json.rb#68 +class Data + # source://activesupport//lib/active_support/core_ext/object/json.rb#69 + def as_json(options = T.unsafe(nil)); end +end + # source://activesupport//lib/active_support/core_ext/date/zones.rb#6 class Date include ::Comparable include ::DateAndTime::Zones include ::DateAndTime::Calculations - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#90 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#98 def +(other); end - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#100 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#108 def -(other); end # Allow Date to be compared with Time by converting to DateTime and relying on the <=> from there. # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#137 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#160 def <=>(other); end # Duck-types as a Date-like class. See Object#acts_like?. @@ -13302,7 +16791,21 @@ class Date # Provides precise Date calculations for years, months, and days. The +options+ parameter takes a hash with # any of these keys: :years, :months, :weeks, :days. # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#112 + # The increments are applied in order of time units from largest to smallest. + # In other words, the date is incremented first by +:years+, then by + # +:months+, then by +:weeks+, then by +:days+. This order can affect the + # result around the end of a month. For example, incrementing first by months + # then by days: + # + # Date.new(2004, 9, 30).advance(months: 1, days: 1) + # # => Sun, 31 Oct 2004 + # + # Whereas incrementing first by days then by months yields a different result: + # + # Date.new(2004, 9, 30).advance(days: 1).advance(months: 1) + # # => Mon, 01 Nov 2004 + # + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#127 def advance(options); end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) @@ -13311,37 +16814,37 @@ class Date # source://activesupport//lib/active_support/core_ext/date/calculations.rb#55 def ago(seconds); end - # source://activesupport//lib/active_support/core_ext/object/json.rb#197 + # source://activesupport//lib/active_support/core_ext/object/json.rb#211 def as_json(options = T.unsafe(nil)); end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#67 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#72 def at_beginning_of_day; end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the end of the day (23:59:59) # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#85 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#88 def at_end_of_day; end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#75 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#80 def at_midday; end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#75 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#82 def at_middle_of_day; end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#67 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#71 def at_midnight; end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#75 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#81 def at_noon; end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) @@ -13349,29 +16852,26 @@ class Date # source://activesupport//lib/active_support/core_ext/date/calculations.rb#67 def beginning_of_day; end - # No Date is blank: - # - # Date.today.blank? # => false - # - # @return [false] - # - # source://activesupport//lib/active_support/core_ext/date/blank.rb#11 - def blank?; end - # Returns a new Date where one or more of the elements have been changed according to the +options+ parameter. # The +options+ parameter is a hash with a combination of these keys: :year, :month, :day. # # Date.new(2007, 5, 12).change(day: 1) # => Date.new(2007, 5, 1) # Date.new(2007, 5, 12).change(year: 2005, month: 1) # => Date.new(2005, 1, 12) # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#128 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#143 def change(options); end # Allow Date to be compared with Time by converting to DateTime and relying on the <=> from there. # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#137 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#152 def compare_with_coercion(other); end + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#159 + def compare_without_coercion(_arg0); end + + # source://activesupport//lib/active_support/core_ext/date/conversions.rb#66 + def default_inspect; end + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the end of the day (23:59:59) # # source://activesupport//lib/active_support/core_ext/date/calculations.rb#85 @@ -13380,17 +16880,17 @@ class Date # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) # and then adds the specified number of seconds # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#61 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#64 def in(seconds); end # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005" # - # source://activesupport//lib/active_support/core_ext/date/conversions.rb#62 + # source://activesupport//lib/active_support/core_ext/date/conversions.rb#67 def inspect; end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#75 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#78 def midday; end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) @@ -13400,23 +16900,29 @@ class Date # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#67 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#70 def midnight; end # source://activesupport//lib/active_support/core_ext/date/calculations.rb#100 def minus_with_duration(other); end + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#107 + def minus_without_duration(_arg0); end + # Converts Date to a Time (or DateTime if necessary) with the time portion set to the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/date/calculations.rb#75 + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#79 def noon; end # source://activesupport//lib/active_support/core_ext/date/calculations.rb#90 def plus_with_duration(other); end + # source://activesupport//lib/active_support/core_ext/date/calculations.rb#97 + def plus_without_duration(_arg0); end + # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005" # - # source://activesupport//lib/active_support/core_ext/date/conversions.rb#62 + # source://activesupport//lib/active_support/core_ext/date/conversions.rb#63 def readable_inspect; end # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) @@ -13439,6 +16945,7 @@ class Date # date.to_fs(:long) # => "November 10, 2007" # date.to_fs(:long_ordinal) # => "November 10th, 2007" # date.to_fs(:rfc822) # => "10 Nov 2007" + # date.to_fs(:rfc2822) # => "10 Nov 2007" # date.to_fs(:iso8601) # => "2007-11-10" # # == Adding your own date formats to to_fs @@ -13450,7 +16957,7 @@ class Date # Date::DATE_FORMATS[:month_and_year] = '%B %Y' # Date::DATE_FORMATS[:short_ordinal] = ->(date) { date.strftime("%B #{date.day.ordinalize}") } # - # source://activesupport//lib/active_support/core_ext/date/conversions.rb#47 + # source://activesupport//lib/active_support/core_ext/date/conversions.rb#60 def to_formatted_s(format = T.unsafe(nil)); end # Convert to a formatted string. See DATE_FORMATS for predefined formats. @@ -13467,6 +16974,7 @@ class Date # date.to_fs(:long) # => "November 10, 2007" # date.to_fs(:long_ordinal) # => "November 10th, 2007" # date.to_fs(:rfc822) # => "10 Nov 2007" + # date.to_fs(:rfc2822) # => "10 Nov 2007" # date.to_fs(:iso8601) # => "2007-11-10" # # == Adding your own date formats to to_fs @@ -13478,12 +16986,9 @@ class Date # Date::DATE_FORMATS[:month_and_year] = '%B %Y' # Date::DATE_FORMATS[:short_ordinal] = ->(date) { date.strftime("%B #{date.day.ordinalize}") } # - # source://activesupport//lib/active_support/core_ext/date/conversions.rb#47 + # source://activesupport//lib/active_support/core_ext/date/conversions.rb#49 def to_fs(format = T.unsafe(nil)); end - # source://activesupport//lib/active_support/core_ext/date/deprecated_conversions.rb#7 - def to_s(format = T.unsafe(nil)); end - # Converts a Date instance to a Time, where the time is set to the beginning of the day. # The timezone can be either +:local+ or +:utc+ (default +:local+). # @@ -13499,7 +17004,7 @@ class Date # # @raise [ArgumentError] # - # source://activesupport//lib/active_support/core_ext/date/conversions.rb#82 + # source://activesupport//lib/active_support/core_ext/date/conversions.rb#69 def to_time(form = T.unsafe(nil)); end # Returns a string which represents the time in used time zone as DateTime @@ -13508,7 +17013,7 @@ class Date # date = Date.new(2015, 05, 23) # => Sat, 23 May 2015 # date.xmlschema # => "2015-05-23T00:00:00+04:00" # - # source://activesupport//lib/active_support/core_ext/date/conversions.rb#94 + # source://activesupport//lib/active_support/core_ext/date/conversions.rb#88 def xmlschema; end class << self @@ -13566,10 +17071,7 @@ end # source://activesupport//lib/active_support/core_ext/date/conversions.rb#9 Date::DATE_FORMATS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/core_ext/date/deprecated_conversions.rb#6 -Date::NOT_SET = T.let(T.unsafe(nil), Object) - -# source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#5 +# source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#6 module DateAndTime; end # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#7 @@ -13583,28 +17085,28 @@ module DateAndTime::Calculations # Returns a Range representing the whole day of the current date/time. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#300 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#310 def all_day; end # Returns a Range representing the whole month of the current date/time. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#311 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#321 def all_month; end # Returns a Range representing the whole quarter of the current date/time. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#316 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#326 def all_quarter; end # Returns a Range representing the whole week of the current date/time. # Week starts on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#306 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#316 def all_week(start_day = T.unsafe(nil)); end # Returns a Range representing the whole year of the current date/time. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#321 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#331 def all_year; end # Returns a new date/time at the start of the month. @@ -13617,7 +17119,7 @@ module DateAndTime::Calculations # now = DateTime.current # => Thu, 18 Jun 2015 15:23:13 +0000 # now.beginning_of_month # => Mon, 01 Jun 2015 00:00:00 +0000 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#125 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#128 def at_beginning_of_month; end # Returns a new date/time at the start of the quarter. @@ -13630,7 +17132,7 @@ module DateAndTime::Calculations # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 # now.beginning_of_quarter # => Wed, 01 Jul 2015 00:00:00 +0000 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#139 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#143 def at_beginning_of_quarter; end # Returns a new date/time representing the start of this week on the given day. @@ -13638,7 +17140,7 @@ module DateAndTime::Calculations # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. # +DateTime+ objects have their time set to 0:00. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#257 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#271 def at_beginning_of_week(start_day = T.unsafe(nil)); end # Returns a new date/time at the beginning of the year. @@ -13651,13 +17153,13 @@ module DateAndTime::Calculations # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 # now.beginning_of_year # => Thu, 01 Jan 2015 00:00:00 +0000 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#169 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#182 def at_beginning_of_year; end # Returns a new date/time representing the end of the month. # DateTime objects will have a time set to 23:59:59. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#286 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#300 def at_end_of_month; end # Returns a new date/time at the end of the quarter. @@ -13670,7 +17172,7 @@ module DateAndTime::Calculations # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 # now.end_of_quarter # => Wed, 30 Sep 2015 23:59:59 +0000 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#154 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#158 def at_end_of_quarter; end # Returns a new date/time representing the end of this week on the given day. @@ -13678,13 +17180,13 @@ module DateAndTime::Calculations # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. # DateTime objects have their time set to 23:59:59. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#273 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#286 def at_end_of_week(start_day = T.unsafe(nil)); end # Returns a new date/time representing the end of the year. # DateTime objects will have a time set to 23:59:59. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#294 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#307 def at_end_of_year; end # Returns true if the date/time falls before date_or_time. @@ -13725,7 +17227,7 @@ module DateAndTime::Calculations # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. # +DateTime+ objects have their time set to 0:00. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#257 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#267 def beginning_of_week(start_day = T.unsafe(nil)); end # Returns a new date/time at the beginning of the year. @@ -13738,7 +17240,7 @@ module DateAndTime::Calculations # now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000 # now.beginning_of_year # => Thu, 01 Jan 2015 00:00:00 +0000 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#169 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#179 def beginning_of_year; end # Returns a new date/time the specified number of days ago. @@ -13755,13 +17257,13 @@ module DateAndTime::Calculations # Week is assumed to start on +start_day+, default is # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#248 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#258 def days_to_week_start(start_day = T.unsafe(nil)); end # Returns a new date/time representing the end of the month. # DateTime objects will have a time set to 23:59:59. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#286 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#296 def end_of_month; end # Returns a new date/time at the end of the quarter. @@ -13782,13 +17284,13 @@ module DateAndTime::Calculations # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. # DateTime objects have their time set to 23:59:59. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#273 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#283 def end_of_week(start_day = T.unsafe(nil)); end # Returns a new date/time representing the end of the year. # DateTime objects will have a time set to 23:59:59. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#294 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#304 def end_of_year; end # Returns true if the date/time is in the future. @@ -13800,12 +17302,12 @@ module DateAndTime::Calculations # Short-hand for months_ago(1). # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#230 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#240 def last_month; end # Short-hand for months_ago(3). # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#235 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#248 def last_quarter; end # Returns a new date/time representing the given day in the previous week. @@ -13813,23 +17315,23 @@ module DateAndTime::Calculations # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. # DateTime objects have their time set to 0:00 unless +same_time+ is true. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#213 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#227 def last_week(start_day = T.unsafe(nil), same_time: T.unsafe(nil)); end # Returns a new date/time representing the previous weekday. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#220 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#237 def last_weekday; end # Short-hand for years_ago(1). # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#241 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#251 def last_year; end # Returns Monday of this week assuming that week starts on Monday. # +DateTime+ objects have their time set to 0:00. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#265 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#275 def monday; end # Returns a new date/time the specified number of months ago. @@ -13846,7 +17348,7 @@ module DateAndTime::Calculations # # @return [Boolean] # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#35 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#38 def next_day?; end # Returns a new date/time representing the next occurrence of the specified day of week. @@ -13855,12 +17357,12 @@ module DateAndTime::Calculations # today.next_occurring(:monday) # => Mon, 18 Dec 2017 # today.next_occurring(:thursday) # => Thu, 21 Dec 2017 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#330 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#340 def next_occurring(day_of_week); end # Short-hand for months_since(3). # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#205 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#215 def next_quarter; end # Returns a new date/time representing the given day in the next week. @@ -13880,12 +17382,12 @@ module DateAndTime::Calculations # now = DateTime.current # => Thu, 07 May 2015 13:31:16 +0000 # now.next_week # => Mon, 11 May 2015 00:00:00 +0000 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#190 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#200 def next_week(given_day_in_next_week = T.unsafe(nil), same_time: T.unsafe(nil)); end # Returns a new date/time representing the next weekday. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#196 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#206 def next_weekday; end # Returns true if the date/time does not fall on a Saturday or Sunday. @@ -13913,7 +17415,7 @@ module DateAndTime::Calculations # # @return [Boolean] # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#41 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#44 def prev_day?; end # Returns a new date/time representing the previous occurrence of the specified day of week. @@ -13922,12 +17424,12 @@ module DateAndTime::Calculations # today.prev_occurring(:monday) # => Mon, 11 Dec 2017 # today.prev_occurring(:thursday) # => Thu, 07 Dec 2017 # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#341 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#351 def prev_occurring(day_of_week); end # Short-hand for months_ago(3). # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#235 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#245 def prev_quarter; end # Returns a new date/time representing the given day in the previous week. @@ -13935,18 +17437,28 @@ module DateAndTime::Calculations # +Date.beginning_of_week+ or +config.beginning_of_week+ when set. # DateTime objects have their time set to 0:00 unless +same_time+ is true. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#213 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#223 def prev_week(start_day = T.unsafe(nil), same_time: T.unsafe(nil)); end # Returns a new date/time representing the previous weekday. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#220 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#230 def prev_weekday; end + # Returns the quarter for a date/time. + # + # Date.new(2010, 1, 31).quarter # => 1 + # Date.new(2010, 4, 12).quarter # => 2 + # Date.new(2010, 9, 15).quarter # => 3 + # Date.new(2010, 12, 25).quarter # => 4 + # + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#166 + def quarter; end + # Returns Sunday of this week assuming that week starts on Monday. # +DateTime+ objects have their time set to 23:59:59. # - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#280 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#290 def sunday; end # Returns true if the date/time is today. @@ -14002,16 +17514,16 @@ module DateAndTime::Calculations private - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#360 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#370 def copy_time_to(other); end - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#356 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#366 def days_span(day); end - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#348 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#358 def first_hour(date_or_time); end - # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#352 + # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#362 def last_hour(date_or_time); end end @@ -14021,25 +17533,16 @@ DateAndTime::Calculations::DAYS_INTO_WEEK = T.let(T.unsafe(nil), Hash) # source://activesupport//lib/active_support/core_ext/date_and_time/calculations.rb#17 DateAndTime::Calculations::WEEKEND_DAYS = T.let(T.unsafe(nil), Array) -# source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#6 +# source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#7 module DateAndTime::Compatibility - # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#14 - def preserve_timezone; end - - # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#29 + # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#21 def utc_to_local_returns_utc_offset_times; end class << self - # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#14 - def preserve_timezone; end - - # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#14 - def preserve_timezone=(val); end - - # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#29 + # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#21 def utc_to_local_returns_utc_offset_times; end - # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#29 + # source://activesupport//lib/active_support/core_ext/date_and_time/compatibility.rb#21 def utc_to_local_returns_utc_offset_times=(val); end end end @@ -14073,119 +17576,98 @@ end # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#5 class DateTime < ::Date - include ::DateAndTime::Compatibility - # Layers additional behavior on DateTime#<=> so that Time and # ActiveSupport::TimeWithZone instances can be compared with a DateTime. # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#204 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#208 def <=>(other); end - # Duck-types as a Date-like class. See Object#acts_like?. - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/date_time/acts_like.rb#8 - def acts_like_date?; end - - # Duck-types as a Time-like class. See Object#acts_like?. - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/date_time/acts_like.rb#13 - def acts_like_time?; end - # Uses Date to provide precise Time calculations for years, months, and days. # The +options+ parameter takes a hash with any of these keys: :years, # :months, :weeks, :days, :hours, # :minutes, :seconds. # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#78 + # Just like Date#advance, increments are applied in order of time units from + # largest to smallest. This order can affect the result around the end of a + # month. + # + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#82 def advance(options); end # Returns a new DateTime representing the time a number of seconds ago. # Do not use this method in combination with x.months, use months_ago instead! # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#105 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#109 def ago(seconds); end - # source://activesupport//lib/active_support/core_ext/object/json.rb#207 + # source://activesupport//lib/active_support/core_ext/object/json.rb#221 def as_json(options = T.unsafe(nil)); end # Returns a new DateTime representing the start of the day (0:00). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#118 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#127 def at_beginning_of_day; end # Returns a new DateTime representing the start of the hour (hh:00:00). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#142 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#149 def at_beginning_of_hour; end # Returns a new DateTime representing the start of the minute (hh:mm:00). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#154 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#161 def at_beginning_of_minute; end # Returns a new DateTime representing the end of the day (23:59:59). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#136 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#143 def at_end_of_day; end # Returns a new DateTime representing the end of the hour (hh:59:59). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#148 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#155 def at_end_of_hour; end # Returns a new DateTime representing the end of the minute (hh:mm:59). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#160 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#167 def at_end_of_minute; end # Returns a new DateTime representing the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#126 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#135 def at_midday; end # Returns a new DateTime representing the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#126 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#137 def at_middle_of_day; end # Returns a new DateTime representing the start of the day (0:00). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#118 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#126 def at_midnight; end # Returns a new DateTime representing the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#126 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#136 def at_noon; end # Returns a new DateTime representing the start of the day (0:00). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#118 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#122 def beginning_of_day; end # Returns a new DateTime representing the start of the hour (hh:00:00). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#142 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#146 def beginning_of_hour; end # Returns a new DateTime representing the start of the minute (hh:mm:00). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#154 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#158 def beginning_of_minute; end - # No DateTime is ever blank: - # - # DateTime.now.blank? # => false - # - # @return [false] - # - # source://activesupport//lib/active_support/core_ext/date_time/blank.rb#11 - def blank?; end - # Returns a new DateTime where one or more of the elements have been changed # according to the +options+ parameter. The time options (:hour, # :min, :sec) reset cascadingly, so if only the hour is @@ -14203,19 +17685,22 @@ class DateTime < ::Date # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#51 def change(options); end + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#61 + def default_inspect; end + # Returns a new DateTime representing the end of the day (23:59:59). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#136 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#140 def end_of_day; end # Returns a new DateTime representing the end of the hour (hh:59:59). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#148 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#152 def end_of_hour; end # Returns a new DateTime representing the end of the minute (hh:mm:59). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#160 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#164 def end_of_minute; end # Returns a formatted string of the offset from UTC, or an alternative @@ -14225,7 +17710,7 @@ class DateTime < ::Date # datetime.formatted_offset # => "-06:00" # datetime.formatted_offset(false) # => "-0600" # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#51 + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#53 def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end # Returns a Time instance of the simultaneous time in the UTC timezone. @@ -14233,12 +17718,12 @@ class DateTime < ::Date # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)) # => Mon, 21 Feb 2005 10:11:12 -0600 # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#180 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#192 def getgm; end # Returns a Time instance of the simultaneous time in the system timezone. # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#166 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#178 def getlocal(utc_offset = T.unsafe(nil)); end # Returns a Time instance of the simultaneous time in the UTC timezone. @@ -14246,7 +17731,7 @@ class DateTime < ::Date # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)) # => Mon, 21 Feb 2005 10:11:12 -0600 # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#180 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#193 def getutc; end # Returns a Time instance of the simultaneous time in the UTC timezone. @@ -14254,54 +17739,54 @@ class DateTime < ::Date # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)) # => Mon, 21 Feb 2005 10:11:12 -0600 # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#180 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#194 def gmtime; end # Returns a new DateTime representing the time a number of seconds since the # instance time. Do not use this method in combination with x.months, use # months_since instead! # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#112 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#119 def in(seconds); end # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005 14:30:00 +0000". # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#56 + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#62 def inspect; end # Returns a Time instance of the simultaneous time in the system timezone. # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#166 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#170 def localtime(utc_offset = T.unsafe(nil)); end # Returns a new DateTime representing the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#126 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#133 def midday; end # Returns a new DateTime representing the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#126 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#130 def middle_of_day; end # Returns a new DateTime representing the start of the day (0:00). # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#118 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#125 def midnight; end # Returns a new DateTime representing the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#126 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#134 def noon; end # Returns the fraction of a second as nanoseconds # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#94 + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#96 def nsec; end # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005 14:30:00 +0000". # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#56 + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#58 def readable_inspect; end # Returns the number of seconds since 00:00:00. @@ -14326,7 +17811,7 @@ class DateTime < ::Date # instance time. Do not use this method in combination with x.months, use # months_since instead! # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#112 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#116 def since(seconds); end # Returns the fraction of a second as a +Rational+ @@ -14338,14 +17823,15 @@ class DateTime < ::Date # Converts +self+ to a floating-point number of seconds, including fractional microseconds, since the Unix epoch. # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#79 + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#81 def to_f; end # Convert to a formatted string. See Time::DATE_FORMATS for predefined formats. # # This method is aliased to to_formatted_s. # - # === Examples + # ==== Examples + # # datetime = DateTime.civil(2007, 12, 4, 0, 0, 0, 0) # => Tue, 04 Dec 2007 00:00:00 +0000 # # datetime.to_fs(:db) # => "2007-12-04 00:00:00" @@ -14357,7 +17843,8 @@ class DateTime < ::Date # datetime.to_fs(:rfc822) # => "Tue, 04 Dec 2007 00:00:00 +0000" # datetime.to_fs(:iso8601) # => "2007-12-04T00:00:00+00:00" # - # == Adding your own datetime formats to to_fs + # ==== Adding your own datetime formats to +to_fs+ + # # DateTime formats are shared with Time. You can add your own to the # Time::DATE_FORMATS hash. Use the format name as the hash key and # either a strftime string or Proc instance that takes a time or @@ -14367,14 +17854,15 @@ class DateTime < ::Date # Time::DATE_FORMATS[:month_and_year] = '%B %Y' # Time::DATE_FORMATS[:short_ordinal] = lambda { |time| time.strftime("%B #{time.day.ordinalize}") } # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#35 + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#44 def to_formatted_s(format = T.unsafe(nil)); end # Convert to a formatted string. See Time::DATE_FORMATS for predefined formats. # # This method is aliased to to_formatted_s. # - # === Examples + # ==== Examples + # # datetime = DateTime.civil(2007, 12, 4, 0, 0, 0, 0) # => Tue, 04 Dec 2007 00:00:00 +0000 # # datetime.to_fs(:db) # => "2007-12-04 00:00:00" @@ -14386,7 +17874,8 @@ class DateTime < ::Date # datetime.to_fs(:rfc822) # => "Tue, 04 Dec 2007 00:00:00 +0000" # datetime.to_fs(:iso8601) # => "2007-12-04T00:00:00+00:00" # - # == Adding your own datetime formats to to_fs + # ==== Adding your own datetime formats to +to_fs+ + # # DateTime formats are shared with Time. You can add your own to the # Time::DATE_FORMATS hash. Use the format name as the hash key and # either a strftime string or Proc instance that takes a time or @@ -14396,28 +17885,17 @@ class DateTime < ::Date # Time::DATE_FORMATS[:month_and_year] = '%B %Y' # Time::DATE_FORMATS[:short_ordinal] = lambda { |time| time.strftime("%B #{time.day.ordinalize}") } # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#35 + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#37 def to_fs(format = T.unsafe(nil)); end # Converts +self+ to an integer number of seconds since the Unix epoch. # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#84 + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#86 def to_i; end - # source://activesupport//lib/active_support/core_ext/date_time/deprecated_conversions.rb#7 - def to_s(format = T.unsafe(nil)); end - - # Either return an instance of +Time+ with the same UTC offset - # as +self+ or an instance of +Time+ representing the same time - # in the local system timezone depending on the setting of - # on the setting of +ActiveSupport.to_time_preserves_timezone+. - # - # source://activesupport//lib/active_support/core_ext/date_time/compatibility.rb#15 - def to_time; end - # Returns the fraction of a second as microseconds # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#89 + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#91 def usec; end # Returns a Time instance of the simultaneous time in the UTC timezone. @@ -14425,27 +17903,27 @@ class DateTime < ::Date # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)) # => Mon, 21 Feb 2005 10:11:12 -0600 # DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc # => Mon, 21 Feb 2005 16:11:12 UTC # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#180 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#184 def utc; end # Returns +true+ if offset == 0. # # @return [Boolean] # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#193 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#197 def utc?; end # Returns the offset value in seconds. # - # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#198 + # source://activesupport//lib/active_support/core_ext/date_time/calculations.rb#202 def utc_offset; end private - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#99 + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#101 def offset_in_seconds; end - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#103 + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#105 def seconds_since_unix_epoch; end class << self @@ -14457,7 +17935,7 @@ class DateTime < ::Date # DateTime.civil_from_format :local, 2012, 12, 17 # # => Mon, 17 Dec 2012 00:00:00 +0000 # - # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#69 + # source://activesupport//lib/active_support/core_ext/date_time/conversions.rb#71 def civil_from_format(utc_or_local, year, month = T.unsafe(nil), day = T.unsafe(nil), hour = T.unsafe(nil), min = T.unsafe(nil), sec = T.unsafe(nil)); end # Returns Time.zone.now.to_datetime when Time.zone or @@ -14469,88 +17947,20 @@ class DateTime < ::Date end end -# source://activesupport//lib/active_support/core_ext/date_time/deprecated_conversions.rb#6 -DateTime::NOT_SET = T.let(T.unsafe(nil), Object) - # source://activesupport//lib/active_support/core_ext/object/try.rb#117 class Delegator < ::BasicObject include ::ActiveSupport::Tryable end -# source://activesupport//lib/active_support/core_ext/digest/uuid.rb#7 -module Digest::UUID - class << self - # source://activesupport//lib/active_support/core_ext/digest/uuid.rb#13 - def use_rfc4122_namespaced_uuids; end - - # source://activesupport//lib/active_support/core_ext/digest/uuid.rb#13 - def use_rfc4122_namespaced_uuids=(val); end - - # Generates a v5 non-random UUID (Universally Unique IDentifier). - # - # Using OpenSSL::Digest::MD5 generates version 3 UUIDs; OpenSSL::Digest::SHA1 generates version 5 UUIDs. - # uuid_from_hash always generates the same UUID for a given name and namespace combination. - # - # See RFC 4122 for details of UUID at: https://www.ietf.org/rfc/rfc4122.txt - # - # source://activesupport//lib/active_support/core_ext/digest/uuid.rb#21 - def uuid_from_hash(hash_class, namespace, name); end - - # Convenience method for uuid_from_hash using OpenSSL::Digest::MD5. - # - # source://activesupport//lib/active_support/core_ext/digest/uuid.rb#44 - def uuid_v3(uuid_namespace, name); end - - # Convenience method for SecureRandom.uuid. - # - # source://activesupport//lib/active_support/core_ext/digest/uuid.rb#54 - def uuid_v4; end - - # Convenience method for uuid_from_hash using OpenSSL::Digest::SHA1. - # - # source://activesupport//lib/active_support/core_ext/digest/uuid.rb#49 - def uuid_v5(uuid_namespace, name); end - - private - - # source://activesupport//lib/active_support/core_ext/digest/uuid.rb#58 - def pack_uuid_namespace(namespace); end - end -end - -# source://activesupport//lib/active_support/core_ext/digest/uuid.rb#8 -Digest::UUID::DNS_NAMESPACE = T.let(T.unsafe(nil), String) - -# source://activesupport//lib/active_support/core_ext/digest/uuid.rb#10 -Digest::UUID::OID_NAMESPACE = T.let(T.unsafe(nil), String) - -# source://activesupport//lib/active_support/core_ext/digest/uuid.rb#9 -Digest::UUID::URL_NAMESPACE = T.let(T.unsafe(nil), String) +module ERB::Escape; end -# source://activesupport//lib/active_support/core_ext/digest/uuid.rb#11 -Digest::UUID::X500_NAMESPACE = T.let(T.unsafe(nil), String) - -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#8 +# source://activesupport//lib/active_support/core_ext/erb/util.rb#39 module ERB::Util - private - - # A utility method for escaping HTML tag characters. - # This method is also aliased as h. - # - # puts html_escape('is a > 0 & a < 10?') - # # => is a > 0 & a < 10? - # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#27 - def h(s); end + include ::ActiveSupport::CoreExt::ERBUtil + include ::ActiveSupport::CoreExt::ERBUtilPrivate + extend ::ActiveSupport::CoreExt::ERBUtil - # A utility method for escaping HTML tag characters. - # This method is also aliased as h. - # - # puts html_escape('is a > 0 & a < 10?') - # # => is a > 0 & a < 10? - # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#27 - def html_escape(s); end + private # A utility method for escaping HTML without affecting existing escaped entities. # @@ -14560,7 +17970,7 @@ module ERB::Util # html_escape_once('<< Accept & Checkout') # # => "<< Accept & Checkout" # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#58 + # source://activesupport//lib/active_support/core_ext/erb/util.rb#63 def html_escape_once(s); end # A utility method for escaping HTML entities in JSON strings. Specifically, the @@ -14619,15 +18029,9 @@ module ERB::Util # JSON gem, do not provide this kind of protection by default; also some gems # might override +to_json+ to bypass Active Support's encoder). # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#120 + # source://activesupport//lib/active_support/core_ext/erb/util.rb#124 def json_escape(s); end - # HTML escapes strings but doesn't wrap them with an ActiveSupport::SafeBuffer. - # This method is not for public consumption! Seriously! - # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#41 - def unwrapped_html_escape(s); end - # A utility method for escaping XML names of tags and names of attributes. # # xml_name_escape('1 < 2 & 3') @@ -14635,28 +18039,10 @@ module ERB::Util # # It follows the requirements of the specification: https://www.w3.org/TR/REC-xml/#NT-Name # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#133 + # source://activesupport//lib/active_support/core_ext/erb/util.rb#142 def xml_name_escape(name); end class << self - # A utility method for escaping HTML tag characters. - # This method is also aliased as h. - # - # puts html_escape('is a > 0 & a < 10?') - # # => is a > 0 & a < 10? - # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#27 - def h(s); end - - # A utility method for escaping HTML tag characters. - # This method is also aliased as h. - # - # puts html_escape('is a > 0 & a < 10?') - # # => is a > 0 & a < 10? - # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#27 - def html_escape(s); end - # A utility method for escaping HTML without affecting existing escaped entities. # # html_escape_once('1 < 2 & 3') @@ -14665,7 +18051,7 @@ module ERB::Util # html_escape_once('<< Accept & Checkout') # # => "<< Accept & Checkout" # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#58 + # source://activesupport//lib/active_support/core_ext/erb/util.rb#67 def html_escape_once(s); end # A utility method for escaping HTML entities in JSON strings. Specifically, the @@ -14724,13 +18110,16 @@ module ERB::Util # JSON gem, do not provide this kind of protection by default; also some gems # might override +to_json+ to bypass Active Support's encoder). # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#120 + # source://activesupport//lib/active_support/core_ext/erb/util.rb#134 def json_escape(s); end - # HTML escapes strings but doesn't wrap them with an ActiveSupport::SafeBuffer. - # This method is not for public consumption! Seriously! + # Tokenizes a line of ERB. This is really just for error reporting and + # nobody should use it. # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#41 + # source://activesupport//lib/active_support/core_ext/erb/util.rb#161 + def tokenize(source); end + + # source://activesupport//lib/active_support/core_ext/erb/util.rb#10 def unwrapped_html_escape(s); end # A utility method for escaping XML names of tags and names of attributes. @@ -14740,42 +18129,43 @@ module ERB::Util # # It follows the requirements of the specification: https://www.w3.org/TR/REC-xml/#NT-Name # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#133 + # source://activesupport//lib/active_support/core_ext/erb/util.rb#157 def xml_name_escape(name); end end end -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#9 +# source://activesupport//lib/active_support/core_ext/erb/util.rb#40 ERB::Util::HTML_ESCAPE = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#11 +# source://activesupport//lib/active_support/core_ext/erb/util.rb#41 ERB::Util::HTML_ESCAPE_ONCE_REGEXP = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#10 -ERB::Util::JSON_ESCAPE = T.let(T.unsafe(nil), Hash) +# source://activesupport//lib/active_support/core_ext/erb/util.rb#49 +ERB::Util::INVALID_TAG_NAME_FOLLOWING_REGEXP = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#12 -ERB::Util::JSON_ESCAPE_REGEXP = T.let(T.unsafe(nil), Regexp) +# source://activesupport//lib/active_support/core_ext/erb/util.rb#47 +ERB::Util::INVALID_TAG_NAME_START_REGEXP = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#19 -ERB::Util::TAG_NAME_FOLLOWING_REGEXP = T.let(T.unsafe(nil), Regexp) +# source://activesupport//lib/active_support/core_ext/erb/util.rb#50 +ERB::Util::SAFE_XML_TAG_NAME_REGEXP = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#20 -ERB::Util::TAG_NAME_REPLACEMENT_CHAR = T.let(T.unsafe(nil), String) +# source://activesupport//lib/active_support/core_ext/erb/util.rb#48 +ERB::Util::TAG_NAME_FOLLOWING_CODEPOINTS = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#18 -ERB::Util::TAG_NAME_START_REGEXP = T.let(T.unsafe(nil), Regexp) +# source://activesupport//lib/active_support/core_ext/erb/util.rb#51 +ERB::Util::TAG_NAME_REPLACEMENT_CHAR = T.let(T.unsafe(nil), String) # Following XML requirements: https://www.w3.org/TR/REC-xml/#NT-Name # -# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#15 -ERB::Util::TAG_NAME_START_REGEXP_SET = T.let(T.unsafe(nil), String) +# source://activesupport//lib/active_support/core_ext/erb/util.rb#44 +ERB::Util::TAG_NAME_START_CODEPOINTS = T.let(T.unsafe(nil), String) -# source://activesupport//lib/active_support/core_ext/object/json.rb#139 +# source://activesupport//lib/active_support/core_ext/object/json.rb#145 module Enumerable + include ::ActiveSupport::ToJsonWithActiveSupportEncoder extend ::ActiveSupport::EnumerableCoreExt::Constants - # source://activesupport//lib/active_support/core_ext/object/json.rb#140 + # source://activesupport//lib/active_support/core_ext/object/json.rb#146 def as_json(options = T.unsafe(nil)); end # Returns a new +Array+ without the blank items. @@ -14784,15 +18174,15 @@ module Enumerable # [1, "", nil, 2, " ", [], {}, false, true].compact_blank # # => [1, 2, true] # - # Set.new([nil, "", 1, 2]) - # # => [2, 1] (or [1, 2]) + # Set.new([nil, "", 1, false]).compact_blank + # # => [1] # # When called on a +Hash+, returns a new +Hash+ without the blank values. # # { a: "", b: 1, c: nil, d: [], e: false, f: true }.compact_blank # # => { b: 1, f: true } # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#235 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#184 def compact_blank; end # The negative of the Enumerable#include?. Returns +true+ if the @@ -14800,7 +18190,7 @@ module Enumerable # # @return [Boolean] # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#169 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#118 def exclude?(object); end # Returns a copy of the enumerable excluding the specified elements. @@ -14814,7 +18204,7 @@ module Enumerable # {foo: 1, bar: 2, baz: 3}.excluding :bar # # => {foo: 1, baz: 3} # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#183 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#132 def excluding(*elements); end # Returns a new +Array+ where the order has been set to that provided in the +series+, based on the +key+ of the @@ -14824,10 +18214,11 @@ module Enumerable # # => [ Person.find(1), Person.find(5), Person.find(3) ] # # If the +series+ include keys that have no corresponding element in the Enumerable, these are ignored. - # If the Enumerable has additional elements that aren't named in the +series+, these are not included in the result. + # If the Enumerable has additional elements that aren't named in the +series+, these are not included in the result, unless + # the +filter+ option is set to +false+. # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#247 - def in_order_of(key, series); end + # source://activesupport//lib/active_support/core_ext/enumerable.rb#197 + def in_order_of(key, series, filter: T.unsafe(nil)); end # Returns a new array that includes the passed elements. # @@ -14837,7 +18228,7 @@ module Enumerable # ["David", "Rafael"].including %w[ Aaron Todd ] # # => ["David", "Rafael", "Aaron", "Todd"] # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#163 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#112 def including(*elements); end # Convert an enumerable to a hash, using the block result as the key and the @@ -14849,7 +18240,7 @@ module Enumerable # people.index_by { |person| "#{person.first_name} #{person.last_name}" } # # => { "Chade- Fowlersburg-e" => , "David Heinemeier Hansson" => , ...} # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#103 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#52 def index_by; end # Convert an enumerable to a hash, using the element as the key and the block @@ -14866,7 +18257,7 @@ module Enumerable # %i( created_at updated_at ).index_with(Time.now) # # => { created_at: 2020-03-09 22:31:47, updated_at: 2020-03-09 22:31:47 } # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#126 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#75 def index_with(default = T.unsafe(nil)); end # Returns +true+ if the enumerable has more than 1 element. Functionally @@ -14876,7 +18267,7 @@ module Enumerable # # @return [Boolean] # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#144 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#93 def many?; end # Calculates the maximum from the extracted elements. @@ -14884,7 +18275,7 @@ module Enumerable # payments = [Payment.new(5), Payment.new(15), Payment.new(10)] # payments.maximum(:price) # => 15 # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#52 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#40 def maximum(key); end # Calculates the minimum from the extracted elements. @@ -14892,7 +18283,7 @@ module Enumerable # payments = [Payment.new(5), Payment.new(15), Payment.new(10)] # payments.minimum(:price) # => 5 # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#44 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#32 def minimum(key); end # Extract the given key from the first element in the enumerable. @@ -14903,7 +18294,7 @@ module Enumerable # [{ id: 1, name: "David" }, { id: 2, name: "Rafael" }].pick(:id, :name) # # => [1, "David"] # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#212 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#161 def pick(*keys); end # Extract the given key from each element in the enumerable. @@ -14914,41 +18305,19 @@ module Enumerable # [{ id: 1, name: "David" }, { id: 2, name: "Rafael" }].pluck(:id, :name) # # => [[1, "David"], [2, "Rafael"]] # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#196 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#145 def pluck(*keys); end # Returns the sole item in the enumerable. If there are no items, or more - # than one item, raises +Enumerable::SoleItemExpectedError+. + # than one item, raises Enumerable::SoleItemExpectedError. # # ["x"].sole # => "x" # Set.new.sole # => Enumerable::SoleItemExpectedError: no item found # { a: 1, b: 2 }.sole # => Enumerable::SoleItemExpectedError: multiple items found # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#257 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#211 def sole; end - # Calculates a sum from the elements. - # - # payments.sum { |p| p.price * p.tax_rate } - # payments.sum(&:price) - # - # The latter is a shortcut for: - # - # payments.inject(0) { |sum, p| sum + p.price } - # - # It can also calculate the sum without the use of a block. - # - # [5, 15, 10].sum # => 30 - # ['foo', 'bar'].sum('') # => "foobar" - # [[1, 2], [3, 1, 5]].sum([]) # => [1, 2, 3, 1, 5] - # - # The default sum of an empty list is zero. You can override this default: - # - # [].sum(Payment.new(0)) { |i| i.amount } # => Payment.new(0) - # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#74 - def sum(identity = T.unsafe(nil), &block); end - # Returns a copy of the enumerable excluding the specified elements. # # ["David", "Rafael", "Aaron", "Todd"].excluding "Aaron", "Todd" @@ -14960,7 +18329,7 @@ module Enumerable # {foo: 1, bar: 2, baz: 3}.excluding :bar # # => {foo: 1, baz: 3} # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#183 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#136 def without(*elements); end end @@ -14970,15 +18339,15 @@ end # source://activesupport//lib/active_support/core_ext/enumerable.rb#21 class Enumerable::SoleItemExpectedError < ::StandardError; end -# source://activesupport//lib/active_support/core_ext/object/json.rb#240 +# source://activesupport//lib/active_support/core_ext/object/json.rb#263 class Exception - # source://activesupport//lib/active_support/core_ext/object/json.rb#241 + # source://activesupport//lib/active_support/core_ext/object/json.rb#264 def as_json(options = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/object/blank.rb#61 +# source://activesupport//lib/active_support/core_ext/object/to_query.rb#38 class FalseClass - # source://activesupport//lib/active_support/core_ext/object/json.rb#81 + # source://activesupport//lib/active_support/core_ext/object/json.rb#87 def as_json(options = T.unsafe(nil)); end # +false+ is blank: @@ -14987,35 +18356,64 @@ class FalseClass # # @return [true] # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#67 + # source://activesupport//lib/active_support/core_ext/object/blank.rb#71 def blank?; end + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#75 + def present?; end + # Returns +self+. # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#34 + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#40 def to_param; end end -# source://activesupport//lib/active_support/core_ext/object/json.rb#110 -class Float < ::Numeric - include ::ActiveSupport::NumericWithFormat - include ::ActiveSupport::DeprecatedNumericWithFormat +# source://activesupport//lib/active_support/core_ext/file/atomic.rb#5 +class File < ::IO + class << self + # Write to a file atomically. Useful for situations where you don't + # want other processes or threads to see half-written files. + # + # File.atomic_write('important.file') do |file| + # file.write('hello') + # end + # + # This method needs to create a temporary file. By default it will create it + # in the same directory as the destination file. If you don't like this + # behavior you can provide a different directory but it must be on the + # same physical filesystem as the file you're trying to write. + # + # File.atomic_write('/data/something.important', '/data/tmp') do |file| + # file.write('hello') + # end + # + # source://activesupport//lib/active_support/core_ext/file/atomic.rb#21 + def atomic_write(file_name, temp_dir = T.unsafe(nil)); end + + # Private utility method. + # + # source://activesupport//lib/active_support/core_ext/file/atomic.rb#56 + def probe_stat_in(dir); end + end +end +# source://activesupport//lib/active_support/core_ext/object/json.rb#116 +class Float < ::Numeric # Encoding Infinity or NaN to JSON should return "null". The default returns # "Infinity" or "NaN" which are not valid JSON. # - # source://activesupport//lib/active_support/core_ext/object/json.rb#113 + # source://activesupport//lib/active_support/core_ext/object/json.rb#119 def as_json(options = T.unsafe(nil)); end - - # source://activesupport//lib/active_support/core_ext/numeric/deprecated_conversions.rb#5 - def to_s(format = T.unsafe(nil), options = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/hash/deep_merge.rb#3 +# source://activesupport//lib/active_support/core_ext/hash/deep_merge.rb#5 class Hash include ::Enumerable + include ::ActiveSupport::DeepMergeable - # source://activesupport//lib/active_support/core_ext/object/json.rb#164 + # source://activesupport//lib/active_support/core_ext/object/json.rb#175 def as_json(options = T.unsafe(nil)); end # Validates all keys in a hash match *valid_keys, raising @@ -15031,9 +18429,19 @@ class Hash # source://activesupport//lib/active_support/core_ext/hash/keys.rb#48 def assert_valid_keys(*valid_keys); end + # A hash is blank if it's empty: + # + # {}.blank? # => true + # { key: 'value' }.blank? # => false + # + # @return [true, false] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#116 + def blank?; end + # Hash#reject has its own definition, so this needs one too. # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#268 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#234 def compact_blank; end # Removes all blank values from the +Hash+ in place and returns self. @@ -15043,7 +18451,7 @@ class Hash # h.compact_blank! # # => { b: 1, f: true } # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#278 + # source://activesupport//lib/active_support/core_ext/enumerable.rb#244 def compact_blank!; end # Returns a deep copy of hash. @@ -15058,28 +18466,10 @@ class Hash # source://activesupport//lib/active_support/core_ext/object/deep_dup.rb#43 def deep_dup; end - # Returns a new hash with +self+ and +other_hash+ merged recursively. - # - # h1 = { a: true, b: { c: [1, 2, 3] } } - # h2 = { a: false, b: { x: [3, 4, 5] } } - # - # h1.deep_merge(h2) # => { a: false, b: { c: [1, 2, 3], x: [3, 4, 5] } } - # - # Like with Hash#merge in the standard library, a block can be provided - # to merge values: - # - # h1 = { a: 100, b: 200, c: { c1: 100 } } - # h2 = { b: 250, c: { c1: 200 } } - # h1.deep_merge(h2) { |key, this_val, other_val| this_val + other_val } - # # => { a: 100, b: 450, c: { c1: 300 } } - # - # source://activesupport//lib/active_support/core_ext/hash/deep_merge.rb#18 - def deep_merge(other_hash, &block); end - - # Same as +deep_merge+, but modifies +self+. + # @return [Boolean] # - # source://activesupport//lib/active_support/core_ext/hash/deep_merge.rb#23 - def deep_merge!(other_hash, &block); end + # source://activesupport//lib/active_support/core_ext/hash/deep_merge.rb#40 + def deep_merge?(other); end # Returns a new hash with all keys converted to strings. # This includes the keys from the root hash and from all @@ -15123,58 +18513,27 @@ class Hash # This includes the keys from the root hash and from all # nested hashes and arrays. # - # hash = { person: { name: 'Rob', age: '28' } } + # hash = { person: { name: 'Rob', age: '28' } } # - # hash.deep_transform_keys{ |key| key.to_s.upcase } - # # => {"PERSON"=>{"NAME"=>"Rob", "AGE"=>"28"}} + # hash.deep_transform_keys{ |key| key.to_s.upcase } + # # => {"PERSON"=>{"NAME"=>"Rob", "AGE"=>"28"}} # # source://activesupport//lib/active_support/core_ext/hash/keys.rb#65 def deep_transform_keys(&block); end - # Destructively converts all keys by using the block operation. - # This includes the keys from the root hash and from all - # nested hashes and arrays. - # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#72 - def deep_transform_keys!(&block); end - - # Returns a new hash with all values converted by the block operation. - # This includes the values from the root hash and from all - # nested hashes and arrays. - # - # hash = { person: { name: 'Rob', age: '28' } } - # - # hash.deep_transform_values{ |value| value.to_s.upcase } - # # => {person: {name: "ROB", age: "28"}} - # - # source://activesupport//lib/active_support/core_ext/hash/deep_transform_values.rb#12 - def deep_transform_values(&block); end - - # Destructively converts all values by using the block operation. - # This includes the values from the root hash and from all - # nested hashes and arrays. - # - # source://activesupport//lib/active_support/core_ext/hash/deep_transform_values.rb#19 - def deep_transform_values!(&block); end - - # Returns a hash that includes everything except given keys. - # hash = { a: true, b: false, c: nil } - # hash.except(:c) # => { a: true, b: false } - # hash.except(:a, :b) # => { c: nil } - # hash # => { a: true, b: false, c: nil } - # - # This is useful for limiting a set of parameters to everything but a few known toggles: - # @person.update(params[:person].except(:admin)) + # Destructively converts all keys by using the block operation. + # This includes the keys from the root hash and from all + # nested hashes and arrays. # - # source://activesupport//lib/active_support/core_ext/hash/except.rb#12 - def except(*keys); end + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#72 + def deep_transform_keys!(&block); end # Removes the given keys from hash and returns it. # hash = { a: true, b: false, c: nil } # hash.except!(:c) # => { a: true, b: false } # hash # => { a: true, b: false } # - # source://activesupport//lib/active_support/core_ext/hash/except.rb#20 + # source://activesupport//lib/active_support/core_ext/hash/except.rb#8 def except!(*keys); end # Removes and returns the key/value pairs matching the given keys. @@ -15211,9 +18570,14 @@ class Hash # { a: b }.with_indifferent_access['a'] # calls b.nested_under_indifferent_access # # => {"b"=>1} # - # source://activesupport//lib/active_support/core_ext/hash/indifferent_access.rb#9 + # source://activesupport//lib/active_support/core_ext/hash/indifferent_access.rb#23 def nested_under_indifferent_access; end + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#118 + def present?; end + # Merges the caller into +other_hash+. For example, # # options = options.reverse_merge(size: 25, velocity: 10) @@ -15235,7 +18599,7 @@ class Hash # Destructive +reverse_merge+. # - # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#20 + # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#23 def reverse_update(other_hash); end # Replaces the hash with only the given keys. @@ -15289,13 +18653,13 @@ class Hash # hash.symbolize_keys # # => {:name=>"Rob", :age=>"28"} # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#27 + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#30 def to_options; end # Destructively converts all keys to symbols, as long as they respond # to +to_sym+. Same as +symbolize_keys+, but modifies +self+. # - # source://activesupport//lib/active_support/core_ext/hash/keys.rb#34 + # source://activesupport//lib/active_support/core_ext/hash/keys.rb#37 def to_options!; end # Returns a string representation of the receiver suitable for use as a URL @@ -15312,9 +18676,7 @@ class Hash # The string pairs "key=value" that conform the query string # are sorted lexicographically in ascending order. # - # This method is also aliased as +to_param+. - # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#77 + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#92 def to_param(namespace = T.unsafe(nil)); end # Returns a string representation of the receiver suitable for use as a URL @@ -15331,9 +18693,7 @@ class Hash # The string pairs "key=value" that conform the query string # are sorted lexicographically in ascending order. # - # This method is also aliased as +to_param+. - # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#77 + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#81 def to_query(namespace = T.unsafe(nil)); end # Returns a string containing an XML representation of its receiver: @@ -15395,7 +18755,7 @@ class Hash # # By default the root node is "hash", but that's configurable via the :root option. # - # The default XML builder is a fresh instance of Builder::XmlMarkup. You can + # The default XML builder is a fresh instance of +Builder::XmlMarkup+. You can # configure your own builder with the :builder option. The method also accepts # options like :dasherize and friends, they are forwarded to the builder. # @@ -15413,12 +18773,12 @@ class Hash # This is particularly useful for initializing an options hash # with default values. # - # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#14 + # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#17 def with_defaults(other_hash); end # Destructive +reverse_merge+. # - # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#20 + # source://activesupport//lib/active_support/core_ext/hash/reverse_merge.rb#24 def with_defaults!(other_hash); end # Returns an ActiveSupport::HashWithIndifferentAccess out of its receiver: @@ -15438,14 +18798,6 @@ class Hash # source://activesupport//lib/active_support/core_ext/hash/keys.rb#129 def _deep_transform_keys_in_object!(object, &block); end - # Support methods for deep transforming nested hashes and arrays. - # - # source://activesupport//lib/active_support/core_ext/hash/deep_transform_values.rb#25 - def _deep_transform_values_in_object(object, &block); end - - # source://activesupport//lib/active_support/core_ext/hash/deep_transform_values.rb#36 - def _deep_transform_values_in_object!(object, &block); end - class << self # Builds a Hash from XML just like Hash.from_xml, but also allows Symbol and YAML. # @@ -15494,120 +18846,129 @@ end # :stopdoc: # -# source://activesupport//lib/active_support/hash_with_indifferent_access.rb#425 +# source://activesupport//lib/active_support/hash_with_indifferent_access.rb#464 HashWithIndifferentAccess = ActiveSupport::HashWithIndifferentAccess # :enddoc: # -# source://activesupport//lib/active_support/i18n_railtie.rb#8 -module I18n - class << self - # source://i18n/1.12.0/lib/i18n/backend/cache.rb#64 - def cache_key_digest; end - - # source://i18n/1.12.0/lib/i18n/backend/cache.rb#68 - def cache_key_digest=(key_digest); end - - # source://i18n/1.12.0/lib/i18n/backend/cache.rb#56 - def cache_namespace; end - - # source://i18n/1.12.0/lib/i18n/backend/cache.rb#60 - def cache_namespace=(namespace); end - - # source://i18n/1.12.0/lib/i18n/backend/cache.rb#48 - def cache_store; end - - # source://i18n/1.12.0/lib/i18n/backend/cache.rb#52 - def cache_store=(store); end - - # source://i18n/1.12.0/lib/i18n/backend/fallbacks.rb#17 - def fallbacks; end - - # source://i18n/1.12.0/lib/i18n/backend/fallbacks.rb#23 - def fallbacks=(fallbacks); end - - # source://i18n/1.12.0/lib/i18n/interpolate/ruby.rb#16 - def interpolate(string, values); end - - # source://i18n/1.12.0/lib/i18n/interpolate/ruby.rb#22 - def interpolate_hash(string, values); end - - # source://i18n/1.12.0/lib/i18n.rb#37 - def new_double_nested_cache; end - - # source://i18n/1.12.0/lib/i18n/backend/cache.rb#72 - def perform_caching?; end - - # source://i18n/1.12.0/lib/i18n.rb#45 - def reserve_key(key); end - - # source://i18n/1.12.0/lib/i18n.rb#50 - def reserved_keys_pattern; end - end -end - -# source://i18n/1.12.0/lib/i18n/interpolate/ruby.rb#5 -I18n::DEFAULT_INTERPOLATION_PATTERNS = T.let(T.unsafe(nil), Array) - -# source://i18n/1.12.0/lib/i18n.rb#35 -I18n::EMPTY_HASH = T.let(T.unsafe(nil), Hash) - -# source://i18n/1.12.0/lib/i18n/interpolate/ruby.rb#10 -I18n::INTERPOLATION_PATTERN = T.let(T.unsafe(nil), Regexp) - -# source://i18n/1.12.0/lib/i18n/backend/key_value.rb#21 -I18n::JSON = ActiveSupport::JSON - -# source://i18n/1.12.0/lib/i18n.rb#19 -I18n::RESERVED_KEYS = T.let(T.unsafe(nil), Array) - # source://activesupport//lib/active_support/i18n_railtie.rb#9 +module I18n; end + +# source://activesupport//lib/active_support/i18n_railtie.rb#10 class I18n::Railtie < ::Rails::Railtie class << self - # source://activesupport//lib/active_support/i18n_railtie.rb#78 - def forward_raise_on_missing_translations_config(app); end - - # source://activesupport//lib/active_support/i18n_railtie.rb#88 + # source://activesupport//lib/active_support/i18n_railtie.rb#103 def include_fallbacks_module; end - # source://activesupport//lib/active_support/i18n_railtie.rb#92 + # source://activesupport//lib/active_support/i18n_railtie.rb#107 def init_fallbacks(fallbacks); end # Setup i18n configuration. # - # source://activesupport//lib/active_support/i18n_railtie.rb#32 + # source://activesupport//lib/active_support/i18n_railtie.rb#36 def initialize_i18n(app); end - # source://activesupport//lib/active_support/i18n_railtie.rb#108 + # source://activesupport//lib/active_support/i18n_railtie.rb#84 + def setup_raise_on_missing_translations_config(app, strict); end + + # source://activesupport//lib/active_support/i18n_railtie.rb#123 def validate_fallbacks(fallbacks); end - # source://activesupport//lib/active_support/i18n_railtie.rb#119 + # source://activesupport//lib/active_support/i18n_railtie.rb#134 def watched_dirs_with_extensions(paths); end end end -# source://i18n/1.12.0/lib/i18n/version.rb#4 -I18n::VERSION = T.let(T.unsafe(nil), String) - -# source://activesupport//lib/active_support/core_ext/object/json.rb#145 +# source://activesupport//lib/active_support/core_ext/object/json.rb#151 class IO include ::Enumerable include ::File::Constants - # source://activesupport//lib/active_support/core_ext/object/json.rb#146 + # source://activesupport//lib/active_support/core_ext/object/json.rb#152 def as_json(options = T.unsafe(nil)); end end -class IO::ConsoleMode - def echo=(_arg0); end - def raw(*_arg0); end - def raw!(*_arg0); end +class IO::Buffer + include ::Comparable + + def initialize(*_arg0); end + + def &(_arg0); end + def <=>(_arg0); end + def ^(_arg0); end + def and!(_arg0); end + def clear(*_arg0); end + def copy(*_arg0); end + def each(*_arg0); end + def each_byte(*_arg0); end + def empty?; end + def external?; end + def free; end + def get_string(*_arg0); end + def get_value(_arg0, _arg1); end + def get_values(_arg0, _arg1); end + def hexdump(*_arg0); end + def inspect; end + def internal?; end + def locked; end + def locked?; end + def mapped?; end + def not!; end + def null?; end + def or!(_arg0); end + def pread(*_arg0); end + def private?; end + def pwrite(*_arg0); end + def read(*_arg0); end + def readonly?; end + def resize(_arg0); end + def set_string(*_arg0); end + def set_value(_arg0, _arg1, _arg2); end + def set_values(_arg0, _arg1, _arg2); end + def shared?; end + def size; end + def slice(*_arg0); end + def to_s; end + def transfer; end + def valid?; end + def values(*_arg0); end + def write(*_arg0); end + def xor!(_arg0); end + def |(_arg0); end + def ~; end private def initialize_copy(_arg0); end + + class << self + def for(_arg0); end + def map(*_arg0); end + def size_of(_arg0); end + def string(_arg0); end + end end +class IO::Buffer::AccessError < ::RuntimeError; end +class IO::Buffer::AllocationError < ::RuntimeError; end +IO::Buffer::BIG_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::DEFAULT_SIZE = T.let(T.unsafe(nil), Integer) +IO::Buffer::EXTERNAL = T.let(T.unsafe(nil), Integer) +IO::Buffer::HOST_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::INTERNAL = T.let(T.unsafe(nil), Integer) +class IO::Buffer::InvalidatedError < ::RuntimeError; end +IO::Buffer::LITTLE_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::LOCKED = T.let(T.unsafe(nil), Integer) +class IO::Buffer::LockedError < ::RuntimeError; end +IO::Buffer::MAPPED = T.let(T.unsafe(nil), Integer) +class IO::Buffer::MaskError < ::ArgumentError; end +IO::Buffer::NETWORK_ENDIAN = T.let(T.unsafe(nil), Integer) +IO::Buffer::PAGE_SIZE = T.let(T.unsafe(nil), Integer) +IO::Buffer::PRIVATE = T.let(T.unsafe(nil), Integer) +IO::Buffer::READONLY = T.let(T.unsafe(nil), Integer) +IO::Buffer::SHARED = T.let(T.unsafe(nil), Integer) +class IO::ConsoleMode; end + class IO::EAGAINWaitReadable < ::Errno::EAGAIN include ::IO::WaitReadable end @@ -15626,23 +18987,17 @@ end IO::EWOULDBLOCKWaitReadable = IO::EAGAINWaitReadable IO::EWOULDBLOCKWaitWritable = IO::EAGAINWaitWritable - -# source://activesupport//lib/active_support/core_ext/object/json.rb#228 -class IPAddr - # source://activesupport//lib/active_support/core_ext/object/json.rb#229 - def as_json(options = T.unsafe(nil)); end -end +IO::PRIORITY = T.let(T.unsafe(nil), Integer) +IO::READABLE = T.let(T.unsafe(nil), Integer) +IO::WRITABLE = T.let(T.unsafe(nil), Integer) # source://activesupport//lib/active_support/core_ext/integer/time.rb#6 class Integer < ::Numeric - include ::ActiveSupport::NumericWithFormat - include ::ActiveSupport::DeprecatedNumericWithFormat - # Returns a Duration instance matching the number of months provided. # # 2.months # => 2 months # - # source://activesupport//lib/active_support/core_ext/integer/time.rb#10 + # source://activesupport//lib/active_support/core_ext/integer/time.rb#13 def month; end # Returns a Duration instance matching the number of months provided. @@ -15652,14 +19007,11 @@ class Integer < ::Numeric # source://activesupport//lib/active_support/core_ext/integer/time.rb#10 def months; end - # source://activesupport//lib/active_support/core_ext/numeric/deprecated_conversions.rb#5 - def to_s(format = T.unsafe(nil), options = T.unsafe(nil)); end - # Returns a Duration instance matching the number of years provided. # # 2.years # => 2 years # - # source://activesupport//lib/active_support/core_ext/integer/time.rb#18 + # source://activesupport//lib/active_support/core_ext/integer/time.rb#21 def year; end # Returns a Duration instance matching the number of years provided. @@ -15670,6 +19022,8 @@ class Integer < ::Numeric def years; end end +Integer::GMP_VERSION = T.let(T.unsafe(nil), String) + # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#3 module Kernel private @@ -15717,9 +19071,6 @@ module Kernel # source://activesupport//lib/active_support/core_ext/kernel/reporting.rb#20 def enable_warnings(&block); end - # source://activesupport//lib/active_support/fork_tracker.rb#16 - def fork(*_arg0, &_arg1); end - # Sets $VERBOSE to +nil+ for the duration of the block and back to its original # value afterwards. # @@ -15752,37 +19103,19 @@ module Kernel end end -# source://activesupport//lib/active_support/core_ext/load_error.rb#3 -class LoadError < ::ScriptError - # Returns true if the given path name (except perhaps for the ".rb" - # extension) is the missing file which caused the exception to be raised. - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/load_error.rb#6 - def is_missing?(location); end -end - -# source://activesupport//lib/active_support/core_ext/object/duplicable.rb#31 -class Method - # Methods are not duplicable: - # - # method(:puts).duplicable? # => false - # method(:puts).dup # => TypeError: allocator undefined for Method - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/object/duplicable.rb#36 - def duplicable?; end -end - -# == Attribute Accessors +# == Attribute Accessors per Thread # # Extends the module object with class/module and instance accessors for # class/module attributes, just like the native attr* accessors for instance -# attributes. +# attributes, but does so on a per-thread basis. +# +# So the values are scoped within the Thread.current space under the class name +# of the module. +# +# Note that it can also be scoped per-fiber if +Rails.application.config.active_support.isolation_level+ +# is set to +:fiber+. # -# source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#8 +# source://activesupport//lib/active_support/core_ext/module/delegation.rb#3 class Module include ::Module::Concerning @@ -15842,7 +19175,7 @@ class Module # Declares an attribute reader and writer backed by an internally-named instance # variable. # - # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#16 + # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#20 def attr_internal(*attrs); end # Declares an attribute reader and writer backed by an internally-named instance @@ -15918,6 +19251,7 @@ class Module # # module HairColors # mattr_accessor :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_accessor(:hair_styles) { [:long, :short] } # end # # class Person @@ -15925,8 +19259,9 @@ class Module # end # # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] + # Person.class_variable_get("@@hair_styles") # => [:long, :short] # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#202 + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#213 def cattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), &blk); end # Defines a class attribute and creates a class and instance reader methods. @@ -15966,6 +19301,7 @@ class Module # # module HairColors # mattr_reader :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_reader(:hair_styles) { [:long, :short] } # end # # class Person @@ -15973,10 +19309,11 @@ class Module # end # # Person.new.hair_colors # => [:brown, :black, :blonde, :red] + # Person.new.hair_styles # => [:long, :short] # # @raise [TypeError] # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#53 + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#75 def cattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end # Defines a class attribute and creates a class and instance writer methods to @@ -16014,6 +19351,7 @@ class Module # # module HairColors # mattr_writer :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_writer(:hair_styles) { [:long, :short] } # end # # class Person @@ -16021,19 +19359,30 @@ class Module # end # # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] + # Person.class_variable_get("@@hair_styles") # => [:long, :short] # # @raise [TypeError] # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#117 + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#140 def cattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end + # Returns a copy of module or class if it's anonymous. If it's + # named, returns +self+. + # + # Object.deep_dup == Object # => true + # klass = Class.new + # klass.deep_dup == klass # => false + # + # source://activesupport//lib/active_support/core_ext/object/deep_dup.rb#64 + def deep_dup; end + # Provides a +delegate+ class method to easily expose contained objects' # public methods as your own. # # ==== Options # * :to - Specifies the target object name as a symbol or string # * :prefix - Prefixes the new method with the target name or a custom prefix - # * :allow_nil - If set to true, prevents a +Module::DelegationError+ + # * :allow_nil - If set to true, prevents a +ActiveSupport::DelegationError+ # from being raised # * :private - If set to true, changes method visibility to private # @@ -16144,7 +19493,7 @@ class Module # User.new.age # => 2 # # If the target is +nil+ and does not respond to the delegated method a - # +Module::DelegationError+ is raised. If you wish to instead return +nil+, + # +ActiveSupport::DelegationError+ is raised. If you wish to instead return +nil+, # use the :allow_nil option. # # class User < ActiveRecord::Base @@ -16153,7 +19502,7 @@ class Module # end # # User.new.age - # # => Module::DelegationError: User#age delegated to profile.age, but profile is nil + # # => ActiveSupport::DelegationError: User#age delegated to profile.age, but profile is nil # # But if not having a profile yet is fine and should not be an error # condition: @@ -16181,7 +19530,7 @@ class Module # # The target method must be public, otherwise it will raise +NoMethodError+. # - # source://activesupport//lib/active_support/core_ext/module/delegation.rb#171 + # source://activesupport//lib/active_support/core_ext/module/delegation.rb#160 def delegate(*methods, to: T.unsafe(nil), prefix: T.unsafe(nil), allow_nil: T.unsafe(nil), private: T.unsafe(nil)); end # When building decorators, a common pattern may emerge: @@ -16223,7 +19572,7 @@ class Module # variables, methods, constants, etc. # # The delegated method must be public on the target, otherwise it will - # raise +DelegationError+. If you wish to instead return +nil+, + # raise +ActiveSupport::DelegationError+. If you wish to instead return +nil+, # use the :allow_nil option. # # The marshal_dump and _dump methods are exempt from @@ -16231,20 +19580,15 @@ class Module # Marshal.dump(object), should the delegation target method # of object add or remove instance variables. # - # source://activesupport//lib/active_support/core_ext/module/delegation.rb#289 + # source://activesupport//lib/active_support/core_ext/module/delegation.rb#218 def delegate_missing_to(target, allow_nil: T.unsafe(nil)); end - # deprecate :foo - # deprecate bar: 'message' - # deprecate :foo, :bar, baz: 'warning!', qux: 'gone!' - # - # You can also use custom deprecator instance: + # deprecate :foo, deprecator: MyLib.deprecator + # deprecate :foo, bar: "warning!", deprecator: MyLib.deprecator # - # deprecate :foo, deprecator: MyLib::Deprecator.new - # deprecate :foo, bar: "warning!", deprecator: MyLib::Deprecator.new - # - # \Custom deprecators must respond to deprecation_warning(deprecated_method_name, message, caller_backtrace) - # method where you can implement your custom warning behavior. + # A deprecator is typically an instance of ActiveSupport::Deprecation, but you can also pass any object that responds + # to deprecation_warning(deprecated_method_name, message, caller_backtrace) where you can implement your + # custom warning behavior. # # class MyLib::Deprecator # def deprecation_warning(deprecated_method_name, message, caller_backtrace = nil) @@ -16253,8 +19597,8 @@ class Module # end # end # - # source://activesupport//lib/active_support/core_ext/module/deprecation.rb#22 - def deprecate(*method_names); end + # source://activesupport//lib/active_support/core_ext/module/deprecation.rb#17 + def deprecate(*method_names, deprecator:, **options); end # Defines both class and instance accessors for class attributes. # All class and instance methods created will be public, even if @@ -16313,6 +19657,7 @@ class Module # # module HairColors # mattr_accessor :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_accessor(:hair_styles) { [:long, :short] } # end # # class Person @@ -16320,8 +19665,9 @@ class Module # end # # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] + # Person.class_variable_get("@@hair_styles") # => [:long, :short] # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#202 + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#208 def mattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), &blk); end # Defines a class attribute and creates a class and instance reader methods. @@ -16361,6 +19707,7 @@ class Module # # module HairColors # mattr_reader :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_reader(:hair_styles) { [:long, :short] } # end # # class Person @@ -16368,10 +19715,11 @@ class Module # end # # Person.new.hair_colors # => [:brown, :black, :blonde, :red] + # Person.new.hair_styles # => [:long, :short] # # @raise [TypeError] # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#53 + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#55 def mattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end # Defines a class attribute and creates a class and instance writer methods to @@ -16409,6 +19757,7 @@ class Module # # module HairColors # mattr_writer :hair_colors, default: [:brown, :black, :blonde, :red] + # mattr_writer(:hair_styles) { [:long, :short] } # end # # class Person @@ -16416,10 +19765,11 @@ class Module # end # # Person.class_variable_get("@@hair_colors") # => [:brown, :black, :blonde, :red] + # Person.class_variable_get("@@hair_styles") # => [:long, :short] # # @raise [TypeError] # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#117 + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors.rb#121 def mattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil), location: T.unsafe(nil)); end # source://activesupport//lib/active_support/core_ext/module/redefine_method.rb#30 @@ -16441,14 +19791,14 @@ class Module # M.module_parent # => Object # Module.new.module_parent # => Object # - # source://activesupport//lib/active_support/core_ext/module/introspection.rb#35 + # source://activesupport//lib/active_support/core_ext/module/introspection.rb#37 def module_parent; end # Returns the name of the module containing this one. # # M::N.module_parent_name # => "M" # - # source://activesupport//lib/active_support/core_ext/module/introspection.rb#10 + # source://activesupport//lib/active_support/core_ext/module/introspection.rb#9 def module_parent_name; end # Returns all the parents of this module according to its name, ordered from @@ -16464,7 +19814,7 @@ class Module # M::N.module_parents # => [M, Object] # X.module_parents # => [M, Object] # - # source://activesupport//lib/active_support/core_ext/module/introspection.rb#51 + # source://activesupport//lib/active_support/core_ext/module/introspection.rb#53 def module_parents; end # Replaces the existing method definition, if there is one, with the passed @@ -16538,7 +19888,11 @@ class Module # Current.new.user = "DHH" # => NoMethodError # Current.new.user # => NoMethodError # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#152 + # A default value may be specified using the +:default+ option. Because + # multiple threads can access the default value, non-frozen default values + # will be duped and frozen. + # + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#174 def thread_cattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end # Defines a per-thread class attribute and creates class and instance reader methods. @@ -16568,7 +19922,7 @@ class Module # # Current.new.user # => NoMethodError # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#41 + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#81 def thread_cattr_reader(*syms, instance_reader: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end # Defines a per-thread class attribute and creates a class and instance writer methods to @@ -16590,8 +19944,8 @@ class Module # # Current.new.user = "DHH" # => NoMethodError # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#85 - def thread_cattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#123 + def thread_cattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil)); end # Defines both class and instance accessors for class attributes. # @@ -16635,7 +19989,11 @@ class Module # Current.new.user = "DHH" # => NoMethodError # Current.new.user # => NoMethodError # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#152 + # A default value may be specified using the +:default+ option. Because + # multiple threads can access the default value, non-frozen default values + # will be duped and frozen. + # + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#170 def thread_mattr_accessor(*syms, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end # Defines a per-thread class attribute and creates class and instance reader methods. @@ -16687,33 +20045,26 @@ class Module # # Current.new.user = "DHH" # => NoMethodError # - # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#85 - def thread_mattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + # source://activesupport//lib/active_support/core_ext/module/attribute_accessors_per_thread.rb#101 + def thread_mattr_writer(*syms, instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil)); end private - # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#30 + # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#40 def attr_internal_define(attr_name, type); end - # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#26 - def attr_internal_ivar_name(attr); end - class << self # Returns the value of attribute attr_internal_naming_format. # - # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#22 + # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#23 def attr_internal_naming_format; end - # Sets the attribute attr_internal_naming_format - # - # @param value the value to set the attribute attr_internal_naming_format to. - # - # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#22 - def attr_internal_naming_format=(_arg0); end + # source://activesupport//lib/active_support/core_ext/module/attr_internal.rb#25 + def attr_internal_naming_format=(format); end end end -# = Bite-sized separation of concerns +# == Bite-sized separation of concerns # # We often find ourselves with a medium-sized chunk of behavior that we'd # like to extract, but only mix in to a single class. @@ -16728,9 +20079,9 @@ end # with a comment, as a least-bad alternative. Using modules in separate files # means tedious sifting to get a big-picture view. # -# = Dissatisfying ways to separate small concerns +# == Dissatisfying ways to separate small concerns # -# == Using comments: +# === Using comments: # # class Todo < ApplicationRecord # # Other todo implementation @@ -16747,7 +20098,7 @@ end # end # end # -# == With an inline module: +# === With an inline module: # # Noisy syntax. # @@ -16771,7 +20122,7 @@ end # include EventTracking # end # -# == Mix-in noise exiled to its own file: +# === Mix-in noise exiled to its own file: # # Once our chunk of behavior starts pushing the scroll-to-understand-it # boundary, we give in and move it to a separate file. At this size, the @@ -16785,7 +20136,7 @@ end # include TodoEventTracking # end # -# = Introducing Module#concerning +# == Introducing Module#concerning # # By quieting the mix-in noise, we arrive at a natural, low-ceremony way to # separate bite-sized concerns. @@ -16845,23 +20196,12 @@ module Module::Concerning def concerning(topic, prepend: T.unsafe(nil), &block); end end -# source://activesupport//lib/active_support/core_ext/module/delegation.rb#13 -Module::DELEGATION_RESERVED_KEYWORDS = T.let(T.unsafe(nil), Array) - -# source://activesupport//lib/active_support/core_ext/module/delegation.rb#14 -Module::DELEGATION_RESERVED_METHOD_NAMES = T.let(T.unsafe(nil), Set) - -# Error generated by +delegate+ when a method is called on +nil+ and +allow_nil+ -# option is not used. -# -# source://activesupport//lib/active_support/core_ext/module/delegation.rb#8 -class Module::DelegationError < ::NoMethodError; end - -# source://activesupport//lib/active_support/core_ext/module/delegation.rb#10 -Module::RUBY_RESERVED_KEYWORDS = T.let(T.unsafe(nil), Array) +# source://activesupport//lib/active_support/core_ext/module/delegation.rb#5 +Module::DelegationError = ActiveSupport::DelegationError # source://activesupport//lib/active_support/core_ext/name_error.rb#3 class NameError < ::StandardError + include ::ErrorHighlight::CoreExt include ::DidYouMean::Correctable # Extract the name of the missing constant from the exception message. @@ -16899,9 +20239,9 @@ end # source://activesupport//lib/active_support/core_ext/name_error.rb#53 NameError::UNBOUND_METHOD_MODULE_NAME = T.let(T.unsafe(nil), UnboundMethod) -# source://activesupport//lib/active_support/core_ext/object/blank.rb#50 +# source://activesupport//lib/active_support/core_ext/object/to_query.rb#19 class NilClass - # source://activesupport//lib/active_support/core_ext/object/json.rb#87 + # source://activesupport//lib/active_support/core_ext/object/json.rb#93 def as_json(options = T.unsafe(nil)); end # +nil+ is blank: @@ -16913,11 +20253,21 @@ class NilClass # source://activesupport//lib/active_support/core_ext/object/blank.rb#56 def blank?; end + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#60 + def present?; end + # Returns +self+. # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#20 + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#26 def to_param; end + # Returns a CGI-escaped +key+. + # + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#21 + def to_query(key); end + # Calling +try+ on +nil+ always returns +nil+. # It becomes especially helpful when navigating through associations that may return +nil+. # @@ -16930,21 +20280,21 @@ class NilClass # @person.try(:children).try(:first).try(:name) # # source://activesupport//lib/active_support/core_ext/object/try.rb#148 - def try(*_arg0); end + def try(*_arg0, &_arg1); end # Calling +try!+ on +nil+ always returns +nil+. # # nil.try!(:name) # => nil # # source://activesupport//lib/active_support/core_ext/object/try.rb#155 - def try!(*_arg0); end + def try!(*_arg0, &_arg1); end end -# source://activesupport//lib/active_support/core_ext/object/blank.rb#134 +# source://activesupport//lib/active_support/core_ext/string/output_safety.rb#12 class Numeric include ::Comparable - # source://activesupport//lib/active_support/core_ext/object/json.rb#105 + # source://activesupport//lib/active_support/core_ext/object/json.rb#111 def as_json(options = T.unsafe(nil)); end # No number is blank: @@ -16954,28 +20304,28 @@ class Numeric # # @return [false] # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#141 + # source://activesupport//lib/active_support/core_ext/object/blank.rb#177 def blank?; end # Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes # # 2.bytes # => 2 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#14 + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#18 def byte; end # Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes # # 2.bytes # => 2 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#14 + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#15 def bytes; end # Returns a Duration instance matching the number of days provided. # # 2.days # => 2 days # - # source://activesupport//lib/active_support/core_ext/numeric/time.rb#37 + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#40 def day; end # Returns a Duration instance matching the number of days provided. @@ -16989,21 +20339,21 @@ class Numeric # # 2.exabytes # => 2_305_843_009_213_693_952 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#62 + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#66 def exabyte; end # Returns the number of bytes equivalent to the exabytes provided. # # 2.exabytes # => 2_305_843_009_213_693_952 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#62 + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#63 def exabytes; end # Returns a Duration instance matching the number of fortnights provided. # # 2.fortnights # => 4 weeks # - # source://activesupport//lib/active_support/core_ext/numeric/time.rb#53 + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#56 def fortnight; end # Returns a Duration instance matching the number of fortnights provided. @@ -17017,21 +20367,21 @@ class Numeric # # 2.gigabytes # => 2_147_483_648 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#38 + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#42 def gigabyte; end # Returns the number of bytes equivalent to the gigabytes provided. # # 2.gigabytes # => 2_147_483_648 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#38 + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#39 def gigabytes; end # Returns a Duration instance matching the number of hours provided. # # 2.hours # => 2 hours # - # source://activesupport//lib/active_support/core_ext/numeric/time.rb#29 + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#32 def hour; end # Returns a Duration instance matching the number of hours provided. @@ -17043,7 +20393,7 @@ class Numeric # @return [Boolean] # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#156 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#13 def html_safe?; end # Returns the number of milliseconds equivalent to the seconds provided. @@ -17059,35 +20409,35 @@ class Numeric # # 2.kilobytes # => 2048 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#22 + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#26 def kilobyte; end # Returns the number of bytes equivalent to the kilobytes provided. # # 2.kilobytes # => 2048 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#22 + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#23 def kilobytes; end # Returns the number of bytes equivalent to the megabytes provided. # # 2.megabytes # => 2_097_152 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#30 + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#34 def megabyte; end # Returns the number of bytes equivalent to the megabytes provided. # # 2.megabytes # => 2_097_152 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#30 + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#31 def megabytes; end # Returns a Duration instance matching the number of minutes provided. # # 2.minutes # => 2 minutes # - # source://activesupport//lib/active_support/core_ext/numeric/time.rb#21 + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#24 def minute; end # Returns a Duration instance matching the number of minutes provided. @@ -17101,21 +20451,26 @@ class Numeric # # 2.petabytes # => 2_251_799_813_685_248 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#54 + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#58 def petabyte; end # Returns the number of bytes equivalent to the petabytes provided. # # 2.petabytes # => 2_251_799_813_685_248 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#54 + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#55 def petabytes; end + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#181 + def present?; end + # Returns a Duration instance matching the number of seconds provided. # # 2.seconds # => 2 seconds # - # source://activesupport//lib/active_support/core_ext/numeric/time.rb#13 + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#16 def second; end # Returns a Duration instance matching the number of seconds provided. @@ -17129,21 +20484,21 @@ class Numeric # # 2.terabytes # => 2_199_023_255_552 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#46 + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#50 def terabyte; end # Returns the number of bytes equivalent to the terabytes provided. # # 2.terabytes # => 2_199_023_255_552 # - # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#46 + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#47 def terabytes; end # Returns a Duration instance matching the number of weeks provided. # # 2.weeks # => 2 weeks # - # source://activesupport//lib/active_support/core_ext/numeric/time.rb#45 + # source://activesupport//lib/active_support/core_ext/numeric/time.rb#48 def week; end # Returns a Duration instance matching the number of weeks provided. @@ -17152,6 +20507,20 @@ class Numeric # # source://activesupport//lib/active_support/core_ext/numeric/time.rb#45 def weeks; end + + # Returns the number of bytes equivalent to the zettabytes provided. + # + # 2.zettabytes # => 2_361_183_241_434_822_606_848 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#74 + def zettabyte; end + + # Returns the number of bytes equivalent to the zettabytes provided. + # + # 2.zettabytes # => 2_361_183_241_434_822_606_848 + # + # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#71 + def zettabytes; end end # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#9 @@ -17172,6 +20541,9 @@ Numeric::PETABYTE = T.let(T.unsafe(nil), Integer) # source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#7 Numeric::TERABYTE = T.let(T.unsafe(nil), Integer) +# source://activesupport//lib/active_support/core_ext/numeric/bytes.rb#10 +Numeric::ZETTABYTE = T.let(T.unsafe(nil), Integer) + # -- # Most objects are cloneable, but not all. For example you can't dup methods: # @@ -17191,14 +20563,13 @@ Numeric::TERABYTE = T.let(T.unsafe(nil), Integer) # using that rescue idiom. # ++ # -# source://activesupport//lib/active_support/core_ext/object/blank.rb#5 +# source://activesupport//lib/active_support/core_ext/object/duplicable.rb#21 class Object < ::BasicObject - include ::ActiveSupport::ToJsonWithActiveSupportEncoder include ::ActiveSupport::Dependencies::RequireDependency - include ::ActiveSupport::ForkTracker::CoreExt - include ::ActiveSupport::ForkTracker::CoreExtPrivate include ::Kernel + include ::PP::ObjectMixin include ::ActiveSupport::Tryable + include ::ActiveSupport::ToJsonWithActiveSupportEncoder # Provides a way to check whether some class acts like some other class based on the existence of # an appropriately-named marker method. @@ -17278,21 +20649,24 @@ class Object < ::BasicObject # @return [Boolean] # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#150 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#7 def html_safe?; end - # Returns true if this object is included in the argument. Argument must be - # any object which responds to +#include?+. Usage: + # Returns true if this object is included in the argument. + # + # When argument is a +Range+, +#cover?+ is used to properly handle inclusion + # check within open ranges. Otherwise, argument must be any object which responds + # to +#include?+. Usage: # # characters = ["Konata", "Kagami", "Tsukasa"] # "Konata".in?(characters) # => true # - # This will throw an +ArgumentError+ if the argument doesn't respond - # to +#include?+. + # For non +Range+ arguments, this will throw an +ArgumentError+ if the argument + # doesn't respond to +#include?+. # # @return [Boolean] # - # source://activesupport//lib/active_support/core_ext/object/inclusion.rb#12 + # source://activesupport//lib/active_support/core_ext/object/inclusion.rb#15 def in?(another_object); end # Returns a hash with string keys that maps instance variable names without "@" to their @@ -17319,7 +20693,7 @@ class Object < ::BasicObject # # C.new(0, 1).instance_variable_names # => ["@y", "@x"] # - # source://activesupport//lib/active_support/core_ext/object/instance_variables.rb#27 + # source://activesupport//lib/active_support/core_ext/object/instance_variables.rb#29 def instance_variable_names; end # Returns the receiver if it's present otherwise returns +nil+. @@ -17351,7 +20725,7 @@ class Object < ::BasicObject # # @return [Object] # - # source://activesupport//lib/active_support/core_ext/object/inclusion.rb#26 + # source://activesupport//lib/active_support/core_ext/object/inclusion.rb#34 def presence_in(another_object); end # An object is present if it's not blank. @@ -17363,20 +20737,46 @@ class Object < ::BasicObject # Alias of to_s. # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#7 + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#8 def to_param; end # Converts an object into a string suitable for use as a URL query string, # using the given key as the param name. # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#13 + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#14 def to_query(key); end + # Set and restore public attributes around a block. + # + # client.timeout # => 5 + # client.with(timeout: 1) do |c| + # c.timeout # => 1 + # end + # client.timeout # => 5 + # + # The receiver is yielded to the provided block. + # + # This method is a shorthand for the common begin/ensure pattern: + # + # old_value = object.attribute + # begin + # object.attribute = new_value + # # do things + # ensure + # object.attribute = old_value + # end + # + # It can be used on any object as long as both the reader and writer methods + # are public. + # + # source://activesupport//lib/active_support/core_ext/object/with.rb#26 + def with(**attributes); end + # An elegant way to factor duplication out of options passed to a series of # method calls. Each method called in the block, with the block variable as - # the receiver, will have its options merged with the default +options+ hash - # provided. Each method called on the block variable must take an options - # hash as its final argument. + # the receiver, will have its options merged with the default +options+ + # Hash or Hash-like object provided. Each method called on + # the block variable must take an options hash as its final argument. # # Without with_options, this code contains duplication: # @@ -17433,11 +20833,11 @@ class Object < ::BasicObject # # Hence the inherited default for +if+ key is ignored. # - # NOTE: You cannot call class methods implicitly inside of with_options. + # NOTE: You cannot call class methods implicitly inside of +with_options+. # You can access these methods using the class name instead: # # class Phone < ActiveRecord::Base - # enum phone_number_type: { home: 0, office: 1, mobile: 2 } + # enum :phone_number_type, { home: 0, office: 1, mobile: 2 } # # with_options presence: true do # validates :phone_number_type, inclusion: { in: Phone.phone_number_types.keys } @@ -17452,80 +20852,82 @@ class Object < ::BasicObject # end # end # - # # styled.link_to "I'm red", "/" - # # #=> I'm red + # styled.link_to "I'm red", "/" + # # => I'm red # - # # styled.button_tag "I'm red too!" - # # #=> + # styled.button_tag "I'm red too!" + # # => # # source://activesupport//lib/active_support/core_ext/object/with_options.rb#92 def with_options(options, &block); end end -# source://activesupport//lib/active_support/core_ext/object/json.rb#222 +# source://activesupport//lib/active_support/core_ext/object/json.rb#236 class Pathname - # source://activesupport//lib/active_support/core_ext/object/json.rb#223 + # source://activesupport//lib/active_support/core_ext/object/json.rb#237 def as_json(options = T.unsafe(nil)); end end module Process + extend ::ActiveSupport::ForkTracker::CoreExt + class << self - # source://activesupport//lib/active_support/fork_tracker.rb#16 - def fork(*_arg0, &_arg1); end + # source://activesupport//lib/active_support/fork_tracker.rb#6 + def _fork; end end end -# source://activesupport//lib/active_support/core_ext/object/json.rb#234 +# source://activesupport//lib/active_support/core_ext/object/json.rb#257 class Process::Status - # source://activesupport//lib/active_support/core_ext/object/json.rb#235 + # source://activesupport//lib/active_support/core_ext/object/json.rb#258 def as_json(options = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/object/json.rb#151 +# source://activesupport//lib/active_support/core_ext/object/json.rb#157 class Range include ::ActiveSupport::RangeWithFormat - include ::ActiveSupport::DeprecatedRangeWithFormat include ::ActiveSupport::CompareWithRange - include ::ActiveSupport::EachTimeWithZone include ::Enumerable # source://activesupport//lib/active_support/core_ext/range/compare_range.rb#16 def ===(value); end - # source://activesupport//lib/active_support/core_ext/object/json.rb#152 + # source://activesupport//lib/active_support/core_ext/object/json.rb#158 def as_json(options = T.unsafe(nil)); end - # source://activesupport//lib/active_support/core_ext/range/each.rb#7 - def each(&block); end - # source://activesupport//lib/active_support/core_ext/range/compare_range.rb#41 def include?(value); end # Compare two ranges and see if they overlap each other - # (1..5).overlaps?(4..6) # => true - # (1..5).overlaps?(7..9) # => false + # (1..5).overlap?(4..6) # => true + # (1..5).overlap?(7..9) # => false # + # @raise [TypeError] # @return [Boolean] # - # source://activesupport//lib/active_support/core_ext/range/overlaps.rb#7 - def overlaps?(other); end + # source://activesupport//lib/active_support/core_ext/range/overlap.rb#39 + def overlaps?(_arg0); end - # source://activesupport//lib/active_support/core_ext/range/each.rb#12 - def step(n = T.unsafe(nil), &block); end + # Returns the sole item in the range. If there are no items, or more + # than one item, raises Enumerable::SoleItemExpectedError. + # + # (1..1).sole # => 1 + # (2..1).sole # => Enumerable::SoleItemExpectedError: no item found + # (..1).sole # => Enumerable::SoleItemExpectedError: infinite range cannot represent a sole item + # + # source://activesupport//lib/active_support/core_ext/range/sole.rb#10 + def sole; end # Optimize range sum to use arithmetic progression if a block is not given and # we have a range of numeric values. # - # source://activesupport//lib/active_support/core_ext/enumerable.rb#287 - def sum(identity = T.unsafe(nil)); end - - # source://activesupport//lib/active_support/core_ext/range/deprecated_conversions.rb#6 - def to_s(format = T.unsafe(nil)); end + # source://activesupport//lib/active_support/core_ext/enumerable.rb#253 + def sum(initial_value = T.unsafe(nil)); end end -# source://activesupport//lib/active_support/core_ext/object/json.rb#133 +# source://activesupport//lib/active_support/core_ext/object/json.rb#139 class Regexp - # source://activesupport//lib/active_support/core_ext/object/json.rb#134 + # source://activesupport//lib/active_support/core_ext/object/json.rb#140 def as_json(options = T.unsafe(nil)); end # Returns +true+ if the regexp has the multiline flag set. @@ -17542,17 +20944,17 @@ class Regexp def multiline?; end end -# source://activesupport//lib/active_support/core_ext/object/duplicable.rb#53 +# source://activesupport//lib/active_support/core_ext/object/duplicable.rb#62 module Singleton mixes_in_class_methods ::Singleton::SingletonClassMethods # Singleton instances are not duplicable: # - # Class.new.include(Singleton).instance.dup # TypeError (can't dup instance of singleton + # Class.new.include(Singleton).instance.dup # TypeError (can't dup instance of singleton # # @return [Boolean] # - # source://activesupport//lib/active_support/core_ext/object/duplicable.rb#57 + # source://activesupport//lib/active_support/core_ext/object/duplicable.rb#66 def duplicable?; end end @@ -17561,7 +20963,7 @@ end # # 'ScaleScore'.tableize # => "scale_scores" # -# source://activesupport//lib/active_support/core_ext/object/blank.rb#103 +# source://activesupport//lib/active_support/core_ext/string/multibyte.rb#5 class String include ::Comparable @@ -17572,7 +20974,7 @@ class String # source://activesupport//lib/active_support/core_ext/string/behavior.rb#5 def acts_like_string?; end - # source://activesupport//lib/active_support/core_ext/object/json.rb#93 + # source://activesupport//lib/active_support/core_ext/object/json.rb#99 def as_json(options = T.unsafe(nil)); end # If you pass a single integer, returns a substring of one character at that @@ -17617,7 +21019,7 @@ class String # # @return [true, false] # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#121 + # source://activesupport//lib/active_support/core_ext/object/blank.rb#153 def blank?; end # By default, +camelize+ converts strings to UpperCamelCase. If the argument to camelize @@ -17630,11 +21032,9 @@ class String # 'active_record/errors'.camelize # => "ActiveRecord::Errors" # 'active_record/errors'.camelize(:lower) # => "activeRecord::Errors" # - # +camelize+ is also aliased as +camelcase+. - # # See ActiveSupport::Inflector.camelize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#103 + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#111 def camelcase(first_letter = T.unsafe(nil)); end # By default, +camelize+ converts strings to UpperCamelCase. If the argument to camelize @@ -17647,14 +21047,12 @@ class String # 'active_record/errors'.camelize # => "ActiveRecord::Errors" # 'active_record/errors'.camelize(:lower) # => "activeRecord::Errors" # - # +camelize+ is also aliased as +camelcase+. - # # See ActiveSupport::Inflector.camelize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#103 + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#101 def camelize(first_letter = T.unsafe(nil)); end - # Creates a class name from a plural table name like Rails does for table names to models. + # Creates a class name from a plural table name like \Rails does for table names to models. # Note that this returns a string and not a class. (To convert to an actual class # follow +classify+ with +constantize+.) # @@ -17663,7 +21061,7 @@ class String # # See ActiveSupport::Inflector.classify. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#243 + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#239 def classify; end # +constantize+ tries to find a declared constant with the name specified @@ -17685,7 +21083,7 @@ class String # # See ActiveSupport::Inflector.dasherize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#152 + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#148 def dasherize; end # Removes the rightmost segment from the constant expression in the string. @@ -17700,7 +21098,7 @@ class String # # See also +demodulize+. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#181 + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#177 def deconstantize; end # Removes the module part from the constant expression in the string. @@ -17714,9 +21112,23 @@ class String # # See also +deconstantize+. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#166 + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#162 def demodulize; end + # Converts the first character to lowercase. + # + # 'If they enjoyed The Matrix'.downcase_first # => "if they enjoyed The Matrix" + # 'I'.downcase_first # => "i" + # ''.downcase_first # => "" + # + # See ActiveSupport::Inflector.downcase_first. + # + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#284 + def downcase_first; end + + # source://activesupport//lib/active_support/core_ext/string/starts_ends_with.rb#5 + def ends_with?(*_arg0); end + # The inverse of String#include?. Returns true if the string # does not include the other string. # @@ -17753,7 +21165,7 @@ class String # # See ActiveSupport::Inflector.foreign_key. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#290 + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#297 def foreign_key(separate_class_name_and_id_with_underscore = T.unsafe(nil)); end # Returns a substring from the given position to the end of the string. @@ -17779,10 +21191,10 @@ class String # +raw+ helper in views. It is recommended that you use +sanitize+ instead of # this method. It should never be called on user input. # - # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#364 + # source://activesupport//lib/active_support/core_ext/string/output_safety.rb#232 def html_safe; end - # Capitalizes the first word, turns underscores into spaces, and (by default)strips a + # Capitalizes the first word, turns underscores into spaces, and (by default) strips a # trailing '_id' if present. # Like +titleize+, this is meant for creating pretty output. # @@ -17802,7 +21214,7 @@ class String # # See ActiveSupport::Inflector.humanize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#266 + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#262 def humanize(capitalize: T.unsafe(nil), keep_id_suffix: T.unsafe(nil)); end # Converts String to a TimeWithZone in the current zone if Time.zone or Time.zone_default @@ -17825,7 +21237,7 @@ class String # # The second argument, +indent_string+, specifies which indent string to # use. The default is +nil+, which tells the method to make a guess by - # peeking at the first indented line, and fallback to a space if there is + # peeking at the first indented line, and fall back to a space if there is # none. # # " foo".indent(2) # => " foo" @@ -17870,7 +21282,7 @@ class String # # @return [Boolean] # - # source://activesupport//lib/active_support/core_ext/string/multibyte.rb#48 + # source://activesupport//lib/active_support/core_ext/string/multibyte.rb#57 def is_utf8?; end # Returns the last character of the string. If a limit is supplied, returns a substring @@ -17896,14 +21308,14 @@ class String # class. If the proxy class doesn't respond to a certain method, it's forwarded to the encapsulated string. # # >> "lj".mb_chars.upcase.to_s - # => "LJ" + # # => "LJ" # # NOTE: Ruby 2.4 and later support native Unicode case mappings: # # >> "lj".upcase - # => "LJ" + # # => "LJ" # - # == Method chaining + # == \Method chaining # # All the methods on the Chars proxy which normally return a string will return a Chars object. This allows # method chaining on the result of any of these methods. @@ -17957,7 +21369,7 @@ class String # # See ActiveSupport::Inflector.parameterize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#219 + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#215 def parameterize(separator: T.unsafe(nil), preserve_case: T.unsafe(nil), locale: T.unsafe(nil)); end # Returns the plural form of the word in the string. @@ -17987,6 +21399,11 @@ class String # source://activesupport//lib/active_support/core_ext/string/inflections.rb#35 def pluralize(count = T.unsafe(nil), locale = T.unsafe(nil)); end + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#165 + def present?; end + # Returns a new string with all occurrences of the patterns removed. # str = "foo bar test" # str.remove(" test") # => "foo bar" @@ -18058,6 +21475,9 @@ class String # source://activesupport//lib/active_support/core_ext/string/filters.rb#21 def squish!; end + # source://activesupport//lib/active_support/core_ext/string/starts_ends_with.rb#4 + def starts_with?(*_arg0); end + # Strips indentation in heredocs. # # For example in @@ -18080,7 +21500,7 @@ class String # source://activesupport//lib/active_support/core_ext/string/strip.rb#22 def strip_heredoc; end - # Creates the name of a table like Rails does for models to table names. This method + # Creates the name of a table like \Rails does for models to table names. This method # uses the +pluralize+ method on the last word in the string. # # 'RawScaledScorer'.tableize # => "raw_scaled_scorers" @@ -18089,12 +21509,12 @@ class String # # See ActiveSupport::Inflector.tableize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#231 + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#227 def tableize; end # Capitalizes all the words and replaces some characters in the string to create # a nicer looking title. +titleize+ is meant for creating pretty output. It is not - # used in the Rails internals. + # used in the \Rails internals. # # The trailing '_id','Id'.. can be kept and capitalized by setting the # optional parameter +keep_id_suffix+ to true. @@ -18104,16 +21524,14 @@ class String # 'x-men: the last stand'.titleize # => "X Men: The Last Stand" # 'string_ending_with_id'.titleize(keep_id_suffix: true) # => "String Ending With Id" # - # +titleize+ is also aliased as +titlecase+. - # # See ActiveSupport::Inflector.titleize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#130 + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#129 def titlecase(keep_id_suffix: T.unsafe(nil)); end # Capitalizes all the words and replaces some characters in the string to create # a nicer looking title. +titleize+ is meant for creating pretty output. It is not - # used in the Rails internals. + # used in the \Rails internals. # # The trailing '_id','Id'.. can be kept and capitalized by setting the # optional parameter +keep_id_suffix+ to true. @@ -18123,11 +21541,9 @@ class String # 'x-men: the last stand'.titleize # => "X Men: The Last Stand" # 'string_ending_with_id'.titleize(keep_id_suffix: true) # => "String Ending With Id" # - # +titleize+ is also aliased as +titlecase+. - # # See ActiveSupport::Inflector.titleize. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#130 + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#126 def titleize(keep_id_suffix: T.unsafe(nil)); end # Returns a substring from the beginning of the string to the given position. @@ -18186,7 +21602,7 @@ class String # source://activesupport//lib/active_support/core_ext/string/conversions.rb#22 def to_time(form = T.unsafe(nil)); end - # Truncates a given +text+ after a given length if +text+ is longer than length: + # Truncates a given +text+ to length truncate_to if +text+ is longer than truncate_to: # # 'Once upon a time in a world far far away'.truncate(27) # # => "Once upon a time in a wo..." @@ -18199,32 +21615,38 @@ class String # 'Once upon a time in a world far far away'.truncate(27, separator: /\s/) # # => "Once upon a time in a..." # - # The last characters will be replaced with the :omission string (defaults to "...") - # for a total length not exceeding length: + # The last characters will be replaced with the :omission string (defaults to "..."). + # The total length will not exceed truncate_to unless both +text+ and :omission + # are longer than truncate_to: # # 'And they found that many people were sleeping better.'.truncate(25, omission: '... (continued)') # # => "And they f... (continued)" # - # source://activesupport//lib/active_support/core_ext/string/filters.rb#66 - def truncate(truncate_at, options = T.unsafe(nil)); end + # 'And they found that many people were sleeping better.'.truncate(4, omission: '... (continued)') + # # => "... (continued)" + # + # source://activesupport//lib/active_support/core_ext/string/filters.rb#70 + def truncate(truncate_to, options = T.unsafe(nil)); end - # Truncates +text+ to at most bytesize bytes in length without + # Truncates +text+ to at most truncate_to bytes in length without # breaking string encoding by splitting multibyte characters or breaking # grapheme clusters ("perceptual characters") by truncating at combining # characters. # # >> "🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪".size - # => 20 + # # => 20 # >> "🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪".bytesize - # => 80 + # # => 80 # >> "🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪🔪".truncate_bytes(20) - # => "🔪🔪🔪🔪…" + # # => "🔪🔪🔪🔪…" # # The truncated text ends with the :omission string, defaulting - # to "…", for a total length not exceeding bytesize. + # to "…", for a total length not exceeding truncate_to. # - # source://activesupport//lib/active_support/core_ext/string/filters.rb#95 - def truncate_bytes(truncate_at, omission: T.unsafe(nil)); end + # Raises +ArgumentError+ when the bytesize of :omission exceeds truncate_to. + # + # source://activesupport//lib/active_support/core_ext/string/filters.rb#101 + def truncate_bytes(truncate_to, omission: T.unsafe(nil)); end # Truncates a given +text+ after a given number of words (words_count): # @@ -18241,7 +21663,7 @@ class String # 'And they found that many people were sleeping better.'.truncate_words(5, omission: '... (continued)') # # => "And they found that many... (continued)" # - # source://activesupport//lib/active_support/core_ext/string/filters.rb#136 + # source://activesupport//lib/active_support/core_ext/string/filters.rb#142 def truncate_words(words_count, options = T.unsafe(nil)); end # The reverse of +camelize+. Makes an underscored, lowercase form from the expression in the string. @@ -18253,10 +21675,10 @@ class String # # See ActiveSupport::Inflector.underscore. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#143 + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#139 def underscore; end - # Converts just the first character to uppercase. + # Converts the first character to uppercase. # # 'what a Lovely Day'.upcase_first # => "What a Lovely Day" # 'w'.upcase_first # => "W" @@ -18264,61 +21686,79 @@ class String # # See ActiveSupport::Inflector.upcase_first. # - # source://activesupport//lib/active_support/core_ext/string/inflections.rb#277 + # source://activesupport//lib/active_support/core_ext/string/inflections.rb#273 def upcase_first; end end -# source://activesupport//lib/active_support/core_ext/object/blank.rb#104 +# source://activesupport//lib/active_support/core_ext/object/blank.rb#136 String::BLANK_RE = T.let(T.unsafe(nil), Regexp) -# source://activesupport//lib/active_support/core_ext/object/blank.rb#105 +# source://activesupport//lib/active_support/core_ext/object/blank.rb#137 String::ENCODED_BLANKS = T.let(T.unsafe(nil), Concurrent::Map) -# source://activesupport//lib/active_support/core_ext/object/json.rb#68 +# source://activesupport//lib/active_support/core_ext/object/json.rb#74 class Struct include ::Enumerable - # source://activesupport//lib/active_support/core_ext/object/json.rb#69 + # source://activesupport//lib/active_support/core_ext/object/json.rb#75 def as_json(options = T.unsafe(nil)); end end -Struct::Group = Etc::Group - -# source://nokogiri/1.13.9/lib/nokogiri/html4/element_description_defaults.rb#11 -Struct::HTMLElementDescription = Struct - -Struct::Passwd = Etc::Passwd -Struct::Tms = Process::Tms - -# source://activesupport//lib/active_support/core_ext/object/json.rb#98 +# source://activesupport//lib/active_support/core_ext/object/json.rb#104 class Symbol include ::Comparable - # source://activesupport//lib/active_support/core_ext/object/json.rb#99 + # source://activesupport//lib/active_support/core_ext/object/json.rb#105 def as_json(options = T.unsafe(nil)); end + + # A Symbol is blank if it's empty: + # + # :''.blank? # => true + # :symbol.blank? # => false + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#128 + def blank?; end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#130 + def present?; end +end + +class Thread + # source://activesupport//lib/active_support/isolated_execution_state.rb#7 + def active_support_execution_state; end + + # source://activesupport//lib/active_support/isolated_execution_state.rb#7 + def active_support_execution_state=(_arg0); end end -# source://activesupport//lib/active_support/core_ext/object/blank.rb#146 +# source://activesupport//lib/active_support/core_ext/thread/backtrace/location.rb#3 +class Thread::Backtrace::Location + # source://activesupport//lib/active_support/core_ext/thread/backtrace/location.rb#4 + def spot(ex); end +end + +# source://activesupport//lib/active_support/core_ext/time/conversions.rb#7 class Time include ::Comparable include ::DateAndTime::Zones include ::DateAndTime::Calculations - include ::DateAndTime::Compatibility - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#280 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#298 def +(other); end # Time#- can also be used to determine the number of seconds between two Time instances. # We're layering on additional behavior so that ActiveSupport::TimeWithZone instances # are coerced into values that Time#- will recognize # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#303 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#308 def -(other); end # Layers additional behavior on Time#<=> so that DateTime and ActiveSupport::TimeWithZone instances # can be chronologically compared with a Time # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#312 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#338 def <=>(other); end # Duck-types as a Time-like class. See Object#acts_like?. @@ -18340,80 +21780,84 @@ class Time # Time.new(2015, 8, 1, 14, 35, 0).advance(days: 1) # => 2015-08-02 14:35:00 -0700 # Time.new(2015, 8, 1, 14, 35, 0).advance(weeks: 1) # => 2015-08-08 14:35:00 -0700 # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#182 + # Just like Date#advance, increments are applied in order of time units from + # largest to smallest. This order can affect the result around the end of a + # month. + # + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#194 def advance(options); end # Returns a new Time representing the time a number of seconds ago, this is basically a wrapper around the Numeric extension # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#208 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#220 def ago(seconds); end - # source://activesupport//lib/active_support/core_ext/object/json.rb#187 + # source://activesupport//lib/active_support/core_ext/object/json.rb#201 def as_json(options = T.unsafe(nil)); end # Returns a new Time representing the start of the day (0:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#221 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#236 def at_beginning_of_day; end # Returns a new Time representing the start of the hour (x:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#250 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#263 def at_beginning_of_hour; end # Returns a new Time representing the start of the minute (x:xx:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#266 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#279 def at_beginning_of_minute; end # Returns a new Time representing the end of the day, 23:59:59.999999 # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#239 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#257 def at_end_of_day; end # Returns a new Time representing the end of the hour, x:59:59.999999 # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#256 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#273 def at_end_of_hour; end # Returns a new Time representing the end of the minute, x:xx:59.999999 # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#272 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#288 def at_end_of_minute; end # Returns a new Time representing the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#229 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#244 def at_midday; end # Returns a new Time representing the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#229 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#246 def at_middle_of_day; end # Returns a new Time representing the start of the day (0:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#221 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#235 def at_midnight; end # Returns a new Time representing the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#229 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#245 def at_noon; end # Returns a new Time representing the start of the day (0:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#221 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#231 def beginning_of_day; end # Returns a new Time representing the start of the hour (x:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#250 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#260 def beginning_of_hour; end # Returns a new Time representing the start of the minute (x:xx:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#266 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#276 def beginning_of_minute; end # No Time is blank: @@ -18422,12 +21866,9 @@ class Time # # @return [false] # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#152 + # source://activesupport//lib/active_support/core_ext/object/blank.rb#192 def blank?; end - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#121 - def ceil(precision = T.unsafe(nil)); end - # Returns a new Time where one or more of the elements have been changed according # to the +options+ parameter. The time options (:hour, :min, # :sec, :usec, :nsec) reset cascadingly, so if only @@ -18443,42 +21884,48 @@ class Time # # @raise [ArgumentError] # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#138 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#123 def change(options); end # Layers additional behavior on Time#<=> so that DateTime and ActiveSupport::TimeWithZone instances # can be chronologically compared with a Time # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#312 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#322 def compare_with_coercion(other); end + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#337 + def compare_without_coercion(_arg0); end + # Returns a new Time representing the end of the day, 23:59:59.999999 # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#239 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#249 def end_of_day; end # Returns a new Time representing the end of the hour, x:59:59.999999 # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#256 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#266 def end_of_hour; end # Returns a new Time representing the end of the minute, x:xx:59.999999 # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#272 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#282 def end_of_minute; end # Layers additional behavior on Time#eql? so that ActiveSupport::TimeWithZone instances # can be eql? to an equivalent Time # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#327 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#348 def eql?(other); end # Layers additional behavior on Time#eql? so that ActiveSupport::TimeWithZone instances # can be eql? to an equivalent Time # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#327 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#342 def eql_with_coercion(other); end + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#347 + def eql_without_coercion(_arg0); end + # Returns a formatted string of the offset from UTC, or an alternative # string if the time zone is already UTC. # @@ -18490,75 +21937,91 @@ class Time # Returns a new Time representing the time a number of seconds since the instance time # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#213 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#228 def in(seconds); end # Returns a new Time representing the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#229 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#242 def midday; end # Returns a new Time representing the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#229 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#239 def middle_of_day; end # Returns a new Time representing the start of the day (0:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#221 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#234 def midnight; end # Time#- can also be used to determine the number of seconds between two Time instances. # We're layering on additional behavior so that ActiveSupport::TimeWithZone instances # are coerced into values that Time#- will recognize # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#303 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#313 def minus_with_coercion(other); end - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#290 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#300 def minus_with_duration(other); end - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#290 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#317 def minus_without_coercion(other); end + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#307 + def minus_without_duration(_arg0); end + # Returns a new time the specified number of days in the future. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#341 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#356 def next_day(days = T.unsafe(nil)); end # Returns a new time the specified number of months in the future. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#351 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#366 def next_month(months = T.unsafe(nil)); end # Returns a new time the specified number of years in the future. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#361 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#376 def next_year(years = T.unsafe(nil)); end # Returns a new Time representing the middle of the day (12:00) # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#229 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#243 def noon; end - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#280 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#290 def plus_with_duration(other); end + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#297 + def plus_without_duration(_arg0); end + + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#196 + def present?; end + # Returns a new time the specified number of days ago. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#336 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#351 def prev_day(days = T.unsafe(nil)); end # Returns a new time the specified number of months ago. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#346 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#361 def prev_month(months = T.unsafe(nil)); end # Returns a new time the specified number of years ago. # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#356 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#371 def prev_year(years = T.unsafe(nil)); end + # Aliased to +xmlschema+ for compatibility with +DateTime+ + # + # source://activesupport//lib/active_support/core_ext/time/conversions.rb#74 + def rfc3339(*_arg0); end + # Returns the fraction of a second as a +Rational+ # # Time.new(2012, 8, 29, 0, 0, 0.5).sec_fraction # => (1/2) @@ -18586,7 +22049,7 @@ class Time # Returns a new Time representing the time a number of seconds since the instance time # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#213 + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#225 def since(seconds); end # Converts to a formatted string. See DATE_FORMATS for built-in formats. @@ -18604,6 +22067,7 @@ class Time # time.to_fs(:long) # => "January 18, 2007 06:10" # time.to_fs(:long_ordinal) # => "January 18th, 2007 06:10" # time.to_fs(:rfc822) # => "Thu, 18 Jan 2007 06:10:17 -0600" + # time.to_fs(:rfc2822) # => "Thu, 18 Jan 2007 06:10:17 -0600" # time.to_fs(:iso8601) # => "2007-01-18T06:10:17-06:00" # # == Adding your own time formats to +to_fs+ @@ -18615,7 +22079,7 @@ class Time # Time::DATE_FORMATS[:month_and_year] = '%B %Y' # Time::DATE_FORMATS[:short_ordinal] = ->(time) { time.strftime("%B #{time.day.ordinalize}") } # - # source://activesupport//lib/active_support/core_ext/time/conversions.rb#53 + # source://activesupport//lib/active_support/core_ext/time/conversions.rb#62 def to_formatted_s(format = T.unsafe(nil)); end # Converts to a formatted string. See DATE_FORMATS for built-in formats. @@ -18633,6 +22097,7 @@ class Time # time.to_fs(:long) # => "January 18, 2007 06:10" # time.to_fs(:long_ordinal) # => "January 18th, 2007 06:10" # time.to_fs(:rfc822) # => "Thu, 18 Jan 2007 06:10:17 -0600" + # time.to_fs(:rfc2822) # => "Thu, 18 Jan 2007 06:10:17 -0600" # time.to_fs(:iso8601) # => "2007-01-18T06:10:17-06:00" # # == Adding your own time formats to +to_fs+ @@ -18644,18 +22109,9 @@ class Time # Time::DATE_FORMATS[:month_and_year] = '%B %Y' # Time::DATE_FORMATS[:short_ordinal] = ->(time) { time.strftime("%B #{time.day.ordinalize}") } # - # source://activesupport//lib/active_support/core_ext/time/conversions.rb#53 + # source://activesupport//lib/active_support/core_ext/time/conversions.rb#55 def to_fs(format = T.unsafe(nil)); end - # source://activesupport//lib/active_support/core_ext/time/deprecated_conversions.rb#7 - def to_s(format = T.unsafe(nil)); end - - # Either return +self+ or the time in the local system timezone depending - # on the setting of +ActiveSupport.to_time_preserves_timezone+. - # - # source://activesupport//lib/active_support/core_ext/time/compatibility.rb#13 - def to_time; end - class << self # Overriding case equality method so that it returns true for ActiveSupport::TimeWithZone instances # @@ -18665,14 +22121,17 @@ class Time # Layers additional behavior on Time.at so that ActiveSupport::TimeWithZone and DateTime # instances can be used when called with a single argument # - # source://activesupport//lib/active_support/core_ext/time/calculations.rb#45 - def at(*args, **kwargs); end + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#60 + def at(time_or_number, *args, **_arg2); end # Layers additional behavior on Time.at so that ActiveSupport::TimeWithZone and DateTime # instances can be used when called with a single argument # # source://activesupport//lib/active_support/core_ext/time/calculations.rb#45 - def at_with_coercion(*args, **kwargs); end + def at_with_coercion(time_or_number, *args, **_arg2); end + + # source://activesupport//lib/active_support/core_ext/time/calculations.rb#59 + def at_without_coercion(time, subsec = T.unsafe(nil), unit = T.unsafe(nil), in: T.unsafe(nil)); end # Returns Time.zone.now when Time.zone or config.time_zone are set, otherwise just returns Time.now. # @@ -18698,7 +22157,7 @@ class Time # Time.find_zone "America/New_York" # => # # Time.find_zone "NOT-A-TIMEZONE" # => nil # - # source://activesupport//lib/active_support/core_ext/time/zones.rb#94 + # source://activesupport//lib/active_support/core_ext/time/zones.rb#93 def find_zone(time_zone); end # Returns a TimeZone instance matching the time zone provided. @@ -18712,7 +22171,7 @@ class Time # Time.find_zone! false # => false # Time.find_zone! "NOT-A-TIMEZONE" # => ArgumentError: Invalid Timezone: NOT-A-TIMEZONE # - # source://activesupport//lib/active_support/core_ext/time/zones.rb#82 + # source://activesupport//lib/active_support/core_ext/time/zones.rb#81 def find_zone!(time_zone); end # Creates a +Time+ instance from an RFC 3339 string. @@ -18735,10 +22194,9 @@ class Time # around_action :set_time_zone # # private - # - # def set_time_zone - # Time.use_zone(current_user.timezone) { yield } - # end + # def set_time_zone + # Time.use_zone(current_user.timezone) { yield } + # end # end # # NOTE: This won't affect any ActiveSupport::TimeWithZone @@ -18746,7 +22204,7 @@ class Time # attributes that have been read before the block will remain in # the application's default timezone. # - # source://activesupport//lib/active_support/core_ext/time/zones.rb#62 + # source://activesupport//lib/active_support/core_ext/time/zones.rb#61 def use_zone(time_zone); end # Returns the TimeZone for the current request, if this has been set (via Time.zone=). @@ -18759,10 +22217,10 @@ class Time # # This method accepts any of the following: # - # * A Rails TimeZone object. - # * An identifier for a Rails TimeZone object (e.g., "Eastern Time (US & Canada)", -5.hours). - # * A TZInfo::Timezone object. - # * An identifier for a TZInfo::Timezone object (e.g., "America/New_York"). + # * A \Rails TimeZone object. + # * An identifier for a \Rails TimeZone object (e.g., "Eastern \Time (US & Canada)", -5.hours). + # * A +TZInfo::Timezone+ object. + # * An identifier for a +TZInfo::Timezone+ object (e.g., "America/New_York"). # # Here's an example of how you might set Time.zone on a per request basis and reset it when the request is done. # current_user.time_zone just needs to return a string identifying the user's preferred time zone: @@ -18802,12 +22260,9 @@ Time::COMMON_YEAR_DAYS_IN_MONTH = T.let(T.unsafe(nil), Array) # source://activesupport//lib/active_support/core_ext/time/conversions.rb#8 Time::DATE_FORMATS = T.let(T.unsafe(nil), Hash) -# source://activesupport//lib/active_support/core_ext/time/deprecated_conversions.rb#6 -Time::NOT_SET = T.let(T.unsafe(nil), Object) - -# source://activesupport//lib/active_support/core_ext/object/blank.rb#72 +# source://activesupport//lib/active_support/core_ext/object/to_query.rb#31 class TrueClass - # source://activesupport//lib/active_support/core_ext/object/json.rb#75 + # source://activesupport//lib/active_support/core_ext/object/json.rb#81 def as_json(options = T.unsafe(nil)); end # +true+ is not blank: @@ -18816,33 +22271,22 @@ class TrueClass # # @return [false] # - # source://activesupport//lib/active_support/core_ext/object/blank.rb#78 + # source://activesupport//lib/active_support/core_ext/object/blank.rb#86 def blank?; end + # @return [Boolean] + # + # source://activesupport//lib/active_support/core_ext/object/blank.rb#90 + def present?; end + # Returns +self+. # - # source://activesupport//lib/active_support/core_ext/object/to_query.rb#27 + # source://activesupport//lib/active_support/core_ext/object/to_query.rb#33 def to_param; end end -# source://activesupport//lib/active_support/core_ext/object/json.rb#216 +# source://activesupport//lib/active_support/core_ext/object/json.rb#230 class URI::Generic - include ::URI::RFC2396_REGEXP - include ::URI - - # source://activesupport//lib/active_support/core_ext/object/json.rb#217 + # source://activesupport//lib/active_support/core_ext/object/json.rb#231 def as_json(options = T.unsafe(nil)); end end - -# source://activesupport//lib/active_support/core_ext/object/duplicable.rb#41 -class UnboundMethod - # Unbound methods are not duplicable: - # - # method(:puts).unbind.duplicable? # => false - # method(:puts).unbind.dup # => TypeError: allocator undefined for UnboundMethod - # - # @return [Boolean] - # - # source://activesupport//lib/active_support/core_ext/object/duplicable.rb#46 - def duplicable?; end -end diff --git a/sorbet/rbi/gems/addressable@2.8.9.rbi b/sorbet/rbi/gems/addressable@2.8.9.rbi new file mode 100644 index 0000000..6999fe2 --- /dev/null +++ b/sorbet/rbi/gems/addressable@2.8.9.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `addressable` gem. +# Please instead update this file by running `bin/tapioca gem addressable`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/ast@2.4.2.rbi b/sorbet/rbi/gems/ast@2.4.3.rbi similarity index 98% rename from sorbet/rbi/gems/ast@2.4.2.rbi rename to sorbet/rbi/gems/ast@2.4.3.rbi index 3fc4495..c05e587 100644 --- a/sorbet/rbi/gems/ast@2.4.2.rbi +++ b/sorbet/rbi/gems/ast@2.4.3.rbi @@ -4,6 +4,7 @@ # This is an autogenerated file for types exported from the `ast` gem. # Please instead update this file by running `bin/tapioca gem ast`. + # {AST} is a library for manipulating abstract syntax trees. # # It embraces immutability; each AST node is inherently frozen at @@ -76,14 +77,14 @@ class AST::Node # # @return [AST::Node] # - # source://ast//lib/ast/node.rb#168 + # source://ast//lib/ast/node.rb#172 def +(array); end # Appends `element` to `children` and returns the resulting node. # # @return [AST::Node] # - # source://ast//lib/ast/node.rb#177 + # source://ast//lib/ast/node.rb#181 def <<(element); end # Compares `self` to `other`, possibly converting with `to_ast`. Only @@ -122,7 +123,7 @@ class AST::Node # # @return self # - # source://ast//lib/ast/node.rb#115 + # source://ast//lib/ast/node.rb#118 def clone; end # Concatenates `array` with `children` and returns the resulting node. @@ -159,7 +160,7 @@ class AST::Node # Returns the precomputed hash value for this node # - # @return [Fixnum] + # @return [Integer] # # source://ast//lib/ast/node.rb#61 def hash; end @@ -185,7 +186,7 @@ class AST::Node # # @return [Array] # - # source://ast//lib/ast/node.rb#56 + # source://ast//lib/ast/node.rb#57 def to_a; end # @return [AST::Node] self @@ -198,7 +199,7 @@ class AST::Node # @param indent [Integer] Base indentation level. # @return [String] # - # source://ast//lib/ast/node.rb#187 + # source://ast//lib/ast/node.rb#204 def to_s(indent = T.unsafe(nil)); end # Converts `self` to a pretty-printed s-expression. @@ -233,9 +234,9 @@ class AST::Node # # If the resulting node would be identical to `self`, does nothing. # - # @param type [Symbol, nil] # @param children [Array, nil] # @param properties [Hash, nil] + # @param type [Symbol, nil] # @return [AST::Node] # # source://ast//lib/ast/node.rb#133 @@ -265,6 +266,7 @@ class AST::Node private + # source://ast//lib/ast/node.rb#107 def original_dup; end end @@ -556,8 +558,8 @@ end # to define deeply nested ASTs from Ruby code, for example, in # tests. It should be used like this: # -# describe YourLanguage::AST do -# include Sexp +# describe YourLanguage do +# include ::AST::Sexp # # it "should correctly parse expressions" do # YourLanguage.parse("1 + 2 * 3").should == diff --git a/sorbet/rbi/gems/base64@0.3.0.rbi b/sorbet/rbi/gems/base64@0.3.0.rbi new file mode 100644 index 0000000..e8543fc --- /dev/null +++ b/sorbet/rbi/gems/base64@0.3.0.rbi @@ -0,0 +1,545 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `base64` gem. +# Please instead update this file by running `bin/tapioca gem base64`. + + +# \Module \Base64 provides methods for: +# +# - \Encoding a binary string (containing non-ASCII characters) +# as a string of printable ASCII characters. +# - Decoding such an encoded string. +# +# \Base64 is commonly used in contexts where binary data +# is not allowed or supported: +# +# - Images in HTML or CSS files, or in URLs. +# - Email attachments. +# +# A \Base64-encoded string is about one-third larger that its source. +# See the {Wikipedia article}[https://en.wikipedia.org/wiki/Base64] +# for more information. +# +# This module provides three pairs of encode/decode methods. +# Your choices among these methods should depend on: +# +# - Which character set is to be used for encoding and decoding. +# - Whether "padding" is to be used. +# - Whether encoded strings are to contain newlines. +# +# Note: Examples on this page assume that the including program has executed: +# +# require 'base64' +# +# == \Encoding Character Sets +# +# A \Base64-encoded string consists only of characters from a 64-character set: +# +# - ('A'..'Z'). +# - ('a'..'z'). +# - ('0'..'9'). +# - =, the 'padding' character. +# - Either: +# - %w[+ /]: +# {RFC-2045-compliant}[https://datatracker.ietf.org/doc/html/rfc2045]; +# _not_ safe for URLs. +# - %w[- _]: +# {RFC-4648-compliant}[https://datatracker.ietf.org/doc/html/rfc4648]; +# safe for URLs. +# +# If you are working with \Base64-encoded strings that will come from +# or be put into URLs, you should choose this encoder-decoder pair +# of RFC-4648-compliant methods: +# +# - Base64.urlsafe_encode64 and Base64.urlsafe_decode64. +# +# Otherwise, you may choose any of the pairs in this module, +# including the pair above, or the RFC-2045-compliant pairs: +# +# - Base64.encode64 and Base64.decode64. +# - Base64.strict_encode64 and Base64.strict_decode64. +# +# == Padding +# +# \Base64-encoding changes a triplet of input bytes +# into a quartet of output characters. +# +# Padding in Encode Methods +# +# Padding -- extending an encoded string with zero, one, or two trailing +# = characters -- is performed by methods Base64.encode64, +# Base64.strict_encode64, and, by default, Base64.urlsafe_encode64: +# +# Base64.encode64('s') # => "cw==\n" +# Base64.strict_encode64('s') # => "cw==" +# Base64.urlsafe_encode64('s') # => "cw==" +# Base64.urlsafe_encode64('s', padding: false) # => "cw" +# +# When padding is performed, the encoded string is always of length 4n, +# where +n+ is a non-negative integer: +# +# - Input bytes of length 3n generate unpadded output characters +# of length 4n: +# +# # n = 1: 3 bytes => 4 characters. +# Base64.strict_encode64('123') # => "MDEy" +# # n = 2: 6 bytes => 8 characters. +# Base64.strict_encode64('123456') # => "MDEyMzQ1" +# +# - Input bytes of length 3n+1 generate padded output characters +# of length 4(n+1), with two padding characters at the end: +# +# # n = 1: 4 bytes => 8 characters. +# Base64.strict_encode64('1234') # => "MDEyMw==" +# # n = 2: 7 bytes => 12 characters. +# Base64.strict_encode64('1234567') # => "MDEyMzQ1Ng==" +# +# - Input bytes of length 3n+2 generate padded output characters +# of length 4(n+1), with one padding character at the end: +# +# # n = 1: 5 bytes => 8 characters. +# Base64.strict_encode64('12345') # => "MDEyMzQ=" +# # n = 2: 8 bytes => 12 characters. +# Base64.strict_encode64('12345678') # => "MDEyMzQ1Njc=" +# +# When padding is suppressed, for a positive integer n: +# +# - Input bytes of length 3n generate unpadded output characters +# of length 4n: +# +# # n = 1: 3 bytes => 4 characters. +# Base64.urlsafe_encode64('123', padding: false) # => "MDEy" +# # n = 2: 6 bytes => 8 characters. +# Base64.urlsafe_encode64('123456', padding: false) # => "MDEyMzQ1" +# +# - Input bytes of length 3n+1 generate unpadded output characters +# of length 4n+2, with two padding characters at the end: +# +# # n = 1: 4 bytes => 6 characters. +# Base64.urlsafe_encode64('1234', padding: false) # => "MDEyMw" +# # n = 2: 7 bytes => 10 characters. +# Base64.urlsafe_encode64('1234567', padding: false) # => "MDEyMzQ1Ng" +# +# - Input bytes of length 3n+2 generate unpadded output characters +# of length 4n+3, with one padding character at the end: +# +# # n = 1: 5 bytes => 7 characters. +# Base64.urlsafe_encode64('12345', padding: false) # => "MDEyMzQ" +# # m = 2: 8 bytes => 11 characters. +# Base64.urlsafe_encode64('12345678', padding: false) # => "MDEyMzQ1Njc" +# +# Padding in Decode Methods +# +# All of the \Base64 decode methods support (but do not require) padding. +# +# \Method Base64.decode64 does not check the size of the padding: +# +# Base64.decode64("MDEyMzQ1Njc") # => "01234567" +# Base64.decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.decode64("MDEyMzQ1Njc==") # => "01234567" +# +# \Method Base64.strict_decode64 strictly enforces padding size: +# +# Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError +# Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError +# +# \Method Base64.urlsafe_decode64 allows padding in the encoded string, +# which if present, must be correct: +# see {Padding}[Base64.html#module-Base64-label-Padding], above: +# +# Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" +# Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" +# Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. +# +# == Newlines +# +# An encoded string returned by Base64.encode64 or Base64.urlsafe_encode64 +# has an embedded newline character +# after each 60-character sequence, and, if non-empty, at the end: +# +# # No newline if empty. +# encoded = Base64.encode64("\x00" * 0) +# encoded.index("\n") # => nil +# +# # Newline at end of short output. +# encoded = Base64.encode64("\x00" * 1) +# encoded.size # => 4 +# encoded.index("\n") # => 4 +# +# # Newline at end of longer output. +# encoded = Base64.encode64("\x00" * 45) +# encoded.size # => 60 +# encoded.index("\n") # => 60 +# +# # Newlines embedded and at end of still longer output. +# encoded = Base64.encode64("\x00" * 46) +# encoded.size # => 65 +# encoded.rindex("\n") # => 65 +# encoded.split("\n").map {|s| s.size } # => [60, 4] +# +# The string to be encoded may itself contain newlines, +# which are encoded as \Base64: +# +# # Base64.encode64("\n\n\n") # => "CgoK\n" +# s = "This is line 1\nThis is line 2\n" +# Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" +# +# source://base64//lib/base64.rb#184 +module Base64 + private + + # :call-seq: + # Base64.decode(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are ignored; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.decode64("\x00\n-_") # => "" + # + # Padding in +encoded_string+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # source://base64//lib/base64.rb#247 + def decode64(str); end + + # :call-seq: + # Base64.encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.encode64('*') # => "Kg==\n" + # + # The returned string ends with a newline character, and if sufficiently long + # will have one or more embedded newline characters; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.encode64('*') # => "Kg==\n" + # Base64.encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.encode64("\n\n\n") # => "CgoK\n" + # s = "This is line 1\nThis is line 2\n" + # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # + # source://base64//lib/base64.rb#222 + def encode64(bin); end + + # :call-seq: + # Base64.strict_decode64(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are not allowed; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.strict_decode64("\n") # Raises ArgumentError + # Base64.strict_decode64('-') # Raises ArgumentError + # Base64.strict_decode64('_') # Raises ArgumentError + # + # Padding in +encoded_string+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # source://base64//lib/base64.rb#309 + def strict_decode64(str); end + + # :call-seq: + # Base64.strict_encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.strict_encode64('*') # => "Kg==\n" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.strict_encode64('*') # => "Kg==" + # Base64.strict_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.strict_encode64("\n\n\n") # => "CgoK" + # s = "This is line 1\nThis is line 2\n" + # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # + # source://base64//lib/base64.rb#282 + def strict_encode64(bin); end + + # :call-seq: + # Base64.urlsafe_decode64(encoded_string) -> decoded_string + # + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +encoded_string+: + # + # +encoded_string+ may not contain non-Base64 characters; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_decode64('+') # Raises ArgumentError. + # Base64.urlsafe_decode64('/') # Raises ArgumentError. + # Base64.urlsafe_decode64("\n") # Raises ArgumentError. + # + # Padding in +encoded_string+, if present, must be correct: + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. + # + # source://base64//lib/base64.rb#369 + def urlsafe_decode64(str); end + + # :call-seq: + # Base64.urlsafe_encode64(string) -> encoded_string + # + # Returns the RFC-4648-compliant \Base64-encoding of +string+. + # + # Per RFC 4648, the returned string will not contain the URL-unsafe characters + # + or /, + # but instead may contain the URL-safe characters + # - and _; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----" + # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____" + # + # By default, the returned string may have padding; + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # + # Optionally, you can suppress padding: + # + # Base64.urlsafe_encode64('*', padding: false) # => "Kg" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # Base64.urlsafe_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # source://base64//lib/base64.rb#343 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + + class << self + # :call-seq: + # Base64.decode(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are ignored; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.decode64("\x00\n-_") # => "" + # + # Padding in +encoded_string+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # source://base64//lib/base64.rb#247 + def decode64(str); end + + # :call-seq: + # Base64.encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.encode64('*') # => "Kg==\n" + # + # The returned string ends with a newline character, and if sufficiently long + # will have one or more embedded newline characters; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.encode64('*') # => "Kg==\n" + # Base64.encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.encode64("\n\n\n") # => "CgoK\n" + # s = "This is line 1\nThis is line 2\n" + # Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # + # source://base64//lib/base64.rb#222 + def encode64(bin); end + + # :call-seq: + # Base64.strict_decode64(encoded_string) -> decoded_string + # + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +encoded_string+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +encoded_string+ are not allowed; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # these include newline characters and characters - and /: + # + # Base64.strict_decode64("\n") # Raises ArgumentError + # Base64.strict_decode64('-') # Raises ArgumentError + # Base64.strict_decode64('_') # Raises ArgumentError + # + # Padding in +encoded_string+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # source://base64//lib/base64.rb#309 + def strict_decode64(str); end + + # :call-seq: + # Base64.strict_encode64(string) -> encoded_string + # + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +string+. + # + # Per RFC 2045, the returned string may contain the URL-unsafe characters + # + or /; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.strict_encode64("\xFB\xEF\xBE") # => "++++\n" + # Base64.strict_encode64("\xFF\xFF\xFF") # => "////\n" + # + # The returned string may include padding; + # see {Padding}[Base64.html#module-Base64-label-Padding] above. + # + # Base64.strict_encode64('*') # => "Kg==\n" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.strict_encode64('*') # => "Kg==" + # Base64.strict_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # The string to be encoded may itself contain newlines, + # which will be encoded as ordinary \Base64: + # + # Base64.strict_encode64("\n\n\n") # => "CgoK" + # s = "This is line 1\nThis is line 2\n" + # Base64.strict_encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # + # source://base64//lib/base64.rb#282 + def strict_encode64(bin); end + + # :call-seq: + # Base64.urlsafe_decode64(encoded_string) -> decoded_string + # + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +encoded_string+: + # + # +encoded_string+ may not contain non-Base64 characters; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_decode64('+') # Raises ArgumentError. + # Base64.urlsafe_decode64('/') # Raises ArgumentError. + # Base64.urlsafe_decode64("\n") # Raises ArgumentError. + # + # Padding in +encoded_string+, if present, must be correct: + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.urlsafe_decode64("MDEyMzQ1Njc==") # Raises ArgumentError. + # + # source://base64//lib/base64.rb#369 + def urlsafe_decode64(str); end + + # :call-seq: + # Base64.urlsafe_encode64(string) -> encoded_string + # + # Returns the RFC-4648-compliant \Base64-encoding of +string+. + # + # Per RFC 4648, the returned string will not contain the URL-unsafe characters + # + or /, + # but instead may contain the URL-safe characters + # - and _; + # see {Encoding Character Set}[Base64.html#module-Base64-label-Encoding+Character+Sets] above: + # + # Base64.urlsafe_encode64("\xFB\xEF\xBE") # => "----" + # Base64.urlsafe_encode64("\xFF\xFF\xFF") # => "____" + # + # By default, the returned string may have padding; + # see {Padding}[Base64.html#module-Base64-label-Padding], above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # + # Optionally, you can suppress padding: + # + # Base64.urlsafe_encode64('*', padding: false) # => "Kg" + # + # The returned string will have no newline characters, regardless of its length; + # see {Newlines}[Base64.html#module-Base64-label-Newlines] above: + # + # Base64.urlsafe_encode64('*') # => "Kg==" + # Base64.urlsafe_encode64('*' * 46) + # # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg==" + # + # source://base64//lib/base64.rb#343 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + end +end + +# source://base64//lib/base64.rb#186 +Base64::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/benchmark@0.5.0.rbi b/sorbet/rbi/gems/benchmark@0.5.0.rbi new file mode 100644 index 0000000..8531eef --- /dev/null +++ b/sorbet/rbi/gems/benchmark@0.5.0.rbi @@ -0,0 +1,637 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `benchmark` gem. +# Please instead update this file by running `bin/tapioca gem benchmark`. + + +# The Benchmark module provides methods to measure and report the time +# used to execute Ruby code. +# +# * Measure the time to construct the string given by the expression +# "a"*1_000_000_000: +# +# require 'benchmark' +# +# puts Benchmark.measure { "a"*1_000_000_000 } +# +# On my machine (OSX 10.8.3 on i5 1.7 GHz) this generates: +# +# 0.350000 0.400000 0.750000 ( 0.835234) +# +# This report shows the user CPU time, system CPU time, the total time +# (sum of user CPU time, system CPU time, children's user CPU time, +# and children's system CPU time), and the elapsed real time. The unit +# of time is seconds. +# +# * Do some experiments sequentially using the #bm method: +# +# require 'benchmark' +# +# n = 5000000 +# Benchmark.bm do |x| +# x.report { for i in 1..n; a = "1"; end } +# x.report { n.times do ; a = "1"; end } +# x.report { 1.upto(n) do ; a = "1"; end } +# end +# +# The result: +# +# user system total real +# 1.010000 0.000000 1.010000 ( 1.014479) +# 1.000000 0.000000 1.000000 ( 0.998261) +# 0.980000 0.000000 0.980000 ( 0.981335) +# +# * Continuing the previous example, put a label in each report: +# +# require 'benchmark' +# +# n = 5000000 +# Benchmark.bm(7) do |x| +# x.report("for:") { for i in 1..n; a = "1"; end } +# x.report("times:") { n.times do ; a = "1"; end } +# x.report("upto:") { 1.upto(n) do ; a = "1"; end } +# end +# +# The result: +# +# user system total real +# for: 1.010000 0.000000 1.010000 ( 1.015688) +# times: 1.000000 0.000000 1.000000 ( 1.003611) +# upto: 1.030000 0.000000 1.030000 ( 1.028098) +# +# * The times for some benchmarks depend on the order in which items +# are run. These differences are due to the cost of memory +# allocation and garbage collection. To avoid these discrepancies, +# the #bmbm method is provided. For example, to compare ways to +# sort an array of floats: +# +# require 'benchmark' +# +# array = (1..1000000).map { rand } +# +# Benchmark.bmbm do |x| +# x.report("sort!") { array.dup.sort! } +# x.report("sort") { array.dup.sort } +# end +# +# The result: +# +# Rehearsal ----------------------------------------- +# sort! 1.490000 0.010000 1.500000 ( 1.490520) +# sort 1.460000 0.000000 1.460000 ( 1.463025) +# -------------------------------- total: 2.960000sec +# +# user system total real +# sort! 1.460000 0.000000 1.460000 ( 1.460465) +# sort 1.450000 0.010000 1.460000 ( 1.448327) +# +# * Report statistics of sequential experiments with unique labels, +# using the #benchmark method: +# +# require 'benchmark' +# include Benchmark # we need the CAPTION and FORMAT constants +# +# n = 5000000 +# Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x| +# tf = x.report("for:") { for i in 1..n; a = "1"; end } +# tt = x.report("times:") { n.times do ; a = "1"; end } +# tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end } +# [tf+tt+tu, (tf+tt+tu)/3] +# end +# +# The result: +# +# user system total real +# for: 0.950000 0.000000 0.950000 ( 0.952039) +# times: 0.980000 0.000000 0.980000 ( 0.984938) +# upto: 0.950000 0.000000 0.950000 ( 0.946787) +# >total: 2.880000 0.000000 2.880000 ( 2.883764) +# >avg: 0.960000 0.000000 0.960000 ( 0.961255) +# +# source://benchmark//lib/benchmark.rb#123 +module Benchmark + private + + # Invokes the block with a Benchmark::Report object, which + # may be used to collect and report on the results of individual + # benchmark tests. Reserves +label_width+ leading spaces for + # labels on each line. Prints +caption+ at the top of the + # report, and uses +format+ to format each line. + # (Note: +caption+ must contain a terminating newline character, + # see the default Benchmark::Tms::CAPTION for an example.) + # + # Returns an array of Benchmark::Tms objects. + # + # If the block returns an array of + # Benchmark::Tms objects, these will be used to format + # additional lines of output. If +labels+ parameter are + # given, these are used to label these extra lines. + # + # _Note_: Other methods provide a simpler interface to this one, and are + # suitable for nearly all benchmarking requirements. See the examples in + # Benchmark, and the #bm and #bmbm methods. + # + # Example: + # + # require 'benchmark' + # include Benchmark # we need the CAPTION and FORMAT constants + # + # n = 5000000 + # Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x| + # tf = x.report("for:") { for i in 1..n; a = "1"; end } + # tt = x.report("times:") { n.times do ; a = "1"; end } + # tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end } + # [tf+tt+tu, (tf+tt+tu)/3] + # end + # + # Generates: + # + # user system total real + # for: 0.970000 0.000000 0.970000 ( 0.970493) + # times: 0.990000 0.000000 0.990000 ( 0.989542) + # upto: 0.970000 0.000000 0.970000 ( 0.972854) + # >total: 2.930000 0.000000 2.930000 ( 2.932889) + # >avg: 0.976667 0.000000 0.976667 ( 0.977630) + # + # source://benchmark//lib/benchmark.rb#171 + def benchmark(caption = T.unsafe(nil), label_width = T.unsafe(nil), format = T.unsafe(nil), *labels); end + + # A simple interface to the #benchmark method, #bm generates sequential + # reports with labels. +label_width+ and +labels+ parameters have the same + # meaning as for #benchmark. + # + # require 'benchmark' + # + # n = 5000000 + # Benchmark.bm(7) do |x| + # x.report("for:") { for i in 1..n; a = "1"; end } + # x.report("times:") { n.times do ; a = "1"; end } + # x.report("upto:") { 1.upto(n) do ; a = "1"; end } + # end + # + # Generates: + # + # user system total real + # for: 0.960000 0.000000 0.960000 ( 0.957966) + # times: 0.960000 0.000000 0.960000 ( 0.960423) + # upto: 0.950000 0.000000 0.950000 ( 0.954864) + # + # source://benchmark//lib/benchmark.rb#216 + def bm(label_width = T.unsafe(nil), *labels, &blk); end + + # Sometimes benchmark results are skewed because code executed + # earlier encounters different garbage collection overheads than + # that run later. #bmbm attempts to minimize this effect by running + # the tests twice, the first time as a rehearsal in order to get the + # runtime environment stable, the second time for + # real. GC.start is executed before the start of each of + # the real timings; the cost of this is not included in the + # timings. In reality, though, there's only so much that #bmbm can + # do, and the results are not guaranteed to be isolated from garbage + # collection and other effects. + # + # Because #bmbm takes two passes through the tests, it can + # calculate the required label width. + # + # require 'benchmark' + # + # array = (1..1000000).map { rand } + # + # Benchmark.bmbm do |x| + # x.report("sort!") { array.dup.sort! } + # x.report("sort") { array.dup.sort } + # end + # + # Generates: + # + # Rehearsal ----------------------------------------- + # sort! 1.440000 0.010000 1.450000 ( 1.446833) + # sort 1.440000 0.000000 1.440000 ( 1.448257) + # -------------------------------- total: 2.890000sec + # + # user system total real + # sort! 1.460000 0.000000 1.460000 ( 1.458065) + # sort 1.450000 0.000000 1.450000 ( 1.455963) + # + # #bmbm yields a Benchmark::Job object and returns an array of + # Benchmark::Tms objects. + # + # source://benchmark//lib/benchmark.rb#258 + def bmbm(width = T.unsafe(nil)); end + + # Returns the time used to execute the given block as a + # Benchmark::Tms object. Takes +label+ option. + # + # require 'benchmark' + # + # n = 1000000 + # + # time = Benchmark.measure do + # n.times { a = "1" } + # end + # puts time + # + # Generates: + # + # 0.220000 0.000000 0.220000 ( 0.227313) + # + # source://benchmark//lib/benchmark.rb#303 + def measure(label = T.unsafe(nil)); end + + # Returns the elapsed real time used to execute the given block. + # The unit of time is milliseconds. + # + # Benchmark.ms { "a" * 1_000_000_000 } + # #=> 509.8029999935534 + # + # source://benchmark//lib/benchmark.rb#335 + def ms; end + + # Returns the elapsed real time used to execute the given block. + # The unit of time is seconds. + # + # Benchmark.realtime { "a" * 1_000_000_000 } + # #=> 0.5098029999935534 + # + # source://benchmark//lib/benchmark.rb#322 + def realtime; end + + class << self + # Invokes the block with a Benchmark::Report object, which + # may be used to collect and report on the results of individual + # benchmark tests. Reserves +label_width+ leading spaces for + # labels on each line. Prints +caption+ at the top of the + # report, and uses +format+ to format each line. + # (Note: +caption+ must contain a terminating newline character, + # see the default Benchmark::Tms::CAPTION for an example.) + # + # Returns an array of Benchmark::Tms objects. + # + # If the block returns an array of + # Benchmark::Tms objects, these will be used to format + # additional lines of output. If +labels+ parameter are + # given, these are used to label these extra lines. + # + # _Note_: Other methods provide a simpler interface to this one, and are + # suitable for nearly all benchmarking requirements. See the examples in + # Benchmark, and the #bm and #bmbm methods. + # + # Example: + # + # require 'benchmark' + # include Benchmark # we need the CAPTION and FORMAT constants + # + # n = 5000000 + # Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x| + # tf = x.report("for:") { for i in 1..n; a = "1"; end } + # tt = x.report("times:") { n.times do ; a = "1"; end } + # tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end } + # [tf+tt+tu, (tf+tt+tu)/3] + # end + # + # Generates: + # + # user system total real + # for: 0.970000 0.000000 0.970000 ( 0.970493) + # times: 0.990000 0.000000 0.990000 ( 0.989542) + # upto: 0.970000 0.000000 0.970000 ( 0.972854) + # >total: 2.930000 0.000000 2.930000 ( 2.932889) + # >avg: 0.976667 0.000000 0.976667 ( 0.977630) + # + # source://benchmark//lib/benchmark.rb#341 + def benchmark(caption = T.unsafe(nil), label_width = T.unsafe(nil), format = T.unsafe(nil), *labels); end + + # A simple interface to the #benchmark method, #bm generates sequential + # reports with labels. +label_width+ and +labels+ parameters have the same + # meaning as for #benchmark. + # + # require 'benchmark' + # + # n = 5000000 + # Benchmark.bm(7) do |x| + # x.report("for:") { for i in 1..n; a = "1"; end } + # x.report("times:") { n.times do ; a = "1"; end } + # x.report("upto:") { 1.upto(n) do ; a = "1"; end } + # end + # + # Generates: + # + # user system total real + # for: 0.960000 0.000000 0.960000 ( 0.957966) + # times: 0.960000 0.000000 0.960000 ( 0.960423) + # upto: 0.950000 0.000000 0.950000 ( 0.954864) + # + # source://benchmark//lib/benchmark.rb#341 + def bm(label_width = T.unsafe(nil), *labels, &blk); end + + # Sometimes benchmark results are skewed because code executed + # earlier encounters different garbage collection overheads than + # that run later. #bmbm attempts to minimize this effect by running + # the tests twice, the first time as a rehearsal in order to get the + # runtime environment stable, the second time for + # real. GC.start is executed before the start of each of + # the real timings; the cost of this is not included in the + # timings. In reality, though, there's only so much that #bmbm can + # do, and the results are not guaranteed to be isolated from garbage + # collection and other effects. + # + # Because #bmbm takes two passes through the tests, it can + # calculate the required label width. + # + # require 'benchmark' + # + # array = (1..1000000).map { rand } + # + # Benchmark.bmbm do |x| + # x.report("sort!") { array.dup.sort! } + # x.report("sort") { array.dup.sort } + # end + # + # Generates: + # + # Rehearsal ----------------------------------------- + # sort! 1.440000 0.010000 1.450000 ( 1.446833) + # sort 1.440000 0.000000 1.440000 ( 1.448257) + # -------------------------------- total: 2.890000sec + # + # user system total real + # sort! 1.460000 0.000000 1.460000 ( 1.458065) + # sort 1.450000 0.000000 1.450000 ( 1.455963) + # + # #bmbm yields a Benchmark::Job object and returns an array of + # Benchmark::Tms objects. + # + # source://benchmark//lib/benchmark.rb#341 + def bmbm(width = T.unsafe(nil)); end + + # Returns the time used to execute the given block as a + # Benchmark::Tms object. Takes +label+ option. + # + # require 'benchmark' + # + # n = 1000000 + # + # time = Benchmark.measure do + # n.times { a = "1" } + # end + # puts time + # + # Generates: + # + # 0.220000 0.000000 0.220000 ( 0.227313) + # + # source://benchmark//lib/benchmark.rb#341 + def measure(label = T.unsafe(nil)); end + + # Returns the elapsed real time used to execute the given block. + # The unit of time is milliseconds. + # + # Benchmark.ms { "a" * 1_000_000_000 } + # #=> 509.8029999935534 + # + # source://benchmark//lib/benchmark.rb#341 + def ms; end + + # Returns the elapsed real time used to execute the given block. + # The unit of time is seconds. + # + # Benchmark.realtime { "a" * 1_000_000_000 } + # #=> 0.5098029999935534 + # + # source://benchmark//lib/benchmark.rb#341 + def realtime; end + end +end + +# A Job is a sequence of labelled blocks to be processed by the +# Benchmark.bmbm method. It is of little direct interest to the user. +# +# source://benchmark//lib/benchmark.rb#347 +class Benchmark::Job + # Returns an initialized Job instance. + # Usually, one doesn't call this method directly, as new + # Job objects are created by the #bmbm method. + # +width+ is a initial value for the label offset used in formatting; + # the #bmbm method passes its +width+ argument to this constructor. + # + # @return [Job] a new instance of Job + # + # source://benchmark//lib/benchmark.rb#355 + def initialize(width); end + + # Registers the given label and block pair in the job list. + # + # @raise [ArgumentError] + # + # source://benchmark//lib/benchmark.rb#363 + def item(label = T.unsafe(nil), &blk); end + + # An array of 2-element arrays, consisting of label and block pairs. + # + # source://benchmark//lib/benchmark.rb#375 + def list; end + + # Registers the given label and block pair in the job list. + # + # @raise [ArgumentError] + # + # source://benchmark//lib/benchmark.rb#372 + def report(label = T.unsafe(nil), &blk); end + + # Length of the widest label in the #list. + # + # source://benchmark//lib/benchmark.rb#378 + def width; end +end + +# This class is used by the Benchmark.benchmark and Benchmark.bm methods. +# It is of little direct interest to the user. +# +# source://benchmark//lib/benchmark.rb#385 +class Benchmark::Report + # Returns an initialized Report instance. + # Usually, one doesn't call this method directly, as new + # Report objects are created by the #benchmark and #bm methods. + # +width+ and +format+ are the label offset and + # format string used by Tms#format. + # + # @return [Report] a new instance of Report + # + # source://benchmark//lib/benchmark.rb#393 + def initialize(width = T.unsafe(nil), format = T.unsafe(nil)); end + + # An array of Benchmark::Tms objects representing each item. + # + # source://benchmark//lib/benchmark.rb#412 + def format; end + + # Prints the +label+ and measured time for the block, + # formatted by +format+. See Tms#format for the + # formatting rules. + # + # source://benchmark//lib/benchmark.rb#402 + def item(label = T.unsafe(nil), *format, &blk); end + + # An array of Benchmark::Tms objects representing each item. + # + # source://benchmark//lib/benchmark.rb#412 + def list; end + + # Prints the +label+ and measured time for the block, + # formatted by +format+. See Tms#format for the + # formatting rules. + # + # source://benchmark//lib/benchmark.rb#409 + def report(label = T.unsafe(nil), *format, &blk); end + + # An array of Benchmark::Tms objects representing each item. + # + # source://benchmark//lib/benchmark.rb#412 + def width; end +end + +# A data object, representing the times associated with a benchmark +# measurement. +# +# source://benchmark//lib/benchmark.rb#421 +class Benchmark::Tms + # Returns an initialized Tms object which has + # +utime+ as the user CPU time, +stime+ as the system CPU time, + # +cutime+ as the children's user CPU time, +cstime+ as the children's + # system CPU time, +real+ as the elapsed real time and +label+ as the label. + # + # @return [Tms] a new instance of Tms + # + # source://benchmark//lib/benchmark.rb#456 + def initialize(utime = T.unsafe(nil), stime = T.unsafe(nil), cutime = T.unsafe(nil), cstime = T.unsafe(nil), real = T.unsafe(nil), label = T.unsafe(nil)); end + + # Returns a new Tms object obtained by memberwise multiplication + # of the individual times for this Tms object by +x+. + # + # source://benchmark//lib/benchmark.rb#504 + def *(x); end + + # Returns a new Tms object obtained by memberwise summation + # of the individual times for this Tms object with those of the +other+ + # Tms object. + # This method and #/() are useful for taking statistics. + # + # source://benchmark//lib/benchmark.rb#491 + def +(other); end + + # Returns a new Tms object obtained by memberwise subtraction + # of the individual times for the +other+ Tms object from those of this + # Tms object. + # + # source://benchmark//lib/benchmark.rb#498 + def -(other); end + + # Returns a new Tms object obtained by memberwise division + # of the individual times for this Tms object by +x+. + # This method and #+() are useful for taking statistics. + # + # source://benchmark//lib/benchmark.rb#511 + def /(x); end + + # Returns a new Tms object whose times are the sum of the times for this + # Tms object, plus the time required to execute the code block (+blk+). + # + # source://benchmark//lib/benchmark.rb#465 + def add(&blk); end + + # An in-place version of #add. + # Changes the times of this Tms object by making it the sum of the times + # for this Tms object, plus the time required to execute + # the code block (+blk+). + # + # source://benchmark//lib/benchmark.rb#475 + def add!(&blk); end + + # System CPU time of children + # + # source://benchmark//lib/benchmark.rb#439 + def cstime; end + + # User CPU time of children + # + # source://benchmark//lib/benchmark.rb#436 + def cutime; end + + # Returns the contents of this Tms object as + # a formatted string, according to a +format+ string + # like that passed to Kernel.format. In addition, #format + # accepts the following extensions: + # + # %u:: Replaced by the user CPU time, as reported by Tms#utime. + # %y:: Replaced by the system CPU time, as reported by Tms#stime (Mnemonic: y of "s*y*stem") + # %U:: Replaced by the children's user CPU time, as reported by Tms#cutime + # %Y:: Replaced by the children's system CPU time, as reported by Tms#cstime + # %t:: Replaced by the total CPU time, as reported by Tms#total + # %r:: Replaced by the elapsed real time, as reported by Tms#real + # %n:: Replaced by the label string, as reported by Tms#label (Mnemonic: n of "*n*ame") + # + # If +format+ is not given, FORMAT is used as default value, detailing the + # user, system, total and real elapsed time. + # + # source://benchmark//lib/benchmark.rb#530 + def format(format = T.unsafe(nil), *args); end + + # Label + # + # source://benchmark//lib/benchmark.rb#448 + def label; end + + # Elapsed real time + # + # source://benchmark//lib/benchmark.rb#442 + def real; end + + # System CPU time + # + # source://benchmark//lib/benchmark.rb#433 + def stime; end + + # Returns a new 6-element array, consisting of the + # label, user CPU time, system CPU time, children's + # user CPU time, children's system CPU time and elapsed + # real time. + # + # source://benchmark//lib/benchmark.rb#555 + def to_a; end + + # Returns a hash containing the same data as `to_a`. + # + # source://benchmark//lib/benchmark.rb#562 + def to_h; end + + # Same as #format. + # + # source://benchmark//lib/benchmark.rb#545 + def to_s; end + + # Total time, that is +utime+ + +stime+ + +cutime+ + +cstime+ + # + # source://benchmark//lib/benchmark.rb#445 + def total; end + + # User CPU time + # + # source://benchmark//lib/benchmark.rb#430 + def utime; end + + protected + + # Returns a new Tms object obtained by memberwise operation +op+ + # of the individual times for this Tms object with those of the other + # Tms object (+x+). + # + # +op+ can be a mathematical operation such as +, -, + # *, / + # + # source://benchmark//lib/benchmark.rb#583 + def memberwise(op, x); end +end + +# source://benchmark//lib/benchmark.rb#125 +Benchmark::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/better_html@2.0.1.rbi b/sorbet/rbi/gems/better_html@2.2.0.rbi similarity index 65% rename from sorbet/rbi/gems/better_html@2.0.1.rbi rename to sorbet/rbi/gems/better_html@2.2.0.rbi index 664bcde..7638800 100644 --- a/sorbet/rbi/gems/better_html@2.0.1.rbi +++ b/sorbet/rbi/gems/better_html@2.2.0.rbi @@ -4,22 +4,23 @@ # This is an autogenerated file for types exported from the `better_html` gem. # Please instead update this file by running `bin/tapioca gem better_html`. -# source://better_html//lib/better_html.rb#7 + +# source://better_html//lib/better_html.rb#8 module BetterHtml class << self - # source://better_html//lib/better_html.rb#11 + # source://better_html//lib/better_html.rb#12 def config; end # Sets the attribute config # # @param value the value to set the attribute config to. # - # source://better_html//lib/better_html.rb#9 + # source://better_html//lib/better_html.rb#10 def config=(_arg0); end # @yield [config] # - # source://better_html//lib/better_html.rb#15 + # source://better_html//lib/better_html.rb#16 def configure; end end end @@ -60,6 +61,190 @@ class BetterHtml::AST::Node < ::AST::Node def location; end end +# source://better_html//lib/better_html/better_erb/runtime_checks.rb#6 +class BetterHtml::BetterErb + # source://better_html//lib/better_html/better_erb.rb#11 + def content_types; end + + # source://better_html//lib/better_html/better_erb.rb#11 + def content_types=(val); end + + class << self + # source://better_html//lib/better_html/better_erb.rb#11 + def content_types; end + + # source://better_html//lib/better_html/better_erb.rb#11 + def content_types=(val); end + + # source://better_html//lib/better_html/better_erb.rb#18 + def prepend!; end + end +end + +# source://better_html//lib/better_html/better_erb.rb#23 +module BetterHtml::BetterErb::ConditionalImplementation + # source://better_html//lib/better_html/better_erb.rb#24 + def call(template, source = T.unsafe(nil)); end + + private + + # source://better_html//lib/better_html/better_erb.rb#30 + def generate(template, source); end +end + +# source://better_html//lib/better_html/better_erb/erubi_implementation.rb#8 +class BetterHtml::BetterErb::ErubiImplementation < ::ActionView::Template::Handlers::ERB::Erubi + include ::BetterHtml::BetterErb::RuntimeChecks + + # source://better_html//lib/better_html/better_erb/erubi_implementation.rb#39 + def add_code(code); end + + # source://better_html//lib/better_html/better_erb/erubi_implementation.rb#31 + def add_expression(indicator, code); end + + # source://better_html//lib/better_html/better_erb/erubi_implementation.rb#11 + def add_text(text); end + + private + + # source://better_html//lib/better_html/better_erb/erubi_implementation.rb#49 + def escape_text(text); end +end + +# source://better_html//lib/better_html/better_erb/runtime_checks.rb#7 +module BetterHtml::BetterErb::RuntimeChecks + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#8 + def initialize(erb, config: T.unsafe(nil), **options); end + + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#14 + def validate!; end + + private + + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#32 + def add_expr_auto_escaped(src, code, auto_escape); end + + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#82 + def block_check(src, code); end + + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#157 + def build_location(line, column, length); end + + # @raise [BetterHtml::HtmlError] + # + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#128 + def check_attribute_name(type, start, stop, line, column); end + + # @raise [BetterHtml::HtmlError] + # + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#94 + def check_parser_errors; end + + # @raise [BetterHtml::HtmlError] + # + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#138 + def check_quoted_value(type, start, stop, line, column); end + + # @raise [BetterHtml::HtmlError] + # + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#117 + def check_tag_name(type, start, stop, line, column); end + + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#110 + def check_token(type, *args); end + + # @raise [BetterHtml::HtmlError] + # + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#149 + def check_unquoted_value(type, start, stop, line, column); end + + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#24 + def class_name; end + + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#164 + def extract_line(line); end + + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#48 + def parser_context; end + + # source://better_html//lib/better_html/better_erb/runtime_checks.rb#28 + def wrap_method; end +end + +# source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#5 +class BetterHtml::BetterErb::ValidatedOutputBuffer + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#165 + def html_safe; end + + # @return [Boolean] + # + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#161 + def html_safe?; end + + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#169 + def to_s; end + + class << self + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#156 + def wrap(output, context, code, auto_escape); end + end +end + +# source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#6 +class BetterHtml::BetterErb::ValidatedOutputBuffer::Context + # @return [Context] a new instance of Context + # + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#7 + def initialize(output, context, code, auto_escape); end + + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#53 + def safe_after_attribute_name_append=(value); end + + # @raise [DontInterpolateHere] + # + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#65 + def safe_after_equal_append=(value); end + + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#40 + def safe_attribute_name_append=(value); end + + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#116 + def safe_comment_append=(value); end + + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#130 + def safe_none_append=(value); end + + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#14 + def safe_quoted_value_append=(value); end + + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#95 + def safe_rawtext_append=(value); end + + # @raise [DontInterpolateHere] + # + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#34 + def safe_space_after_attribute_append=(value); end + + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#70 + def safe_tag_append=(value); end + + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#82 + def safe_tag_name_append=(value); end + + # @raise [DontInterpolateHere] + # + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#27 + def safe_unquoted_value_append=(value); end + + private + + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#150 + def auto_escape_html_safe_value(arg); end + + # source://better_html//lib/better_html/better_erb/validated_output_buffer.rb#138 + def properly_escaped(value); end +end + # source://better_html//lib/better_html/config.rb#6 class BetterHtml::Config include ::SmartProperties @@ -67,17 +252,17 @@ class BetterHtml::Config # @return [Boolean] # - # source://better_html//lib/better_html/config.rb#19 + # source://better_html//lib/better_html/config.rb#20 def javascript_attribute_name?(name); end # @return [Boolean] # - # source://better_html//lib/better_html/config.rb#27 + # source://better_html//lib/better_html/config.rb#28 def javascript_safe_method?(name); end # @return [Boolean] # - # source://better_html//lib/better_html/config.rb#23 + # source://better_html//lib/better_html/config.rb#24 def lodash_safe_javascript_expression?(code); end end @@ -86,6 +271,7 @@ class BetterHtml::DontInterpolateHere < ::BetterHtml::InterpolatorError; end # source://better_html//lib/better_html/errors.rb#12 class BetterHtml::Errors < ::Array + # source://better_html//lib/better_html/errors.rb#13 def add(_arg0); end end @@ -160,12 +346,12 @@ class BetterHtml::Parser # source://better_html//lib/better_html/parser.rb#91 def build_erb_node(tokens); end - # source://better_html//lib/better_html/parser.rb#245 + # source://better_html//lib/better_html/parser.rb#249 def build_interpolation_node(tokens); end # @raise [ArgumentError] # - # source://better_html//lib/better_html/parser.rb#206 + # source://better_html//lib/better_html/parser.rb#210 def build_location(enumerable); end # source://better_html//lib/better_html/parser.rb#104 @@ -174,7 +360,7 @@ class BetterHtml::Parser # source://better_html//lib/better_html/parser.rb#165 def build_nameless_attribute_node(tokens); end - # source://better_html//lib/better_html/parser.rb#198 + # source://better_html//lib/better_html/parser.rb#202 def build_node(type, tokens, pre: T.unsafe(nil), post: T.unsafe(nil)); end # source://better_html//lib/better_html/parser.rb#145 @@ -186,37 +372,37 @@ class BetterHtml::Parser # source://better_html//lib/better_html/parser.rb#125 def build_tag_node(tokens); end - # source://better_html//lib/better_html/parser.rb#193 + # source://better_html//lib/better_html/parser.rb#197 def build_text_node(tokens); end - # source://better_html//lib/better_html/parser.rb#213 + # source://better_html//lib/better_html/parser.rb#217 def empty_location; end - # source://better_html//lib/better_html/parser.rb#217 + # source://better_html//lib/better_html/parser.rb#221 def shift_all(tokens, *types); end - # source://better_html//lib/better_html/parser.rb#255 + # source://better_html//lib/better_html/parser.rb#259 def shift_all_with_interpolation(tokens, *types); end - # source://better_html//lib/better_html/parser.rb#280 + # source://better_html//lib/better_html/parser.rb#284 def shift_between(tokens, start_type, end_type); end - # source://better_html//lib/better_html/parser.rb#288 + # source://better_html//lib/better_html/parser.rb#292 def shift_between_with_interpolation(tokens, start_type, end_type); end - # source://better_html//lib/better_html/parser.rb#229 + # source://better_html//lib/better_html/parser.rb#233 def shift_single(tokens, *types); end - # source://better_html//lib/better_html/parser.rb#233 + # source://better_html//lib/better_html/parser.rb#237 def shift_until(tokens, *types); end - # source://better_html//lib/better_html/parser.rb#268 + # source://better_html//lib/better_html/parser.rb#272 def shift_until_with_interpolation(tokens, *types); end - # source://better_html//lib/better_html/parser.rb#296 + # source://better_html//lib/better_html/parser.rb#300 def wrap_token(object); end - # source://better_html//lib/better_html/parser.rb#313 + # source://better_html//lib/better_html/parser.rb#322 def wrap_tokens(enumerable); end end @@ -229,7 +415,7 @@ class BetterHtml::Parser::Error < ::BetterHtml::HtmlError # Returns the value of attribute location. # - # source://better_html//lib/better_html/parser.rb#17 + # source://better_html//lib/better_html/parser.rb#18 def loc; end # Returns the value of attribute location. @@ -264,6 +450,9 @@ class BetterHtml::ParserError < ::RuntimeError def position; end end +# source://better_html//lib/better_html/railtie.rb#6 +class BetterHtml::Railtie < ::Rails::Railtie; end + # source://better_html//lib/better_html/tokenizer/token.rb#4 module BetterHtml::Tokenizer; end @@ -449,16 +638,16 @@ class BetterHtml::Tokenizer::Location < ::Parser::Source::Range # source://better_html//lib/better_html/tokenizer/location.rb#54 def resize(new_size); end - # source://parser/3.1.2.1/lib/parser/source/range.rb#92 + # source://better_html//lib/better_html/tokenizer/location.rb#36 def start_column; end - # source://parser/3.1.2.1/lib/parser/source/range.rb#83 + # source://better_html//lib/better_html/tokenizer/location.rb#34 def start_line; end - # source://parser/3.1.2.1/lib/parser/source/range.rb#106 + # source://better_html//lib/better_html/tokenizer/location.rb#37 def stop_column; end - # source://parser/3.1.2.1/lib/parser/source/range.rb#99 + # source://better_html//lib/better_html/tokenizer/location.rb#35 def stop_line; end # source://better_html//lib/better_html/tokenizer/location.rb#46 diff --git a/sorbet/rbi/gems/bigdecimal@4.0.1.rbi b/sorbet/rbi/gems/bigdecimal@4.0.1.rbi new file mode 100644 index 0000000..4486974 --- /dev/null +++ b/sorbet/rbi/gems/bigdecimal@4.0.1.rbi @@ -0,0 +1,411 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `bigdecimal` gem. +# Please instead update this file by running `bin/tapioca gem bigdecimal`. + + +# source://bigdecimal//lib/bigdecimal.rb#13 +class BigDecimal < ::Numeric + # source://bigdecimal//lib/bigdecimal.rb#10 + def %(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def *(_arg0); end + + # call-seq: + # self ** other -> bigdecimal + # + # Returns the \BigDecimal value of +self+ raised to power +other+: + # + # b = BigDecimal('3.14') + # b ** 2 # => 0.98596e1 + # b ** 2.0 # => 0.98596e1 + # b ** Rational(2, 1) # => 0.98596e1 + # + # Related: BigDecimal#power. + # + # source://bigdecimal//lib/bigdecimal.rb#77 + def **(y); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def +(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def +@; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def -(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def -@; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def /(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def <(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def <=(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def <=>(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def ==(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def ===(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def >(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def >=(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def _decimal_shift(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def _dump(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def abs; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def add(_arg0, _arg1); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def ceil(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def clone; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def coerce(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def div(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def divmod(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def dup; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def eql?(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def exponent; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def finite?; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def fix; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def floor(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def frac; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def hash; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def infinite?; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def inspect; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def modulo(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def mult(_arg0, _arg1); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def n_significant_digits; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def nan?; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def nonzero?; end + + # call-seq: + # power(n) + # power(n, prec) + # + # Returns the value raised to the power of n. + # + # Also available as the operator **. + # + # source://bigdecimal//lib/bigdecimal.rb#97 + def power(y, prec = T.unsafe(nil)); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def precision; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def precision_scale; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def quo(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def remainder(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def round(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def scale; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def sign; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def split; end + + # Returns the square root of the value. + # + # Result has at least prec significant digits. + # + # @raise [FloatDomainError] + # + # source://bigdecimal//lib/bigdecimal.rb#212 + def sqrt(prec); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def sub(_arg0, _arg1); end + + # call-seq: + # a.to_d -> bigdecimal + # + # Returns self. + # + # require 'bigdecimal/util' + # + # d = BigDecimal("3.14") + # d.to_d # => 0.314e1 + # + # source://bigdecimal//lib/bigdecimal/util.rb#110 + def to_d; end + + # call-seq: + # a.to_digits -> string + # + # Converts a BigDecimal to a String of the form "nnnnnn.mmm". + # This method is deprecated; use BigDecimal#to_s("F") instead. + # + # require 'bigdecimal/util' + # + # d = BigDecimal("3.14") + # d.to_digits # => "3.14" + # + # source://bigdecimal//lib/bigdecimal/util.rb#90 + def to_digits; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def to_f; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def to_i; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def to_int; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def to_r; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def to_s(format = T.unsafe(nil)); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def truncate(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def zero?; end + + class << self + # source://bigdecimal//lib/bigdecimal.rb#10 + def _load(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def double_fig; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def interpret_loosely(_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def limit(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def mode(*_arg0); end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def save_exception_mode; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def save_limit; end + + # source://bigdecimal//lib/bigdecimal.rb#10 + def save_rounding_mode; end + end +end + +# source://bigdecimal//lib/bigdecimal.rb#14 +module BigDecimal::Internal + class << self + # Coerce x to BigDecimal with the specified precision. + # TODO: some methods (example: BigMath.exp) require more precision than specified to coerce. + # + # @raise [ArgumentError] + # + # source://bigdecimal//lib/bigdecimal.rb#18 + def coerce_to_bigdecimal(x, prec, method_name); end + + # source://bigdecimal//lib/bigdecimal.rb#30 + def coerce_validate_prec(prec, method_name, accept_zero: T.unsafe(nil)); end + + # source://bigdecimal//lib/bigdecimal.rb#50 + def infinity_computation_result; end + + # source://bigdecimal//lib/bigdecimal.rb#57 + def nan_computation_result; end + end +end + +BigDecimal::VERSION = T.let(T.unsafe(nil), String) + +# Core BigMath methods for BigDecimal (log, exp) are defined here. +# Other methods (sin, cos, atan) are defined in 'bigdecimal/math.rb'. +# +# source://bigdecimal//lib/bigdecimal.rb#240 +module BigMath + private + + # source://bigdecimal//lib/bigdecimal.rb#310 + def _exp_taylor(x, prec); end + + # call-seq: + # BigMath.exp(decimal, numeric) -> BigDecimal + # + # Computes the value of e (the base of natural logarithms) raised to the + # power of +decimal+, to the specified number of digits of precision. + # + # If +decimal+ is infinity, returns Infinity. + # + # If +decimal+ is NaN, returns NaN. + # + # source://bigdecimal//lib/bigdecimal.rb#332 + def exp(x, prec); end + + # call-seq: + # BigMath.log(decimal, numeric) -> BigDecimal + # + # Computes the natural logarithm of +decimal+ to the specified number of + # digits of precision, +numeric+. + # + # If +decimal+ is zero or negative, raises Math::DomainError. + # + # If +decimal+ is positive infinity, returns Infinity. + # + # If +decimal+ is NaN, returns NaN. + # + # source://bigdecimal//lib/bigdecimal.rb#255 + def log(x, prec); end + + class << self + # call-seq: + # BigMath.exp(decimal, numeric) -> BigDecimal + # + # Computes the value of e (the base of natural logarithms) raised to the + # power of +decimal+, to the specified number of digits of precision. + # + # If +decimal+ is infinity, returns Infinity. + # + # If +decimal+ is NaN, returns NaN. + # + # source://bigdecimal//lib/bigdecimal.rb#332 + def exp(x, prec); end + + # call-seq: + # BigMath.log(decimal, numeric) -> BigDecimal + # + # Computes the natural logarithm of +decimal+ to the specified number of + # digits of precision, +numeric+. + # + # If +decimal+ is zero or negative, raises Math::DomainError. + # + # If +decimal+ is positive infinity, returns Infinity. + # + # If +decimal+ is NaN, returns NaN. + # + # @raise [Math::DomainError] + # + # source://bigdecimal//lib/bigdecimal.rb#255 + def log(x, prec); end + + private + + # source://bigdecimal//lib/bigdecimal.rb#310 + def _exp_taylor(x, prec); end + end +end + +# source://bigdecimal//lib/bigdecimal/util.rb#141 +class Complex < ::Numeric + # call-seq: + # cmp.to_d -> bigdecimal + # cmp.to_d(precision) -> bigdecimal + # + # Returns the value as a BigDecimal. + # If the imaginary part is not +0+, an error is raised + # + # The +precision+ parameter is used to determine the number of + # significant digits for the result. When +precision+ is set to +0+, + # the number of digits to represent the float being converted is determined + # automatically. + # The default +precision+ is +0+. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # Complex(0.1234567, 0).to_d(4) # => 0.1235e0 + # Complex(Rational(22, 7), 0).to_d(3) # => 0.314e1 + # Complex(1, 1).to_d # raises ArgumentError + # + # See also Kernel.BigDecimal. + # + # source://bigdecimal//lib/bigdecimal/util.rb#164 + def to_d(precision = T.unsafe(nil)); end +end + +# source://bigdecimal//lib/bigdecimal/util.rb#116 +class Rational < ::Numeric + # call-seq: + # rat.to_d(precision) -> bigdecimal + # + # Returns the value as a BigDecimal. + # + # The +precision+ parameter is used to determine the number of + # significant digits for the result. When +precision+ is set to +0+, + # the number of digits to represent the float being converted is determined + # automatically. + # The default +precision+ is +0+. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # Rational(22, 7).to_d(3) # => 0.314e1 + # + # See also Kernel.BigDecimal. + # + # source://bigdecimal//lib/bigdecimal/util.rb#135 + def to_d(precision = T.unsafe(nil)); end +end diff --git a/sorbet/rbi/gems/builder@3.2.4.rbi b/sorbet/rbi/gems/builder@3.3.0.rbi similarity index 99% rename from sorbet/rbi/gems/builder@3.2.4.rbi rename to sorbet/rbi/gems/builder@3.3.0.rbi index 344a340..177ba9a 100644 --- a/sorbet/rbi/gems/builder@3.2.4.rbi +++ b/sorbet/rbi/gems/builder@3.3.0.rbi @@ -4,5 +4,6 @@ # This is an autogenerated file for types exported from the `builder` gem. # Please instead update this file by running `bin/tapioca gem builder`. + # THIS IS AN EMPTY RBI FILE. # see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/coderay@1.1.3.rbi b/sorbet/rbi/gems/coderay@1.1.3.rbi new file mode 100644 index 0000000..12c7652 --- /dev/null +++ b/sorbet/rbi/gems/coderay@1.1.3.rbi @@ -0,0 +1,3448 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `coderay` gem. +# Please instead update this file by running `bin/tapioca gem coderay`. + + +# = CodeRay Library +# +# CodeRay is a Ruby library for syntax highlighting. +# +# I try to make CodeRay easy to use and intuitive, but at the same time fully +# featured, complete, fast and efficient. +# +# See README. +# +# It consists mainly of +# * the main engine: CodeRay (Scanners::Scanner, Tokens, Encoders::Encoder) +# * the plugin system: PluginHost, Plugin +# * the scanners in CodeRay::Scanners +# * the encoders in CodeRay::Encoders +# * the styles in CodeRay::Styles +# +# Here's a fancy graphic to light up this gray docu: +# +# http://cycnus.de/raindark/coderay/scheme.png +# +# == Documentation +# +# See CodeRay, Encoders, Scanners, Tokens. +# +# == Usage +# +# Remember you need RubyGems to use CodeRay, unless you have it in your load +# path. Run Ruby with -rubygems option if required. +# +# === Highlight Ruby code in a string as html +# +# require 'coderay' +# print CodeRay.scan('puts "Hello, world!"', :ruby).html +# +# # prints something like this: +# puts "Hello, world!" +# +# +# === Highlight C code from a file in a html div +# +# require 'coderay' +# print CodeRay.scan(File.read('ruby.h'), :c).div +# print CodeRay.scan_file('ruby.h').html.div +# +# You can include this div in your page. The used CSS styles can be printed with +# +# % coderay_stylesheet +# +# === Highlight without typing too much +# +# If you are one of the hasty (or lazy, or extremely curious) people, just run this file: +# +# % ruby -rubygems /path/to/coderay/coderay.rb > example.html +# +# and look at the file it created in your browser. +# +# = CodeRay Module +# +# The CodeRay module provides convenience methods for the engine. +# +# * The +lang+ and +format+ arguments select Scanner and Encoder to use. These are +# simply lower-case symbols, like :python or :html. +# * All methods take an optional hash as last parameter, +options+, that is send to +# the Encoder / Scanner. +# * Input and language are always sorted in this order: +code+, +lang+. +# (This is in alphabetical order, if you need a mnemonic ;) +# +# You should be able to highlight everything you want just using these methods; +# so there is no need to dive into CodeRay's deep class hierarchy. +# +# The examples in the demo directory demonstrate common cases using this interface. +# +# = Basic Access Ways +# +# Read this to get a general view what CodeRay provides. +# +# == Scanning +# +# Scanning means analysing an input string, splitting it up into Tokens. +# Each Token knows about what type it is: string, comment, class name, etc. +# +# Each +lang+ (language) has its own Scanner; for example, :ruby code is +# handled by CodeRay::Scanners::Ruby. +# +# CodeRay.scan:: Scan a string in a given language into Tokens. +# This is the most common method to use. +# CodeRay.scan_file:: Scan a file and guess the language using FileType. +# +# The Tokens object you get from these methods can encode itself; see Tokens. +# +# == Encoding +# +# Encoding means compiling Tokens into an output. This can be colored HTML or +# LaTeX, a textual statistic or just the number of non-whitespace tokens. +# +# Each Encoder provides output in a specific +format+, so you select Encoders via +# formats like :html or :statistic. +# +# CodeRay.encode:: Scan and encode a string in a given language. +# CodeRay.encode_tokens:: Encode the given tokens. +# CodeRay.encode_file:: Scan a file, guess the language using FileType and encode it. +# +# == All-in-One Encoding +# +# CodeRay.encode:: Highlight a string with a given input and output format. +# +# == Instanciating +# +# You can use an Encoder instance to highlight multiple inputs. This way, the setup +# for this Encoder must only be done once. +# +# CodeRay.encoder:: Create an Encoder instance with format and options. +# CodeRay.scanner:: Create an Scanner instance for lang, with '' as default code. +# +# To make use of CodeRay.scanner, use CodeRay::Scanner::code=. +# +# The scanning methods provide more flexibility; we recommend to use these. +# +# == Reusing Scanners and Encoders +# +# If you want to re-use scanners and encoders (because that is faster), see +# CodeRay::Duo for the most convenient (and recommended) interface. +# +# source://coderay//lib/coderay.rb#126 +module CodeRay + class << self + # Assuming the path is a subpath of lib/coderay/ + # + # source://coderay//lib/coderay.rb#133 + def coderay_path(*path); end + + # Encode a string. + # + # This scans +code+ with the the Scanner for +lang+ and then + # encodes it with the Encoder for +format+. + # +options+ will be passed to the Encoder. + # + # See CodeRay::Encoder.encode. + # + # source://coderay//lib/coderay.rb#196 + def encode(code, lang, format, options = T.unsafe(nil)); end + + # Encodes +filename+ (a path to a code file) with the Scanner for +lang+. + # + # See CodeRay.scan_file. + # Notice that the second argument is the output +format+, not the input language. + # + # Example: + # require 'coderay' + # page = CodeRay.encode_file 'some_c_code.c', :html + # + # source://coderay//lib/coderay.rb#221 + def encode_file(filename, format, options = T.unsafe(nil)); end + + # Encode pre-scanned Tokens. + # Use this together with CodeRay.scan: + # + # require 'coderay' + # + # # Highlight a short Ruby code example in a HTML span + # tokens = CodeRay.scan '1 + 2', :ruby + # puts CodeRay.encode_tokens(tokens, :span) + # + # source://coderay//lib/coderay.rb#209 + def encode_tokens(tokens, format, options = T.unsafe(nil)); end + + # Finds the Encoder class for +format+ and creates an instance, passing + # +options+ to it. + # + # Example: + # require 'coderay' + # + # stats = CodeRay.encoder(:statistic) + # stats.encode("puts 17 + 4\n", :ruby) + # + # puts '%d out of %d tokens have the kind :integer.' % [ + # stats.type_stats[:integer].count, + # stats.real_token_count + # ] + # #-> 2 out of 4 tokens have the kind :integer. + # + # source://coderay//lib/coderay.rb#260 + def encoder(format, options = T.unsafe(nil)); end + + # Extract the options for the scanner from the +options+ hash. + # + # Returns an empty Hash if :scanner_options is not set. + # + # This is used if a method like CodeRay.encode has to provide options + # for Encoder _and_ scanner. + # + # source://coderay//lib/coderay.rb#278 + def get_scanner_options(options); end + + # Highlight a string into a HTML
    . + # + # CSS styles use classes, so you have to include a stylesheet + # in your output. + # + # See encode. + # + # source://coderay//lib/coderay.rb#232 + def highlight(code, lang, options = T.unsafe(nil), format = T.unsafe(nil)); end + + # Highlight a file into a HTML
    . + # + # CSS styles use classes, so you have to include a stylesheet + # in your output. + # + # See encode. + # + # source://coderay//lib/coderay.rb#242 + def highlight_file(filename, options = T.unsafe(nil), format = T.unsafe(nil)); end + + # Scans the given +code+ (a String) with the Scanner for +lang+. + # + # This is a simple way to use CodeRay. Example: + # require 'coderay' + # page = CodeRay.scan("puts 'Hello, world!'", :ruby).html + # + # See also demo/demo_simple. + # + # source://coderay//lib/coderay.rb#168 + def scan(code, lang, options = T.unsafe(nil), &block); end + + # Scans +filename+ (a path to a code file) with the Scanner for +lang+. + # + # If +lang+ is :auto or omitted, the CodeRay::FileType module is used to + # determine it. If it cannot find out what type it is, it uses + # CodeRay::Scanners::Text. + # + # Calls CodeRay.scan. + # + # Example: + # require 'coderay' + # page = CodeRay.scan_file('some_c_code.c').html + # + # source://coderay//lib/coderay.rb#183 + def scan_file(filename, lang = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Finds the Scanner class for +lang+ and creates an instance, passing + # +options+ to it. + # + # See Scanner.new. + # + # source://coderay//lib/coderay.rb#268 + def scanner(lang, options = T.unsafe(nil), &block); end + end +end + +# source://coderay//lib/coderay.rb#130 +CodeRay::CODERAY_PATH = T.let(T.unsafe(nil), String) + +# = Duo +# +# A Duo is a convenient way to use CodeRay. You just create a Duo, +# giving it a lang (language of the input code) and a format (desired +# output format), and call Duo#highlight with the code. +# +# Duo makes it easy to re-use both scanner and encoder for a repetitive +# task. It also provides a very easy interface syntax: +# +# require 'coderay' +# CodeRay::Duo[:python, :div].highlight 'import this' +# +# Until you want to do uncommon things with CodeRay, I recommend to use +# this method, since it takes care of everything. +# +# source://coderay//lib/coderay/duo.rb#17 +class CodeRay::Duo + # Create a new Duo, holding a lang and a format to highlight code. + # + # simple: + # CodeRay::Duo[:ruby, :html].highlight 'bla 42' + # + # with options: + # CodeRay::Duo[:ruby, :html, :hint => :debug].highlight '????::??' + # + # alternative syntax without options: + # CodeRay::Duo[:ruby => :statistic].encode 'class << self; end' + # + # alternative syntax with options: + # CodeRay::Duo[{ :ruby => :statistic }, :do => :something].encode 'abc' + # + # The options are forwarded to scanner and encoder + # (see CodeRay.get_scanner_options). + # + # @return [Duo] a new instance of Duo + # + # source://coderay//lib/coderay/duo.rb#37 + def initialize(lang = T.unsafe(nil), format = T.unsafe(nil), options = T.unsafe(nil)); end + + # Tokenize and highlight the code using +scanner+ and +encoder+. + # Allows to use Duo like a proc object: + # + # CodeRay::Duo[:python => :yaml].call(code) + # + # or, in Ruby 1.9 and later: + # + # CodeRay::Duo[:python => :yaml].(code) + # + # source://coderay//lib/coderay/duo.rb#77 + def call(code, options = T.unsafe(nil)); end + + # Tokenize and highlight the code using +scanner+ and +encoder+. + # + # source://coderay//lib/coderay/duo.rb#64 + def encode(code, options = T.unsafe(nil)); end + + # The encoder of the duo. Only created once. + # + # source://coderay//lib/coderay/duo.rb#59 + def encoder; end + + # Returns the value of attribute format. + # + # source://coderay//lib/coderay/duo.rb#19 + def format; end + + # Sets the attribute format + # + # @param value the value to set the attribute format to. + # + # source://coderay//lib/coderay/duo.rb#19 + def format=(_arg0); end + + # Tokenize and highlight the code using +scanner+ and +encoder+. + # + # source://coderay//lib/coderay/duo.rb#68 + def highlight(code, options = T.unsafe(nil)); end + + # Returns the value of attribute lang. + # + # source://coderay//lib/coderay/duo.rb#19 + def lang; end + + # Sets the attribute lang + # + # @param value the value to set the attribute lang to. + # + # source://coderay//lib/coderay/duo.rb#19 + def lang=(_arg0); end + + # Returns the value of attribute options. + # + # source://coderay//lib/coderay/duo.rb#19 + def options; end + + # Sets the attribute options + # + # @param value the value to set the attribute options to. + # + # source://coderay//lib/coderay/duo.rb#19 + def options=(_arg0); end + + # The scanner of the duo. Only created once. + # + # source://coderay//lib/coderay/duo.rb#54 + def scanner; end + + class << self + # To allow calls like Duo[:ruby, :html].highlight. + # + # source://coderay//lib/coderay/duo.rb#50 + def [](*_arg0); end + end +end + +# This module holds the Encoder class and its subclasses. +# For example, the HTML encoder is named CodeRay::Encoders::HTML +# can be found in coderay/encoders/html. +# +# Encoders also provides methods and constants for the register +# mechanism and the [] method that returns the Encoder class +# belonging to the given format. +# +# source://coderay//lib/coderay/encoders.rb#10 +module CodeRay::Encoders + extend ::CodeRay::PluginHost +end + +# A simple Filter that removes all tokens of the :comment kind. +# +# Alias: +remove_comments+ +# +# Usage: +# CodeRay.scan('print # foo', :ruby).comment_filter.text +# #-> "print " +# +# See also: TokenKindFilter, LinesOfCode +# +# source://coderay//lib/coderay/encoders/comment_filter.rb#15 +class CodeRay::Encoders::CommentFilter < ::CodeRay::Encoders::TokenKindFilter; end + +# source://coderay//lib/coderay/encoders/comment_filter.rb#19 +CodeRay::Encoders::CommentFilter::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Returns the number of tokens. +# +# Text and block tokens are counted. +# +# source://coderay//lib/coderay/encoders/count.rb#7 +class CodeRay::Encoders::Count < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/count.rb#29 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/count.rb#33 + def begin_line(kind); end + + # source://coderay//lib/coderay/encoders/count.rb#32 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/count.rb#34 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/count.rb#25 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/count.rb#19 + def finish(options); end + + # source://coderay//lib/coderay/encoders/count.rb#13 + def setup(options); end +end + +# = Debug Encoder +# +# Fast encoder producing simple debug output. +# +# It is readable and diff-able and is used for testing. +# +# You cannot fully restore the tokens information from the +# output, because consecutive :space tokens are merged. +# +# See also: Scanners::Debug +# +# source://coderay//lib/coderay/encoders/debug.rb#14 +class CodeRay::Encoders::Debug < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/debug.rb#30 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/debug.rb#38 + def begin_line(kind); end + + # source://coderay//lib/coderay/encoders/debug.rb#34 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/debug.rb#42 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/debug.rb#20 + def text_token(text, kind); end +end + +# source://coderay//lib/coderay/encoders/debug.rb#18 +CodeRay::Encoders::Debug::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# = Debug Lint Encoder +# +# Debug encoder with additional checks for: +# +# - empty tokens +# - incorrect nesting +# +# It will raise an InvalidTokenStream exception when any of the above occurs. +# +# See also: Encoders::Debug +# +# source://coderay//lib/coderay/encoders/debug_lint.rb#16 +class CodeRay::Encoders::DebugLint < ::CodeRay::Encoders::Debug + # source://coderay//lib/coderay/encoders/debug_lint.rb#26 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/debug_lint.rb#37 + def begin_line(kind); end + + # @raise [Lint::IncorrectTokenGroupNesting] + # + # source://coderay//lib/coderay/encoders/debug_lint.rb#31 + def end_group(kind); end + + # @raise [Lint::IncorrectTokenGroupNesting] + # + # source://coderay//lib/coderay/encoders/debug_lint.rb#42 + def end_line(kind); end + + # @raise [Lint::EmptyToken] + # + # source://coderay//lib/coderay/encoders/debug_lint.rb#20 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/debug_lint.rb#55 + def finish(options); end + + # source://coderay//lib/coderay/encoders/debug_lint.rb#50 + def setup(options); end +end + +# Wraps HTML output into a DIV element, using inline styles by default. +# +# See Encoders::HTML for available options. +# +# source://coderay//lib/coderay/encoders/div.rb#9 +class CodeRay::Encoders::Div < ::CodeRay::Encoders::HTML; end + +# source://coderay//lib/coderay/encoders/div.rb#15 +CodeRay::Encoders::Div::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/div.rb#11 +CodeRay::Encoders::Div::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# = Encoder +# +# The Encoder base class. Together with Scanner and +# Tokens, it forms the highlighting triad. +# +# Encoder instances take a Tokens object and do something with it. +# +# The most common Encoder is surely the HTML encoder +# (CodeRay::Encoders::HTML). It highlights the code in a colorful +# html page. +# If you want the highlighted code in a div or a span instead, +# use its subclasses Div and Span. +# +# source://coderay//lib/coderay/encoders/encoder.rb#16 +class CodeRay::Encoders::Encoder + extend ::CodeRay::Plugin + + # Creates a new Encoder. + # +options+ is saved and used for all encode operations, as long + # as you don't overwrite it there by passing additional options. + # + # Encoder objects provide three encode methods: + # - encode simply takes a +code+ string and a +lang+ + # - encode_tokens expects a +tokens+ object instead + # + # Each method has an optional +options+ parameter. These are + # added to the options you passed at creation. + # + # @return [Encoder] a new instance of Encoder + # + # source://coderay//lib/coderay/encoders/encoder.rb#55 + def initialize(options = T.unsafe(nil)); end + + # source://coderay//lib/coderay/encoders/encoder.rb#87 + def <<(token); end + + # Starts a token group with the given +kind+. + # + # source://coderay//lib/coderay/encoders/encoder.rb#123 + def begin_group(kind); end + + # Starts a new line token group with the given +kind+. + # + # source://coderay//lib/coderay/encoders/encoder.rb#131 + def begin_line(kind); end + + # Encode the given +code+ using the Scanner for +lang+. + # + # source://coderay//lib/coderay/encoders/encoder.rb#70 + def encode(code, lang, options = T.unsafe(nil)); end + + # Encode a Tokens object. + # + # source://coderay//lib/coderay/encoders/encoder.rb#61 + def encode_tokens(tokens, options = T.unsafe(nil)); end + + # Ends a token group with the given +kind+. + # + # source://coderay//lib/coderay/encoders/encoder.rb#127 + def end_group(kind); end + + # Ends a new line token group with the given +kind+. + # + # source://coderay//lib/coderay/encoders/encoder.rb#135 + def end_line(kind); end + + # The default file extension for this encoder. + # + # source://coderay//lib/coderay/encoders/encoder.rb#83 + def file_extension; end + + # Encode the given +code+ using the Scanner for +lang+. + # You can use highlight instead of encode, if that seems + # more clear to you. + # + # source://coderay//lib/coderay/encoders/encoder.rb#80 + def highlight(code, lang, options = T.unsafe(nil)); end + + # The options you gave the Encoder at creating. + # + # source://coderay//lib/coderay/encoders/encoder.rb#43 + def options; end + + # The options you gave the Encoder at creating. + # + # source://coderay//lib/coderay/encoders/encoder.rb#43 + def options=(_arg0); end + + # The options you gave the Encoder at creating. + # + # source://coderay//lib/coderay/encoders/encoder.rb#43 + def scanner; end + + # The options you gave the Encoder at creating. + # + # source://coderay//lib/coderay/encoders/encoder.rb#43 + def scanner=(_arg0); end + + # Called for each text token ([text, kind]), where text is a String. + # + # source://coderay//lib/coderay/encoders/encoder.rb#118 + def text_token(text, kind); end + + # Called with +content+ and +kind+ of the currently scanned token. + # For simple scanners, it's enougth to implement this method. + # + # By default, it calls text_token, begin_group, end_group, begin_line, + # or end_line, depending on the +content+. + # + # source://coderay//lib/coderay/encoders/encoder.rb#100 + def token(content, kind); end + + # Do the encoding. + # + # The already created +tokens+ object must be used; it must be a + # Tokens object. + # + # source://coderay//lib/coderay/encoders/encoder.rb#184 + def tokens(tokens, options = T.unsafe(nil)); end + + protected + + # Do the encoding. + # + # The already created +tokens+ object must be used; it must be a + # Tokens object. + # + # source://coderay//lib/coderay/encoders/encoder.rb#168 + def compile(tokens, options = T.unsafe(nil)); end + + # Called with merged options after encoding starts. + # The return value is the result of encoding, typically @out. + # + # source://coderay//lib/coderay/encoders/encoder.rb#160 + def finish(options); end + + # source://coderay//lib/coderay/encoders/encoder.rb#148 + def get_output(options); end + + # Append data.to_s to the output. Returns the argument. + # + # source://coderay//lib/coderay/encoders/encoder.rb#153 + def output(data); end + + # Called with merged options before encoding starts. + # Sets @out to an empty string. + # + # See the HTML Encoder for an example of option caching. + # + # source://coderay//lib/coderay/encoders/encoder.rb#144 + def setup(options); end + + class << self + # If FILE_EXTENSION isn't defined, this method returns the + # downcase class name instead. + # + # source://coderay//lib/coderay/encoders/encoder.rb#24 + def const_missing(sym); end + + # The default file extension for output file of this encoder class. + # + # source://coderay//lib/coderay/encoders/encoder.rb#33 + def file_extension; end + end +end + +# Subclasses are to store their default options in this constant. +# +# source://coderay//lib/coderay/encoders/encoder.rb#40 +CodeRay::Encoders::Encoder::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/helpers/plugin.rb#41 +CodeRay::Encoders::Encoder::PLUGIN_HOST = CodeRay::Encoders + +# A Filter encoder has another Tokens instance as output. +# It can be subclass to select, remove, or modify tokens in the stream. +# +# Subclasses of Filter are called "Filters" and can be chained. +# +# == Options +# +# === :tokens +# +# The Tokens object which will receive the output. +# +# Default: Tokens.new +# +# See also: TokenKindFilter +# +# source://coderay//lib/coderay/encoders/filter.rb#18 +class CodeRay::Encoders::Filter < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/filter.rb#39 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/filter.rb#43 + def begin_line(kind); end + + # source://coderay//lib/coderay/encoders/filter.rb#47 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/filter.rb#51 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/filter.rb#35 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/filter.rb#29 + def finish(options); end + + # source://coderay//lib/coderay/encoders/filter.rb#23 + def setup(options); end +end + +# = HTML Encoder +# +# This is CodeRay's most important highlighter: +# It provides save, fast XHTML generation and CSS support. +# +# == Usage +# +# require 'coderay' +# puts CodeRay.scan('Some /code/', :ruby).html #-> a HTML page +# puts CodeRay.scan('Some /code/', :ruby).html(:wrap => :span) +# #-> Some /code/ +# puts CodeRay.scan('Some /code/', :ruby).span #-> the same +# +# puts CodeRay.scan('Some code', :ruby).html( +# :wrap => nil, +# :line_numbers => :inline, +# :css => :style +# ) +# +# == Options +# +# === :tab_width +# Convert \t characters to +n+ spaces (a number or false.) +# false will keep tab characters untouched. +# +# Default: 8 +# +# === :css +# How to include the styles; can be :class or :style. +# +# Default: :class +# +# === :wrap +# Wrap in :page, :div, :span or nil. +# +# You can also use Encoders::Div and Encoders::Span. +# +# Default: nil +# +# === :title +# +# The title of the HTML page (works only when :wrap is set to :page.) +# +# Default: 'CodeRay output' +# +# === :break_lines +# +# Split multiline blocks at line breaks. +# Forced to true if :line_numbers option is set to :inline. +# +# Default: false +# +# === :line_numbers +# Include line numbers in :table, :inline, or nil (no line numbers) +# +# Default: nil +# +# === :line_number_anchors +# Adds anchors and links to the line numbers. Can be false (off), true (on), +# or a prefix string that will be prepended to the anchor name. +# +# The prefix must consist only of letters, digits, and underscores. +# +# Default: true, default prefix name: "line" +# +# === :line_number_start +# Where to start with line number counting. +# +# Default: 1 +# +# === :bold_every +# Make every +n+-th number appear bold. +# +# Default: 10 +# +# === :highlight_lines +# +# Highlights certain line numbers. +# Can be any Enumerable, typically just an Array or Range, of numbers. +# +# Bolding is deactivated when :highlight_lines is set. It only makes sense +# in combination with :line_numbers. +# +# Default: nil +# +# === :hint +# Include some information into the output using the title attribute. +# Can be :info (show token kind on mouse-over), :info_long (with full path) +# or :debug (via inspect). +# +# Default: false +# +# source://coderay//lib/coderay/encoders/html.rb#97 +class CodeRay::Encoders::HTML < ::CodeRay::Encoders::Encoder + # token groups, eg. strings + # + # source://coderay//lib/coderay/encoders/html.rb#235 + def begin_group(kind); end + + # whole lines to be highlighted, eg. a deleted line in a diff + # + # source://coderay//lib/coderay/encoders/html.rb#247 + def begin_line(kind); end + + # Returns the value of attribute css. + # + # source://coderay//lib/coderay/encoders/html.rb#126 + def css; end + + # source://coderay//lib/coderay/encoders/html.rb#241 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/html.rb#261 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/html.rb#221 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/html.rb#316 + def break_lines(text, style); end + + # source://coderay//lib/coderay/encoders/html.rb#310 + def check_group_nesting(name, kind); end + + # source://coderay//lib/coderay/encoders/html.rb#268 + def check_options!(options); end + + # source://coderay//lib/coderay/encoders/html.rb#324 + def close_span; end + + # source://coderay//lib/coderay/encoders/html.rb#280 + def css_class_for_kinds(kinds); end + + # source://coderay//lib/coderay/encoders/html.rb#195 + def finish(options); end + + # source://coderay//lib/coderay/encoders/html.rb#289 + def make_span_for_kinds(method, hint); end + + # source://coderay//lib/coderay/encoders/html.rb#172 + def setup(options); end + + # source://coderay//lib/coderay/encoders/html.rb#284 + def style_for_kinds(kinds); end + + class << self + # source://coderay//lib/coderay/encoders/html.rb#130 + def make_html_escape_hash; end + + # Generate a hint about the given +kinds+ in a +hint+ style. + # + # +hint+ may be :info, :info_long or :debug. + # + # source://coderay//lib/coderay/encoders/html.rb#157 + def token_path_to_hint(hint, kinds); end + end +end + +# source://coderay//lib/coderay/encoders/html/css.rb#5 +class CodeRay::Encoders::HTML::CSS + # @return [CSS] a new instance of CSS + # + # source://coderay//lib/coderay/encoders/html/css.rb#13 + def initialize(style = T.unsafe(nil)); end + + # source://coderay//lib/coderay/encoders/html/css.rb#23 + def get_style_for_css_classes(css_classes); end + + # Returns the value of attribute stylesheet. + # + # source://coderay//lib/coderay/encoders/html/css.rb#7 + def stylesheet; end + + private + + # source://coderay//lib/coderay/encoders/html/css.rb#49 + def parse(stylesheet); end + + class << self + # source://coderay//lib/coderay/encoders/html/css.rb#9 + def load_stylesheet(style = T.unsafe(nil)); end + end +end + +# source://coderay//lib/coderay/encoders/html/css.rb#36 +CodeRay::Encoders::HTML::CSS::CSS_CLASS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/encoders/html.rb#103 +CodeRay::Encoders::HTML::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/html.rb#101 +CodeRay::Encoders::HTML::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# source://coderay//lib/coderay/encoders/html.rb#143 +CodeRay::Encoders::HTML::HTML_ESCAPE = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/html.rb#144 +CodeRay::Encoders::HTML::HTML_ESCAPE_PATTERN = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/encoders/html/numbering.rb#6 +module CodeRay::Encoders::HTML::Numbering + class << self + # source://coderay//lib/coderay/encoders/html/numbering.rb#8 + def number!(output, mode = T.unsafe(nil), options = T.unsafe(nil)); end + end +end + +# This module is included in the output String of the HTML Encoder. +# +# It provides methods like wrap, div, page etc. +# +# Remember to use #clone instead of #dup to keep the modules the object was +# extended with. +# +# TODO: Rewrite this without monkey patching. +# +# source://coderay//lib/coderay/encoders/html/output.rb#14 +module CodeRay::Encoders::HTML::Output + # source://coderay//lib/coderay/encoders/html/output.rb#57 + def apply_title!(title); end + + # Returns the value of attribute css. + # + # source://coderay//lib/coderay/encoders/html/output.rb#16 + def css; end + + # Sets the attribute css + # + # @param value the value to set the attribute css to. + # + # source://coderay//lib/coderay/encoders/html/output.rb#16 + def css=(_arg0); end + + # source://coderay//lib/coderay/encoders/html/output.rb#86 + def stylesheet(in_tag = T.unsafe(nil)); end + + # source://coderay//lib/coderay/encoders/html/output.rb#62 + def wrap!(element, *args); end + + # source://coderay//lib/coderay/encoders/html/output.rb#52 + def wrap_in!(template); end + + # source://coderay//lib/coderay/encoders/html/output.rb#47 + def wrapped_in; end + + # Sets the attribute wrapped_in + # + # @param value the value to set the attribute wrapped_in to. + # + # source://coderay//lib/coderay/encoders/html/output.rb#50 + def wrapped_in=(_arg0); end + + # @return [Boolean] + # + # source://coderay//lib/coderay/encoders/html/output.rb#43 + def wrapped_in?(element); end + + class << self + # Raises an exception if an object that doesn't respond to to_str is extended by Output, + # to prevent users from misuse. Use Module#remove_method to disable. + # + # source://coderay//lib/coderay/encoders/html/output.rb#22 + def extended(o); end + + # source://coderay//lib/coderay/encoders/html/output.rb#26 + def make_stylesheet(css, in_tag = T.unsafe(nil)); end + + # source://coderay//lib/coderay/encoders/html/output.rb#36 + def page_template_for_css(css); end + end +end + +# source://coderay//lib/coderay/encoders/html/output.rb#117 +CodeRay::Encoders::HTML::Output::DIV = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template) + +# source://coderay//lib/coderay/encoders/html/output.rb#130 +CodeRay::Encoders::HTML::Output::PAGE = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template) + +# source://coderay//lib/coderay/encoders/html/output.rb#115 +CodeRay::Encoders::HTML::Output::SPAN = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template) + +# source://coderay//lib/coderay/encoders/html/output.rb#123 +CodeRay::Encoders::HTML::Output::TABLE = T.let(T.unsafe(nil), CodeRay::Encoders::HTML::Output::Template) + +# -- don't include the templates in docu +# +# source://coderay//lib/coderay/encoders/html/output.rb#92 +class CodeRay::Encoders::HTML::Output::Template < ::String + # source://coderay//lib/coderay/encoders/html/output.rb#104 + def apply(target, replacement); end + + class << self + # source://coderay//lib/coderay/encoders/html/output.rb#94 + def wrap!(str, template, target); end + end +end + +# source://coderay//lib/coderay/encoders/html.rb#146 +CodeRay::Encoders::HTML::TOKEN_KIND_TO_INFO = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/html.rb#150 +CodeRay::Encoders::HTML::TRANSPARENT_TOKEN_KINDS = T.let(T.unsafe(nil), Set) + +# A simple JSON Encoder. +# +# Example: +# CodeRay.scan('puts "Hello world!"', :ruby).json +# yields +# [ +# {"type"=>"text", "text"=>"puts", "kind"=>"ident"}, +# {"type"=>"text", "text"=>" ", "kind"=>"space"}, +# {"type"=>"block", "action"=>"open", "kind"=>"string"}, +# {"type"=>"text", "text"=>"\"", "kind"=>"delimiter"}, +# {"type"=>"text", "text"=>"Hello world!", "kind"=>"content"}, +# {"type"=>"text", "text"=>"\"", "kind"=>"delimiter"}, +# {"type"=>"block", "action"=>"close", "kind"=>"string"}, +# ] +# +# source://coderay//lib/coderay/encoders/json.rb#18 +class CodeRay::Encoders::JSON < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/json.rb#64 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/json.rb#72 + def begin_line(kind); end + + # source://coderay//lib/coderay/encoders/json.rb#68 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/json.rb#76 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/json.rb#60 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/json.rb#49 + def append(data); end + + # source://coderay//lib/coderay/encoders/json.rb#45 + def finish(options); end + + # source://coderay//lib/coderay/encoders/json.rb#38 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/json.rb#35 +CodeRay::Encoders::JSON::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# Counts the LoC (Lines of Code). Returns an Integer >= 0. +# +# Alias: +loc+ +# +# Everything that is not comment, markup, doctype/shebang, or an empty line, +# is considered to be code. +# +# For example, +# * HTML files not containing JavaScript have 0 LoC +# * in a Java class without comments, LoC is the number of non-empty lines +# +# A Scanner class should define the token kinds that are not code in the +# KINDS_NOT_LOC constant, which defaults to [:comment, :doctype]. +# +# source://coderay//lib/coderay/encoders/lines_of_code.rb#17 +class CodeRay::Encoders::LinesOfCode < ::CodeRay::Encoders::TokenKindFilter + protected + + # source://coderay//lib/coderay/encoders/lines_of_code.rb#38 + def finish(options); end + + # source://coderay//lib/coderay/encoders/lines_of_code.rb#25 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/lines_of_code.rb#21 +CodeRay::Encoders::LinesOfCode::NON_EMPTY_LINE = T.let(T.unsafe(nil), Regexp) + +# = Lint Encoder +# +# Checks for: +# +# - empty tokens +# - incorrect nesting +# +# It will raise an InvalidTokenStream exception when any of the above occurs. +# +# See also: Encoders::DebugLint +# +# source://coderay//lib/coderay/encoders/lint.rb#14 +class CodeRay::Encoders::Lint < ::CodeRay::Encoders::Debug + # source://coderay//lib/coderay/encoders/lint.rb#28 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/lint.rb#37 + def begin_line(kind); end + + # @raise [IncorrectTokenGroupNesting] + # + # source://coderay//lib/coderay/encoders/lint.rb#32 + def end_group(kind); end + + # @raise [IncorrectTokenGroupNesting] + # + # source://coderay//lib/coderay/encoders/lint.rb#41 + def end_line(kind); end + + # @raise [EmptyToken] + # + # source://coderay//lib/coderay/encoders/lint.rb#23 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/lint.rb#52 + def finish(options); end + + # source://coderay//lib/coderay/encoders/lint.rb#48 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/lint.rb#19 +class CodeRay::Encoders::Lint::EmptyToken < ::CodeRay::Encoders::Lint::InvalidTokenStream; end + +# source://coderay//lib/coderay/encoders/lint.rb#21 +class CodeRay::Encoders::Lint::IncorrectTokenGroupNesting < ::CodeRay::Encoders::Lint::InvalidTokenStream; end + +# source://coderay//lib/coderay/encoders/lint.rb#18 +class CodeRay::Encoders::Lint::InvalidTokenStream < ::StandardError; end + +# source://coderay//lib/coderay/encoders/lint.rb#20 +class CodeRay::Encoders::Lint::UnknownTokenKind < ::CodeRay::Encoders::Lint::InvalidTokenStream; end + +# = Null Encoder +# +# Does nothing and returns an empty string. +# +# source://coderay//lib/coderay/encoders/null.rb#7 +class CodeRay::Encoders::Null < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/null.rb#11 + def text_token(text, kind); end +end + +# Wraps the output into a HTML page, using CSS classes and +# line numbers in the table format by default. +# +# See Encoders::HTML for available options. +# +# source://coderay//lib/coderay/encoders/page.rb#10 +class CodeRay::Encoders::Page < ::CodeRay::Encoders::HTML; end + +# source://coderay//lib/coderay/encoders/page.rb#16 +CodeRay::Encoders::Page::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/page.rb#12 +CodeRay::Encoders::Page::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# Wraps HTML output into a SPAN element, using inline styles by default. +# +# See Encoders::HTML for available options. +# +# source://coderay//lib/coderay/encoders/span.rb#9 +class CodeRay::Encoders::Span < ::CodeRay::Encoders::HTML; end + +# source://coderay//lib/coderay/encoders/span.rb#15 +CodeRay::Encoders::Span::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/span.rb#11 +CodeRay::Encoders::Span::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# Makes a statistic for the given tokens. +# +# Alias: +stats+ +# +# source://coderay//lib/coderay/encoders/statistic.rb#7 +class CodeRay::Encoders::Statistic < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/statistic.rb#70 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/statistic.rb#78 + def begin_line(kind); end + + # source://coderay//lib/coderay/encoders/statistic.rb#86 + def block_token(action, kind); end + + # source://coderay//lib/coderay/encoders/statistic.rb#74 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/statistic.rb#82 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/statistic.rb#11 + def real_token_count; end + + # source://coderay//lib/coderay/encoders/statistic.rb#62 + def text_token(text, kind); end + + # source://coderay//lib/coderay/encoders/statistic.rb#11 + def type_stats; end + + protected + + # source://coderay//lib/coderay/encoders/statistic.rb#42 + def finish(options); end + + # source://coderay//lib/coderay/encoders/statistic.rb#17 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/statistic.rb#24 +CodeRay::Encoders::Statistic::STATS = T.let(T.unsafe(nil), String) + +# source://coderay//lib/coderay/encoders/statistic.rb#38 +CodeRay::Encoders::Statistic::TOKEN_TYPES_ROW = T.let(T.unsafe(nil), String) + +# source://coderay//lib/coderay/encoders/statistic.rb#13 +class CodeRay::Encoders::Statistic::TypeStats < ::Struct + # Returns the value of attribute count + # + # @return [Object] the current value of count + # + # source://coderay//lib/coderay/encoders/statistic.rb#13 + def count; end + + # Sets the attribute count + # + # @param value [Object] the value to set the attribute count to. + # @return [Object] the newly set value + # + # source://coderay//lib/coderay/encoders/statistic.rb#13 + def count=(_); end + + # Returns the value of attribute size + # + # @return [Object] the current value of size + # + # source://coderay//lib/coderay/encoders/statistic.rb#13 + def size; end + + # Sets the attribute size + # + # @param value [Object] the value to set the attribute size to. + # @return [Object] the newly set value + # + # source://coderay//lib/coderay/encoders/statistic.rb#13 + def size=(_); end + + class << self + # source://coderay//lib/coderay/encoders/statistic.rb#13 + def [](*_arg0); end + + # source://coderay//lib/coderay/encoders/statistic.rb#13 + def inspect; end + + # source://coderay//lib/coderay/encoders/statistic.rb#13 + def keyword_init?; end + + # source://coderay//lib/coderay/encoders/statistic.rb#13 + def members; end + + # source://coderay//lib/coderay/encoders/statistic.rb#13 + def new(*_arg0); end + end +end + +# source://coderay//lib/coderay/encoders/terminal.rb#17 +class CodeRay::Encoders::Terminal < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/terminal.rb#156 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/terminal.rb#160 + def begin_line(kind); end + + # source://coderay//lib/coderay/encoders/terminal.rb#162 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/terminal.rb#172 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/terminal.rb#141 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/terminal.rb#133 + def setup(options); end + + private + + # source://coderay//lib/coderay/encoders/terminal.rb#179 + def open_token(kind); end +end + +# source://coderay//lib/coderay/encoders/terminal.rb#21 +CodeRay::Encoders::Terminal::TOKEN_COLORS = T.let(T.unsafe(nil), Hash) + +# Concats the tokens into a single string, resulting in the original +# code string if no tokens were removed. +# +# Alias: +plain+, +plaintext+ +# +# == Options +# +# === :separator +# A separator string to join the tokens. +# +# Default: empty String +# +# source://coderay//lib/coderay/encoders/text.rb#15 +class CodeRay::Encoders::Text < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/text.rb#25 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/text.rb#36 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/text.rb#21 +CodeRay::Encoders::Text::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/text.rb#19 +CodeRay::Encoders::Text::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# A Filter that selects tokens based on their token kind. +# +# == Options +# +# === :exclude +# +# One or many symbols (in an Array) which shall be excluded. +# +# Default: [] +# +# === :include +# +# One or many symbols (in an array) which shall be included. +# +# Default: :all, which means all tokens are included. +# +# Exclusion wins over inclusion. +# +# See also: CommentFilter +# +# source://coderay//lib/coderay/encoders/token_kind_filter.rb#25 +class CodeRay::Encoders::TokenKindFilter < ::CodeRay::Encoders::Filter + # Add the token group to the output stream if +kind+ matches the + # conditions. + # + # If it does not, all tokens inside the group are excluded from the + # stream, even if their kinds match. + # + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#66 + def begin_group(kind); end + + # See +begin_group+. + # + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#77 + def begin_line(kind); end + + # Take care of re-enabling the delegation of tokens to the output stream + # if an exluded group has ended. + # + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#89 + def end_group(kind); end + + # See +end_group+. + # + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#99 + def end_line(kind); end + + # Add the token to the output stream if +kind+ matches the conditions. + # + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#57 + def text_token(text, kind); end + + protected + + # @return [Boolean] + # + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#49 + def include_group?(kind); end + + # @return [Boolean] + # + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#45 + def include_text_token?(text, kind); end + + # source://coderay//lib/coderay/encoders/token_kind_filter.rb#35 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/token_kind_filter.rb#29 +CodeRay::Encoders::TokenKindFilter::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# = XML Encoder +# +# Uses REXML. Very slow. +# +# source://coderay//lib/coderay/encoders/xml.rb#7 +class CodeRay::Encoders::XML < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/xml.rb#58 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/xml.rb#62 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/xml.rb#38 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/xml.rb#31 + def finish(options); end + + # source://coderay//lib/coderay/encoders/xml.rb#22 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/xml.rb#15 +CodeRay::Encoders::XML::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/encoders/xml.rb#11 +CodeRay::Encoders::XML::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# = YAML Encoder +# +# Slow. +# +# source://coderay//lib/coderay/encoders/yaml.rb#9 +class CodeRay::Encoders::YAML < ::CodeRay::Encoders::Encoder + # source://coderay//lib/coderay/encoders/yaml.rb#31 + def begin_group(kind); end + + # source://coderay//lib/coderay/encoders/yaml.rb#39 + def begin_line(kind); end + + # source://coderay//lib/coderay/encoders/yaml.rb#35 + def end_group(kind); end + + # source://coderay//lib/coderay/encoders/yaml.rb#43 + def end_line(kind); end + + # source://coderay//lib/coderay/encoders/yaml.rb#27 + def text_token(text, kind); end + + protected + + # source://coderay//lib/coderay/encoders/yaml.rb#22 + def finish(options); end + + # source://coderay//lib/coderay/encoders/yaml.rb#16 + def setup(options); end +end + +# source://coderay//lib/coderay/encoders/yaml.rb#13 +CodeRay::Encoders::YAML::FILE_EXTENSION = T.let(T.unsafe(nil), String) + +# = FileType +# +# A simple filetype recognizer. +# +# == Usage +# +# # determine the type of the given +# lang = FileType[file_name] +# +# # return :text if the file type is unknown +# lang = FileType.fetch file_name, :text +# +# # try the shebang line, too +# lang = FileType.fetch file_name, :text, true +# +# source://coderay//lib/coderay/helpers/file_type.rb#17 +module CodeRay::FileType + class << self + # Try to determine the file type of the file. + # + # +filename+ is a relative or absolute path to a file. + # + # The file itself is only accessed when +read_shebang+ is set to true. + # That means you can get filetypes from files that don't exist. + # + # source://coderay//lib/coderay/helpers/file_type.rb#29 + def [](filename, read_shebang = T.unsafe(nil)); end + + # This works like Hash#fetch. + # + # If the filetype cannot be found, the +default+ value + # is returned. + # + # source://coderay//lib/coderay/helpers/file_type.rb#50 + def fetch(filename, default = T.unsafe(nil), read_shebang = T.unsafe(nil)); end + + protected + + # source://coderay//lib/coderay/helpers/file_type.rb#66 + def type_from_shebang(filename); end + end +end + +# source://coderay//lib/coderay/helpers/file_type.rb#79 +CodeRay::FileType::TypeFromExt = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/helpers/file_type.rb#139 +CodeRay::FileType::TypeFromName = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/helpers/file_type.rb#137 +CodeRay::FileType::TypeFromShebang = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/helpers/file_type.rb#19 +class CodeRay::FileType::UnknownFileType < ::Exception; end + +# = Plugin +# +# Plugins have to include this module. +# +# IMPORTANT: Use extend for this module. +# +# See CodeRay::PluginHost for examples. +# +# source://coderay//lib/coderay/helpers/plugin.rb#10 +module CodeRay::Plugin + # source://coderay//lib/coderay/helpers/plugin.rb#46 + def aliases; end + + # The PluginHost for this Plugin class. + # + # source://coderay//lib/coderay/helpers/plugin.rb#39 + def plugin_host(host = T.unsafe(nil)); end + + # Returns the value of attribute plugin_id. + # + # source://coderay//lib/coderay/helpers/plugin.rb#12 + def plugin_id; end + + # Register this class for the given +id+. + # + # Example: + # class MyPlugin < PluginHost::BaseClass + # register_for :my_id + # ... + # end + # + # See PluginHost.register. + # + # source://coderay//lib/coderay/helpers/plugin.rb#23 + def register_for(id); end + + # Returns the title of the plugin, or sets it to the + # optional argument +title+. + # + # source://coderay//lib/coderay/helpers/plugin.rb#30 + def title(title = T.unsafe(nil)); end +end + +# = PluginHost +# +# A simple subclass/subfolder plugin system. +# +# Example: +# class Generators +# extend PluginHost +# plugin_path 'app/generators' +# end +# +# class Generator +# extend Plugin +# PLUGIN_HOST = Generators +# end +# +# class FancyGenerator < Generator +# register_for :fancy +# end +# +# Generators[:fancy] #-> FancyGenerator +# # or +# CodeRay.require_plugin 'Generators/fancy' +# # or +# Generators::Fancy +# +# source://coderay//lib/coderay/helpers/plugin_host.rb#27 +module CodeRay::PluginHost + # Returns the Plugin for +id+. + # + # Example: + # yaml_plugin = MyPluginHost[:yaml] + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#49 + def [](id, *args, &blk); end + + # Returns an array of all Plugins. + # + # Note: This loads all plugins using load_all. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#151 + def all_plugins; end + + # Tries to +load+ the missing plugin by translating +const+ to the + # underscore form (eg. LinesOfCode becomes lines_of_code). + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#61 + def const_missing(const); end + + # Define the default plugin to use when no plugin is found + # for a given id, or return the default plugin. + # + # See also map. + # + # class MyColorHost < PluginHost + # map :navy => :dark_blue + # default :gray + # end + # + # MyColorHost.default # loads and returns the Gray plugin + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#114 + def default(id = T.unsafe(nil)); end + + # Returns an array of all .rb files in the plugin path. + # + # The extension .rb is not included. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#140 + def list; end + + # Returns the Plugin for +id+. + # + # Example: + # yaml_plugin = MyPluginHost[:yaml] + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#57 + def load(id, *args, &blk); end + + # Loads all plugins using list and load. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#39 + def load_all; end + + # Loads the map file (see map). + # + # This is done automatically when plugin_path is called. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#159 + def load_plugin_map; end + + # Map a plugin_id to another. + # + # Usage: Put this in a file plugin_path/_map.rb. + # + # class MyColorHost < PluginHost + # map :navy => :dark_blue, + # :maroon => :brown, + # :luna => :moon + # end + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#95 + def map(hash); end + + # A Hash of plugion_id => Plugin pairs. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#133 + def plugin_hash; end + + # The path where the plugins can be found. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#79 + def plugin_path(*args); end + + # Every plugin must register itself for +id+ by calling register_for, + # which calls this method. + # + # See Plugin#register_for. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#128 + def register(plugin, id); end + + protected + + # Return a plugin hash that automatically loads plugins. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#172 + def make_plugin_hash; end + + # Returns the expected path to the plugin file for the given id. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#196 + def path_to(plugin_id); end + + # Converts +id+ to a valid plugin ID String, or returns +nil+. + # + # Raises +ArgumentError+ for all other objects, or if the + # given String includes non-alphanumeric characters (\W). + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#204 + def validate_id(id); end + + class << self + # Adds the module/class to the PLUGIN_HOSTS list. + # + # source://coderay//lib/coderay/helpers/plugin_host.rb#72 + def extended(mod); end + end +end + +# source://coderay//lib/coderay/helpers/plugin_host.rb#33 +class CodeRay::PluginHost::HostNotFound < ::LoadError; end + +# source://coderay//lib/coderay/helpers/plugin_host.rb#35 +CodeRay::PluginHost::PLUGIN_HOSTS = T.let(T.unsafe(nil), Array) + +# dummy hash +# +# source://coderay//lib/coderay/helpers/plugin_host.rb#36 +CodeRay::PluginHost::PLUGIN_HOSTS_BY_ID = T.let(T.unsafe(nil), Hash) + +# Raised if Encoders::[] fails because: +# * a file could not be found +# * the requested Plugin is not registered +# +# source://coderay//lib/coderay/helpers/plugin_host.rb#32 +class CodeRay::PluginHost::PluginNotFound < ::LoadError; end + +# = Scanners +# +# This module holds the Scanner class and its subclasses. +# For example, the Ruby scanner is named CodeRay::Scanners::Ruby +# can be found in coderay/scanners/ruby. +# +# Scanner also provides methods and constants for the register +# mechanism and the [] method that returns the Scanner class +# belonging to the given lang. +# +# See PluginHost. +# +# source://coderay//lib/coderay/scanners.rb#18 +module CodeRay::Scanners + extend ::CodeRay::PluginHost +end + +# Scanner for C. +# +# source://coderay//lib/coderay/scanners/c.rb#5 +class CodeRay::Scanners::C < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/c.rb#44 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/c.rb#27 +CodeRay::Scanners::C::DIRECTIVES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/c.rb#39 +CodeRay::Scanners::C::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/c.rb#33 +CodeRay::Scanners::C::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/c.rb#10 +CodeRay::Scanners::C::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/c.rb#23 +CodeRay::Scanners::C::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/c.rb#17 +CodeRay::Scanners::C::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/c.rb#40 +CodeRay::Scanners::C::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for C++. +# +# Aliases: +cplusplus+, c++ +CodeRay::Scanners::CPlusPlus = CodeRay::Scanners::Text + +# source://coderay//lib/coderay/scanners/css.rb#4 +class CodeRay::Scanners::CSS < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/css.rb#55 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/css.rb#50 + def setup; end +end + +# source://coderay//lib/coderay/scanners/css.rb#8 +CodeRay::Scanners::CSS::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/css.rb#16 +module CodeRay::Scanners::CSS::RE; end + +# source://coderay//lib/coderay/scanners/css.rb#31 +CodeRay::Scanners::CSS::RE::AtKeyword = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#45 +CodeRay::Scanners::CSS::RE::AttributeSelector = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#43 +CodeRay::Scanners::CSS::RE::Class = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#38 +CodeRay::Scanners::CSS::RE::Dimension = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#19 +CodeRay::Scanners::CSS::RE::Escape = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#40 +CodeRay::Scanners::CSS::RE::Function = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#17 +CodeRay::Scanners::CSS::RE::Hex = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#26 +CodeRay::Scanners::CSS::RE::HexColor = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#42 +CodeRay::Scanners::CSS::RE::Id = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#30 +CodeRay::Scanners::CSS::RE::Ident = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#20 +CodeRay::Scanners::CSS::RE::NMChar = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#21 +CodeRay::Scanners::CSS::RE::NMStart = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#29 +CodeRay::Scanners::CSS::RE::Name = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#28 +CodeRay::Scanners::CSS::RE::Num = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#32 +CodeRay::Scanners::CSS::RE::Percentage = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#44 +CodeRay::Scanners::CSS::RE::PseudoClass = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#24 +CodeRay::Scanners::CSS::RE::String = T.let(T.unsafe(nil), Regexp) + +# TODO: buggy regexp +# +# source://coderay//lib/coderay/scanners/css.rb#22 +CodeRay::Scanners::CSS::RE::String1 = T.let(T.unsafe(nil), Regexp) + +# TODO: buggy regexp +# +# source://coderay//lib/coderay/scanners/css.rb#23 +CodeRay::Scanners::CSS::RE::String2 = T.let(T.unsafe(nil), Regexp) + +# differs from standard because it allows uppercase hex too +# +# source://coderay//lib/coderay/scanners/css.rb#18 +CodeRay::Scanners::CSS::RE::Unicode = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/css.rb#36 +CodeRay::Scanners::CSS::RE::Unit = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#6 +class CodeRay::Scanners::Clojure < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/clojure.rb#145 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/clojure.rb#95 +CodeRay::Scanners::Clojure::BASIC_IDENTIFIER = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#133 +CodeRay::Scanners::Clojure::COMPLEX10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#134 +CodeRay::Scanners::Clojure::COMPLEX16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#136 +CodeRay::Scanners::Clojure::COMPLEX2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#135 +CodeRay::Scanners::Clojure::COMPLEX8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#16 +CodeRay::Scanners::Clojure::CORE_FORMS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/clojure.rb#120 +CodeRay::Scanners::Clojure::DECIMAL = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#98 +CodeRay::Scanners::Clojure::DIGIT = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#99 +CodeRay::Scanners::Clojure::DIGIT10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#100 +CodeRay::Scanners::Clojure::DIGIT16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#102 +CodeRay::Scanners::Clojure::DIGIT2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#101 +CodeRay::Scanners::Clojure::DIGIT8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#107 +CodeRay::Scanners::Clojure::EXACTNESS = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#110 +CodeRay::Scanners::Clojure::EXP = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#109 +CodeRay::Scanners::Clojure::EXP_MARK = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#96 +CodeRay::Scanners::Clojure::IDENTIFIER = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#85 +CodeRay::Scanners::Clojure::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/clojure.rb#129 +CodeRay::Scanners::Clojure::IMAG10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#130 +CodeRay::Scanners::Clojure::IMAG16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#132 +CodeRay::Scanners::Clojure::IMAG2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#131 +CodeRay::Scanners::Clojure::IMAG8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#90 +CodeRay::Scanners::Clojure::KEYWORD_NEXT_TOKEN_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/clojure.rb#141 +CodeRay::Scanners::Clojure::NUM = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#137 +CodeRay::Scanners::Clojure::NUM10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#138 +CodeRay::Scanners::Clojure::NUM16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#140 +CodeRay::Scanners::Clojure::NUM2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#139 +CodeRay::Scanners::Clojure::NUM8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#78 +CodeRay::Scanners::Clojure::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/clojure.rb#112 +CodeRay::Scanners::Clojure::PREFIX10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#113 +CodeRay::Scanners::Clojure::PREFIX16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#115 +CodeRay::Scanners::Clojure::PREFIX2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#114 +CodeRay::Scanners::Clojure::PREFIX8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#106 +CodeRay::Scanners::Clojure::RADIX10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#103 +CodeRay::Scanners::Clojure::RADIX16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#105 +CodeRay::Scanners::Clojure::RADIX2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#104 +CodeRay::Scanners::Clojure::RADIX8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#125 +CodeRay::Scanners::Clojure::REAL10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#126 +CodeRay::Scanners::Clojure::REAL16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#128 +CodeRay::Scanners::Clojure::REAL2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#127 +CodeRay::Scanners::Clojure::REAL8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#108 +CodeRay::Scanners::Clojure::SIGN = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#11 +CodeRay::Scanners::Clojure::SPECIAL_FORMS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/clojure.rb#111 +CodeRay::Scanners::Clojure::SUFFIX = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#97 +CodeRay::Scanners::Clojure::SYMBOL = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#116 +CodeRay::Scanners::Clojure::UINT10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#117 +CodeRay::Scanners::Clojure::UINT16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#119 +CodeRay::Scanners::Clojure::UINT2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#118 +CodeRay::Scanners::Clojure::UINT8 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#121 +CodeRay::Scanners::Clojure::UREAL10 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#122 +CodeRay::Scanners::Clojure::UREAL16 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#124 +CodeRay::Scanners::Clojure::UREAL2 = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/clojure.rb#123 +CodeRay::Scanners::Clojure::UREAL8 = T.let(T.unsafe(nil), Regexp) + +# = Debug Scanner +# +# Interprets the output of the Encoders::Debug encoder (basically the inverse function). +# +# source://coderay//lib/coderay/scanners/debug.rb#9 +class CodeRay::Scanners::Debug < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/debug.rb#21 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/debug.rb#16 + def setup; end +end + +# Scanner for the Delphi language (Object Pascal). +# +# Alias: +pascal+ +# +# source://coderay//lib/coderay/scanners/delphi.rb#7 +class CodeRay::Scanners::Delphi < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/delphi.rb#45 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/delphi.rb#25 +CodeRay::Scanners::Delphi::DIRECTIVES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/delphi.rb#36 +CodeRay::Scanners::Delphi::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# source://coderay//lib/coderay/scanners/delphi.rb#12 +CodeRay::Scanners::Delphi::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/delphi.rb#40 +CodeRay::Scanners::Delphi::NAME_FOLLOWS = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# Scanner for output of the diff command. +# +# Alias: +patch+ +# +# source://coderay//lib/coderay/scanners/diff.rb#7 +class CodeRay::Scanners::Diff < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/diff.rb#19 + def scan_tokens(encoder, options); end + + private + + # source://coderay//lib/coderay/scanners/diff.rb#204 + def diff(a, b); end +end + +# source://coderay//lib/coderay/scanners/diff.rb#12 +CodeRay::Scanners::Diff::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Scanner for HTML ERB templates. +# +# source://coderay//lib/coderay/scanners/erb.rb#8 +class CodeRay::Scanners::ERB < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/erb.rb#38 + def reset_instance; end + + # source://coderay//lib/coderay/scanners/erb.rb#43 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/erb.rb#33 + def setup; end +end + +# source://coderay//lib/coderay/scanners/erb.rb#15 +CodeRay::Scanners::ERB::ERB_RUBY_BLOCK = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/erb.rb#13 +CodeRay::Scanners::ERB::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/erb.rb#27 +CodeRay::Scanners::ERB::START_OF_ERB = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/go.rb#4 +class CodeRay::Scanners::Go < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/go.rb#50 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/go.rb#45 +CodeRay::Scanners::Go::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/go.rb#39 +CodeRay::Scanners::Go::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# http://golang.org/ref/spec#Keywords +# +# source://coderay//lib/coderay/scanners/go.rb#10 +CodeRay::Scanners::Go::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/go.rb#29 +CodeRay::Scanners::Go::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/go.rb#34 +CodeRay::Scanners::Go::PREDEFINED_FUNCTIONS = T.let(T.unsafe(nil), Array) + +# http://golang.org/ref/spec#Types +# +# source://coderay//lib/coderay/scanners/go.rb#19 +CodeRay::Scanners::Go::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/go.rb#46 +CodeRay::Scanners::Go::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for Groovy. +# +# source://coderay//lib/coderay/scanners/groovy.rb#7 +class CodeRay::Scanners::Groovy < ::CodeRay::Scanners::Java + protected + + # source://coderay//lib/coderay/scanners/groovy.rb#43 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/groovy.rb#39 + def setup; end +end + +# source://coderay//lib/coderay/scanners/groovy.rb#24 +CodeRay::Scanners::Groovy::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# TODO: check list of keywords +# +# source://coderay//lib/coderay/scanners/groovy.rb#12 +CodeRay::Scanners::Groovy::GROOVY_KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/groovy.rb#18 +CodeRay::Scanners::Groovy::GROOVY_MAGIC_VARIABLES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/groovy.rb#20 +CodeRay::Scanners::Groovy::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/groovy.rb#15 +CodeRay::Scanners::Groovy::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/groovy.rb#26 +CodeRay::Scanners::Groovy::REGEXP_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# TODO: interpretation inside ', ", / +# +# source://coderay//lib/coderay/scanners/groovy.rb#29 +CodeRay::Scanners::Groovy::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/groovy.rb#25 +CodeRay::Scanners::Groovy::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/haml.rb#8 +class CodeRay::Scanners::HAML < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/haml.rb#24 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/haml.rb#17 + def setup; end +end + +# source://coderay//lib/coderay/scanners/haml.rb#13 +CodeRay::Scanners::HAML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# HTML Scanner +# +# Alias: +xhtml+ +# +# See also: Scanners::XML +# +# source://coderay//lib/coderay/scanners/html.rb#9 +class CodeRay::Scanners::HTML < ::CodeRay::Scanners::Scanner + # source://coderay//lib/coderay/scanners/html.rb#62 + def reset; end + + protected + + # source://coderay//lib/coderay/scanners/html.rb#83 + def scan_css(encoder, code, state = T.unsafe(nil)); end + + # source://coderay//lib/coderay/scanners/html.rb#76 + def scan_java_script(encoder, code); end + + # source://coderay//lib/coderay/scanners/html.rb#90 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/html.rb#70 + def setup; end +end + +# source://coderay//lib/coderay/scanners/html.rb#39 +CodeRay::Scanners::HTML::ATTR_NAME = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/html.rb#42 +CodeRay::Scanners::HTML::ENTITY = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/html.rb#20 +CodeRay::Scanners::HTML::EVENT_ATTRIBUTES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/html.rb#41 +CodeRay::Scanners::HTML::HEX = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/html.rb#35 +CodeRay::Scanners::HTML::IN_ATTRIBUTE = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# source://coderay//lib/coderay/scanners/html.rb#13 +CodeRay::Scanners::HTML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/html.rb#57 +CodeRay::Scanners::HTML::PLAIN_STRING_CONTENT = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/html.rb#40 +CodeRay::Scanners::HTML::TAG_END = T.let(T.unsafe(nil), Regexp) + +# Scanner for JSON (JavaScript Object Notation). +# +# source://coderay//lib/coderay/scanners/json.rb#5 +class CodeRay::Scanners::JSON < ::CodeRay::Scanners::Scanner + protected + + # See http://json.org/ for a definition of the JSON lexic/grammar. + # + # source://coderay//lib/coderay/scanners/json.rb#26 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/json.rb#21 + def setup; end +end + +# source://coderay//lib/coderay/scanners/json.rb#15 +CodeRay::Scanners::JSON::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/json.rb#17 +CodeRay::Scanners::JSON::KEY = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/json.rb#10 +CodeRay::Scanners::JSON::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/json.rb#16 +CodeRay::Scanners::JSON::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for Java. +# +# source://coderay//lib/coderay/scanners/java.rb#5 +class CodeRay::Scanners::Java < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/java.rb#51 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/java/builtin_types.rb#4 +module CodeRay::Scanners::Java::BuiltinTypes; end + +# source://coderay//lib/coderay/scanners/java/builtin_types.rb#7 +CodeRay::Scanners::Java::BuiltinTypes::List = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java.rb#19 +CodeRay::Scanners::Java::CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java.rb#25 +CodeRay::Scanners::Java::DIRECTIVES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java.rb#40 +CodeRay::Scanners::Java::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/java.rb#47 +CodeRay::Scanners::Java::IDENT = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/java.rb#30 +CodeRay::Scanners::Java::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html +# +# source://coderay//lib/coderay/scanners/java.rb#12 +CodeRay::Scanners::Java::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java.rb#20 +CodeRay::Scanners::Java::MAGIC_VARIABLES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java.rb#18 +CodeRay::Scanners::Java::RESERVED = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java.rb#42 +CodeRay::Scanners::Java::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/java.rb#21 +CodeRay::Scanners::Java::TYPES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java.rb#41 +CodeRay::Scanners::Java::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for JavaScript. +# +# Aliases: +ecmascript+, +ecma_script+, +javascript+ +# +# source://coderay//lib/coderay/scanners/java_script.rb#7 +class CodeRay::Scanners::JavaScript < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/java_script.rb#224 + def reset_instance; end + + # source://coderay//lib/coderay/scanners/java_script.rb#61 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/java_script.rb#57 + def setup; end + + # source://coderay//lib/coderay/scanners/java_script.rb#229 + def xml_scanner; end +end + +# source://coderay//lib/coderay/scanners/java_script.rb#42 +CodeRay::Scanners::JavaScript::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/java_script.rb#36 +CodeRay::Scanners::JavaScript::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# The actual JavaScript keywords. +# +# source://coderay//lib/coderay/scanners/java_script.rb#13 +CodeRay::Scanners::JavaScript::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java_script.rb#24 +CodeRay::Scanners::JavaScript::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/java_script.rb#50 +CodeRay::Scanners::JavaScript::KEY_CHECK_PATTERN = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/java_script.rb#22 +CodeRay::Scanners::JavaScript::MAGIC_VARIABLES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java_script.rb#18 +CodeRay::Scanners::JavaScript::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java_script.rb#44 +CodeRay::Scanners::JavaScript::REGEXP_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Reserved for future use. +# +# source://coderay//lib/coderay/scanners/java_script.rb#29 +CodeRay::Scanners::JavaScript::RESERVED_WORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/java_script.rb#45 +CodeRay::Scanners::JavaScript::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/java_script.rb#43 +CodeRay::Scanners::JavaScript::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# Scanner for the Lua[http://lua.org] programming lanuage. +# +# The language’s complete syntax is defined in +# {the Lua manual}[http://www.lua.org/manual/5.2/manual.html], +# which is what this scanner tries to conform to. +# +# source://coderay//lib/coderay/scanners/lua.rb#11 +class CodeRay::Scanners::Lua < ::CodeRay::Scanners::Scanner + protected + + # CodeRay entry hook. Starts parsing. + # + # source://coderay//lib/coderay/scanners/lua.rb#60 + def scan_tokens(encoder, options); end + + # Scanner initialization. + # + # source://coderay//lib/coderay/scanners/lua.rb#54 + def setup; end +end + +# Automatic token kind selection for normal words. +# +# source://coderay//lib/coderay/scanners/lua.rb#46 +CodeRay::Scanners::Lua::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# Keywords used in Lua. +# +# source://coderay//lib/coderay/scanners/lua.rb#18 +CodeRay::Scanners::Lua::KEYWORDS = T.let(T.unsafe(nil), Array) + +# Constants set by the Lua core. +# +# source://coderay//lib/coderay/scanners/lua.rb#25 +CodeRay::Scanners::Lua::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# The expressions contained in this array are parts of Lua’s `basic' +# library. Although it’s not entirely necessary to load that library, +# it is highly recommended and one would have to provide own implementations +# of some of these expressions if one does not do so. They however aren’t +# keywords, neither are they constants, but nearly predefined, so they +# get tagged as `predefined' rather than anything else. +# +# This list excludes values of form `_UPPERCASE' because the Lua manual +# requires such identifiers to be reserved by Lua anyway and they are +# highlighted directly accordingly, without the need for specific +# identifiers to be listed here. +# +# source://coderay//lib/coderay/scanners/lua.rb#38 +CodeRay::Scanners::Lua::PREDEFINED_EXPRESSIONS = T.let(T.unsafe(nil), Array) + +# Scanner for PHP. +# +# Original by Stefan Walk. +# +# source://coderay//lib/coderay/scanners/php.rb#10 +class CodeRay::Scanners::PHP < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/php.rb#23 + def reset_instance; end + + # source://coderay//lib/coderay/scanners/php.rb#234 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/php.rb#19 + def setup; end +end + +# source://coderay//lib/coderay/scanners/php.rb#15 +CodeRay::Scanners::PHP::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#197 +module CodeRay::Scanners::PHP::RE; end + +# source://coderay//lib/coderay/scanners/php.rb#211 +CodeRay::Scanners::PHP::RE::HTML_INDICATOR = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/php.rb#213 +CodeRay::Scanners::PHP::RE::IDENTIFIER = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/php.rb#216 +CodeRay::Scanners::PHP::RE::OPERATOR = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/php.rb#206 +CodeRay::Scanners::PHP::RE::PHP_END = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/php.rb#199 +CodeRay::Scanners::PHP::RE::PHP_START = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/php.rb#214 +CodeRay::Scanners::PHP::RE::VARIABLE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/php.rb#28 +module CodeRay::Scanners::PHP::Words; end + +# according to http://php.net/quickref.php on 2009-04-21; +# all functions with _ excluded (module functions) and selected additional functions +# +# source://coderay//lib/coderay/scanners/php.rb#50 +CodeRay::Scanners::PHP::Words::BUILTIN_FUNCTIONS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#46 +CodeRay::Scanners::PHP::Words::CLASSES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#145 +CodeRay::Scanners::PHP::Words::CONSTANTS = T.let(T.unsafe(nil), Array) + +# TODO: more built-in PHP functions? +# +# source://coderay//lib/coderay/scanners/php.rb#140 +CodeRay::Scanners::PHP::Words::EXCEPTIONS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#184 +CodeRay::Scanners::PHP::Words::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# according to http://www.php.net/manual/en/reserved.keywords.php +# +# source://coderay//lib/coderay/scanners/php.rb#31 +CodeRay::Scanners::PHP::Words::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#41 +CodeRay::Scanners::PHP::Words::LANGUAGE_CONSTRUCTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#178 +CodeRay::Scanners::PHP::Words::PREDEFINED = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#39 +CodeRay::Scanners::PHP::Words::TYPES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/php.rb#193 +CodeRay::Scanners::PHP::Words::VARIABLE_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# Scanner for Python. Supports Python 3. +# +# Based on pygments' PythonLexer, see +# http://dev.pocoo.org/projects/pygments/browser/pygments/lexers/agile.py. +# +# source://coderay//lib/coderay/scanners/python.rb#8 +class CodeRay::Scanners::Python < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/python.rb#103 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/python.rb#86 +CodeRay::Scanners::Python::DEF_NEW_STATE = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/python.rb#91 +CodeRay::Scanners::Python::DESCRIPTOR = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/python.rb#97 +CodeRay::Scanners::Python::DOCSTRING_COMING = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/python.rb#65 +CodeRay::Scanners::Python::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/python.rb#57 +CodeRay::Scanners::Python::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/python.rb#13 +CodeRay::Scanners::Python::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/python.rb#64 +CodeRay::Scanners::Python::NAME = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/python.rb#21 +CodeRay::Scanners::Python::OLD_KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/python.rb#68 +CodeRay::Scanners::Python::OPERATOR = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/python.rb#37 +CodeRay::Scanners::Python::PREDEFINED_EXCEPTIONS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/python.rb#25 +CodeRay::Scanners::Python::PREDEFINED_METHODS_AND_TYPES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/python.rb#52 +CodeRay::Scanners::Python::PREDEFINED_VARIABLES_AND_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/python.rb#82 +CodeRay::Scanners::Python::STRING_CONTENT_REGEXP = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/python.rb#78 +CodeRay::Scanners::Python::STRING_DELIMITER_REGEXP = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/python.rb#66 +CodeRay::Scanners::Python::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# = Raydebug Scanner +# +# Highlights the output of the Encoders::Debug encoder. +# +# source://coderay//lib/coderay/scanners/raydebug.rb#9 +class CodeRay::Scanners::Raydebug < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/raydebug.rb#22 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/raydebug.rb#17 + def setup; end +end + +# This scanner is really complex, since Ruby _is_ a complex language! +# +# It tries to highlight 100% of all common code, +# and 90% of strange codes. +# +# It is optimized for HTML highlighting, and is not very useful for +# parsing or pretty printing. +# +# source://coderay//lib/coderay/scanners/ruby.rb#11 +class CodeRay::Scanners::Ruby < ::CodeRay::Scanners::Scanner + # source://coderay//lib/coderay/scanners/ruby.rb#19 + def interpreted_string_state; end + + protected + + # source://coderay//lib/coderay/scanners/ruby.rb#29 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/ruby.rb#25 + def setup; end +end + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#5 +module CodeRay::Scanners::Ruby::Patterns; end + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#72 +CodeRay::Scanners::Ruby::Patterns::BINARY = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#106 +CodeRay::Scanners::Ruby::Patterns::CHARACTER = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#55 +CodeRay::Scanners::Ruby::Patterns::CLASS_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#96 +CodeRay::Scanners::Ruby::Patterns::CONTROL_META_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#132 +CodeRay::Scanners::Ruby::Patterns::DATA = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#69 +CodeRay::Scanners::Ruby::Patterns::DECIMAL = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#102 +CodeRay::Scanners::Ruby::Patterns::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#74 +CodeRay::Scanners::Ruby::Patterns::EXPONENT = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#168 +CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_INTERPRETED = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#161 +CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_KIND = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#160 +CodeRay::Scanners::Ruby::Patterns::FANCY_STRING_START = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#76 +CodeRay::Scanners::Ruby::Patterns::FLOAT_OR_INT = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#75 +CodeRay::Scanners::Ruby::Patterns::FLOAT_SUFFIX = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#57 +CodeRay::Scanners::Ruby::Patterns::GLOBAL_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#116 +CodeRay::Scanners::Ruby::Patterns::HEREDOC_OPEN = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#71 +CodeRay::Scanners::Ruby::Patterns::HEXADECIMAL = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#38 +CodeRay::Scanners::Ruby::Patterns::IDENT = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#28 +CodeRay::Scanners::Ruby::Patterns::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#54 +CodeRay::Scanners::Ruby::Patterns::INSTANCE_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#7 +CodeRay::Scanners::Ruby::Patterns::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#151 +CodeRay::Scanners::Ruby::Patterns::KEYWORDS_EXPECTING_VALUE = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#32 +CodeRay::Scanners::Ruby::Patterns::KEYWORD_NEW_STATE = T.let(T.unsafe(nil), CodeRay::WordList) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#53 +CodeRay::Scanners::Ruby::Patterns::METHOD_AFTER_DOT = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#40 +CodeRay::Scanners::Ruby::Patterns::METHOD_NAME = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#52 +CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_EX = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#41 +CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_OPERATOR = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#87 +CodeRay::Scanners::Ruby::Patterns::METHOD_NAME_OR_SYMBOL = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#51 +CodeRay::Scanners::Ruby::Patterns::METHOD_SUFFIX = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#77 +CodeRay::Scanners::Ruby::Patterns::NUMERIC = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#56 +CodeRay::Scanners::Ruby::Patterns::OBJECT_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#70 +CodeRay::Scanners::Ruby::Patterns::OCTAL = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#17 +CodeRay::Scanners::Ruby::Patterns::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#58 +CodeRay::Scanners::Ruby::Patterns::PREFIX_VARIABLE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#61 +CodeRay::Scanners::Ruby::Patterns::QUOTE_TO_TYPE = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#67 +CodeRay::Scanners::Ruby::Patterns::REGEXP_MODIFIERS = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#126 +CodeRay::Scanners::Ruby::Patterns::RUBYDOC = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#138 +CodeRay::Scanners::Ruby::Patterns::RUBYDOC_OR_DATA = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#89 +CodeRay::Scanners::Ruby::Patterns::SIMPLE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#79 +CodeRay::Scanners::Ruby::Patterns::SYMBOL = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#142 +CodeRay::Scanners::Ruby::Patterns::VALUE_FOLLOWS = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/patterns.rb#59 +CodeRay::Scanners::Ruby::Patterns::VARIABLE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/ruby/string_state.rb#8 +class CodeRay::Scanners::Ruby::StringState < ::Struct + # @return [StringState] a new instance of StringState + # + # source://coderay//lib/coderay/scanners/ruby/string_state.rb#48 + def initialize(kind, interpreted, delim, heredoc = T.unsafe(nil)); end + + # source://coderay//lib/coderay/scanners/ruby/string_state.rb#63 + def heredoc_pattern(delim, interpreted, indented); end + + class << self + # source://coderay//lib/coderay/scanners/ruby/string_state.rb#40 + def simple_key_pattern(delim); end + end +end + +# source://coderay//lib/coderay/scanners/ruby/string_state.rb#10 +CodeRay::Scanners::Ruby::StringState::CLOSING_PAREN = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/ruby/string_state.rb#17 +CodeRay::Scanners::Ruby::StringState::STRING_PATTERN = T.let(T.unsafe(nil), Hash) + +# by Josh Goebel +# +# source://coderay//lib/coderay/scanners/sql.rb#5 +class CodeRay::Scanners::SQL < ::CodeRay::Scanners::Scanner + # source://coderay//lib/coderay/scanners/sql.rb#66 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/sql.rb#23 +CodeRay::Scanners::SQL::COMMANDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/sql.rb#38 +CodeRay::Scanners::SQL::DIRECTIVES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/sql.rb#55 +CodeRay::Scanners::SQL::ESCAPE = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/sql.rb#46 +CodeRay::Scanners::SQL::IDENT_KIND = T.let(T.unsafe(nil), CodeRay::WordList::CaseIgnoring) + +# source://coderay//lib/coderay/scanners/sql.rb#9 +CodeRay::Scanners::SQL::KEYWORDS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/sql.rb#18 +CodeRay::Scanners::SQL::OBJECTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/sql.rb#44 +CodeRay::Scanners::SQL::PREDEFINED_CONSTANTS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/sql.rb#36 +CodeRay::Scanners::SQL::PREDEFINED_FUNCTIONS = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/sql.rb#28 +CodeRay::Scanners::SQL::PREDEFINED_TYPES = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/scanners/sql.rb#60 +CodeRay::Scanners::SQL::STRING_CONTENT_PATTERN = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/sql.rb#58 +CodeRay::Scanners::SQL::STRING_PREFIXES = T.let(T.unsafe(nil), Regexp) + +# source://coderay//lib/coderay/scanners/sql.rb#56 +CodeRay::Scanners::SQL::UNICODE_ESCAPE = T.let(T.unsafe(nil), Regexp) + +# A scanner for Sass. +# +# source://coderay//lib/coderay/scanners/sass.rb#5 +class CodeRay::Scanners::Sass < ::CodeRay::Scanners::CSS + protected + + # source://coderay//lib/coderay/scanners/sass.rb#16 + def scan_tokens(encoder, options); end + + # source://coderay//lib/coderay/scanners/sass.rb#12 + def setup; end +end + +# = Scanner +# +# The base class for all Scanners. +# +# It is a subclass of Ruby's great +StringScanner+, which +# makes it easy to access the scanning methods inside. +# +# It is also +Enumerable+, so you can use it like an Array of +# Tokens: +# +# require 'coderay' +# +# c_scanner = CodeRay::Scanners[:c].new "if (*p == '{') nest++;" +# +# for text, kind in c_scanner +# puts text if kind == :operator +# end +# +# # prints: (*==)++; +# +# OK, this is a very simple example :) +# You can also use +map+, +any?+, +find+ and even +sort_by+, +# if you want. +# +# source://coderay//lib/coderay/scanners/scanner.rb#29 +class CodeRay::Scanners::Scanner < ::StringScanner + include ::Enumerable + extend ::CodeRay::Plugin + + # Create a new Scanner. + # + # * +code+ is the input String and is handled by the superclass + # StringScanner. + # * +options+ is a Hash with Symbols as keys. + # It is merged with the default options of the class (you can + # overwrite default options here.) + # + # Else, a Tokens object is used. + # + # @return [Scanner] a new instance of Scanner + # + # source://coderay//lib/coderay/scanners/scanner.rb#125 + def initialize(code = T.unsafe(nil), options = T.unsafe(nil)); end + + # The string in binary encoding. + # + # To be used with #pos, which is the index of the byte the scanner + # will scan next. + # + # source://coderay//lib/coderay/scanners/scanner.rb#218 + def binary_string; end + + # The current column position of the scanner, starting with 1. + # See also: #line. + # + # source://coderay//lib/coderay/scanners/scanner.rb#209 + def column(pos = T.unsafe(nil)); end + + # Traverse the tokens. + # + # source://coderay//lib/coderay/scanners/scanner.rb#192 + def each(&block); end + + # the default file extension for this scanner + # + # source://coderay//lib/coderay/scanners/scanner.rb#160 + def file_extension; end + + # the Plugin ID for this scanner + # + # source://coderay//lib/coderay/scanners/scanner.rb#155 + def lang; end + + # The current line position of the scanner, starting with 1. + # See also: #column. + # + # Beware, this is implemented inefficiently. It should be used + # for debugging only. + # + # source://coderay//lib/coderay/scanners/scanner.rb#202 + def line(pos = T.unsafe(nil)); end + + # Sets back the scanner. Subclasses should redefine the reset_instance + # method instead of this one. + # + # source://coderay//lib/coderay/scanners/scanner.rb#142 + def reset; end + + # Returns the value of attribute state. + # + # source://coderay//lib/coderay/scanners/scanner.rb#44 + def state; end + + # Sets the attribute state + # + # @param value the value to set the attribute state to. + # + # source://coderay//lib/coderay/scanners/scanner.rb#44 + def state=(_arg0); end + + # Set a new string to be scanned. + # + # source://coderay//lib/coderay/scanners/scanner.rb#148 + def string=(code); end + + # Scan the code and returns all tokens in a Tokens object. + # + # source://coderay//lib/coderay/scanners/scanner.rb#165 + def tokenize(source = T.unsafe(nil), options = T.unsafe(nil)); end + + # Cache the result of tokenize. + # + # source://coderay//lib/coderay/scanners/scanner.rb#187 + def tokens; end + + protected + + # Scanner error with additional status information + # + # @raise [ScanError] + # + # source://coderay//lib/coderay/scanners/scanner.rb#314 + def raise_inspect(message, tokens, state = T.unsafe(nil), ambit = T.unsafe(nil), backtrace = T.unsafe(nil)); end + + # source://coderay//lib/coderay/scanners/scanner.rb#289 + def raise_inspect_arguments(message, tokens, state, ambit); end + + # Resets the scanner. + # + # source://coderay//lib/coderay/scanners/scanner.rb#265 + def reset_instance; end + + # Shorthand for scan_until(/\z/). + # This method also avoids a JRuby 1.9 mode bug. + # + # source://coderay//lib/coderay/scanners/scanner.rb#328 + def scan_rest; end + + # This is the central method, and commonly the only one a + # subclass implements. + # + # Subclasses must implement this method; it must return +tokens+ + # and must only use Tokens#<< for storing scanned tokens! + # + # @raise [NotImplementedError] + # + # source://coderay//lib/coderay/scanners/scanner.rb#260 + def scan_tokens(tokens, options); end + + # source://coderay//lib/coderay/scanners/scanner.rb#305 + def scanner_state_info(state); end + + # source://coderay//lib/coderay/scanners/scanner.rb#239 + def set_string_from_source(source); end + + # source://coderay//lib/coderay/scanners/scanner.rb#250 + def set_tokens_from_options(options); end + + # Can be implemented by subclasses to do some initialization + # that has to be done once per instance. + # + # Use reset for initialization that has to be done once per + # scan. + # + # source://coderay//lib/coderay/scanners/scanner.rb#236 + def setup; end + + # source://coderay//lib/coderay/scanners/scanner.rb#322 + def tokens_last(tokens, n); end + + # source://coderay//lib/coderay/scanners/scanner.rb#318 + def tokens_size(tokens); end + + class << self + # The encoding used internally by this scanner. + # + # source://coderay//lib/coderay/scanners/scanner.rb#71 + def encoding(name = T.unsafe(nil)); end + + # The typical filename suffix for this scanner's language. + # + # source://coderay//lib/coderay/scanners/scanner.rb#66 + def file_extension(extension = T.unsafe(nil)); end + + # The lang of this Scanner class, which is equal to its Plugin ID. + # + # source://coderay//lib/coderay/scanners/scanner.rb#76 + def lang; end + + # Normalizes the given code into a string with UNIX newlines, in the + # scanner's internal encoding, with invalid and undefined charachters + # replaced by placeholders. Always returns a new object. + # + # source://coderay//lib/coderay/scanners/scanner.rb#51 + def normalize(code); end + + protected + + # source://coderay//lib/coderay/scanners/scanner.rb#82 + def encode_with_encoding(code, target_encoding); end + + # source://coderay//lib/coderay/scanners/scanner.rb#100 + def guess_encoding(s); end + + # source://coderay//lib/coderay/scanners/scanner.rb#96 + def to_unix(code); end + end +end + +# The default options for all scanner classes. +# +# Define @default_options for subclasses. +# +# source://coderay//lib/coderay/scanners/scanner.rb#40 +CodeRay::Scanners::Scanner::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/scanners/scanner.rb#42 +CodeRay::Scanners::Scanner::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# source://coderay//lib/coderay/helpers/plugin.rb#41 +CodeRay::Scanners::Scanner::PLUGIN_HOST = CodeRay::Scanners + +# source://coderay//lib/coderay/scanners/scanner.rb#299 +CodeRay::Scanners::Scanner::SCANNER_STATE_INFO = T.let(T.unsafe(nil), String) + +# source://coderay//lib/coderay/scanners/scanner.rb#271 +CodeRay::Scanners::Scanner::SCAN_ERROR_MESSAGE = T.let(T.unsafe(nil), String) + +# Raised if a Scanner fails while scanning +# +# source://coderay//lib/coderay/scanners/scanner.rb#35 +class CodeRay::Scanners::Scanner::ScanError < ::StandardError; end + +# source://coderay//lib/coderay/scanners/taskpaper.rb#4 +class CodeRay::Scanners::Taskpaper < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/taskpaper.rb#11 + def scan_tokens(encoder, options); end +end + +# Scanner for plain text. +# +# Yields just one token of the kind :plain. +# +# Alias: +plaintext+, +plain+ +# +# source://coderay//lib/coderay/scanners/text.rb#9 +class CodeRay::Scanners::Text < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/text.rb#18 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/text.rb#14 +CodeRay::Scanners::Text::KINDS_NOT_LOC = T.let(T.unsafe(nil), Array) + +# Scanner for XML. +# +# Currently this is the same scanner as Scanners::HTML. +# +# source://coderay//lib/coderay/scanners/xml.rb#9 +class CodeRay::Scanners::XML < ::CodeRay::Scanners::HTML; end + +# Scanner for YAML. +# +# Based on the YAML scanner from Syntax by Jamis Buck. +# +# source://coderay//lib/coderay/scanners/yaml.rb#7 +class CodeRay::Scanners::YAML < ::CodeRay::Scanners::Scanner + protected + + # source://coderay//lib/coderay/scanners/yaml.rb#16 + def scan_tokens(encoder, options); end +end + +# source://coderay//lib/coderay/scanners/yaml.rb#12 +CodeRay::Scanners::YAML::KINDS_NOT_LOC = T.let(T.unsafe(nil), Symbol) + +# This module holds the Style class and its subclasses. +# +# See Plugin. +# +# source://coderay//lib/coderay/styles.rb#6 +module CodeRay::Styles + extend ::CodeRay::PluginHost +end + +# A colorful theme using CSS 3 colors (with alpha channel). +# +# source://coderay//lib/coderay/styles/alpha.rb#5 +class CodeRay::Styles::Alpha < ::CodeRay::Styles::Style; end + +# source://coderay//lib/coderay/styles/alpha.rb#14 +CodeRay::Styles::Alpha::CSS_MAIN_STYLES = T.let(T.unsafe(nil), String) + +# source://coderay//lib/coderay/styles/alpha.rb#53 +CodeRay::Styles::Alpha::TOKEN_COLORS = T.let(T.unsafe(nil), String) + +# Base class for styles. +# +# Styles are used by Encoders::HTML to colorize tokens. +# +# source://coderay//lib/coderay/styles/style.rb#8 +class CodeRay::Styles::Style + extend ::CodeRay::Plugin +end + +# source://coderay//lib/coderay/styles/style.rb#12 +CodeRay::Styles::Style::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://coderay//lib/coderay/helpers/plugin.rb#41 +CodeRay::Styles::Style::PLUGIN_HOST = CodeRay::Styles + +# A Hash of all known token kinds and their associated CSS classes. +# +# source://coderay//lib/coderay/token_kinds.rb#4 +CodeRay::TokenKinds = T.let(T.unsafe(nil), Hash) + +# The Tokens class represents a list of tokens returned from +# a Scanner. It's actually just an Array with a few helper methods. +# +# A token itself is not a special object, just two elements in an Array: +# * the _token_ _text_ (the original source of the token in a String) or +# a _token_ _action_ (begin_group, end_group, begin_line, end_line) +# * the _token_ _kind_ (a Symbol representing the type of the token) +# +# It looks like this: +# +# ..., '# It looks like this', :comment, ... +# ..., '3.1415926', :float, ... +# ..., '$^', :error, ... +# +# Some scanners also yield sub-tokens, represented by special +# token actions, for example :begin_group and :end_group. +# +# The Ruby scanner, for example, splits "a string" into: +# +# [ +# :begin_group, :string, +# '"', :delimiter, +# 'a string', :content, +# '"', :delimiter, +# :end_group, :string +# ] +# +# Tokens can be used to save the output of a Scanners in a simple +# Ruby object that can be send to an Encoder later: +# +# tokens = CodeRay.scan('price = 2.59', :ruby).tokens +# tokens.encode(:html) +# tokens.html +# CodeRay.encoder(:html).encode_tokens(tokens) +# +# Tokens gives you the power to handle pre-scanned code very easily: +# You can serialize it to a JSON string and store it in a database, pass it +# around to encode it more than once, send it to other algorithms... +# +# source://coderay//lib/coderay/tokens.rb#41 +class CodeRay::Tokens < ::Array + # source://coderay//lib/coderay/tokens.rb#156 + def begin_group(kind); end + + # source://coderay//lib/coderay/tokens.rb#158 + def begin_line(kind); end + + # Return the actual number of tokens. + # + # source://coderay//lib/coderay/tokens.rb#151 + def count; end + + # Encode the tokens using encoder. + # + # encoder can be + # * a plugin name like :html oder 'statistic' + # * an Encoder object + # + # options are passed to the encoder. + # + # source://coderay//lib/coderay/tokens.rb#56 + def encode(encoder, options = T.unsafe(nil)); end + + # source://coderay//lib/coderay/tokens.rb#157 + def end_group(kind); end + + # source://coderay//lib/coderay/tokens.rb#159 + def end_line(kind); end + + # Redirects unknown methods to encoder calls. + # + # For example, if you call +tokens.html+, the HTML encoder + # is used to highlight the tokens. + # + # source://coderay//lib/coderay/tokens.rb#70 + def method_missing(meth, options = T.unsafe(nil)); end + + # The Scanner instance that created the tokens. + # + # source://coderay//lib/coderay/tokens.rb#47 + def scanner; end + + # The Scanner instance that created the tokens. + # + # source://coderay//lib/coderay/tokens.rb#47 + def scanner=(_arg0); end + + # Split the tokens into parts of the given +sizes+. + # + # The result will be an Array of Tokens objects. The parts have + # the text size specified by the parameter. In addition, each + # part closes all opened tokens. This is useful to insert tokens + # betweem them. + # + # This method is used by @Scanner#tokenize@ when called with an Array + # of source strings. The Diff encoder uses it for inline highlighting. + # + # source://coderay//lib/coderay/tokens.rb#85 + def split_into_parts(*sizes); end + + # source://coderay//lib/coderay/tokens.rb#155 + def text_token(*_arg0); end + + # Turn tokens into a string by concatenating them. + # + # source://coderay//lib/coderay/tokens.rb#62 + def to_s; end + + # source://coderay//lib/coderay/tokens.rb#160 + def tokens(*_arg0); end +end + +# The result of a scan operation is a TokensProxy, but should act like Tokens. +# +# This proxy makes it possible to use the classic CodeRay.scan.encode API +# while still providing the benefits of direct streaming. +# +# source://coderay//lib/coderay/tokens_proxy.rb#7 +class CodeRay::TokensProxy + # Create a new TokensProxy with the arguments of CodeRay.scan. + # + # @return [TokensProxy] a new instance of TokensProxy + # + # source://coderay//lib/coderay/tokens_proxy.rb#12 + def initialize(input, lang, options = T.unsafe(nil), block = T.unsafe(nil)); end + + # Returns the value of attribute block. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def block; end + + # Sets the attribute block + # + # @param value the value to set the attribute block to. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def block=(_arg0); end + + # Overwrite Struct#each. + # + # source://coderay//lib/coderay/tokens_proxy.rb#48 + def each(*args, &blk); end + + # Call CodeRay.encode if +encoder+ is a Symbol; + # otherwise, convert the receiver to tokens and call encoder.encode_tokens. + # + # source://coderay//lib/coderay/tokens_proxy.rb#21 + def encode(encoder, options = T.unsafe(nil)); end + + # Returns the value of attribute input. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def input; end + + # Sets the attribute input + # + # @param value the value to set the attribute input to. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def input=(_arg0); end + + # Returns the value of attribute lang. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def lang; end + + # Sets the attribute lang + # + # @param value the value to set the attribute lang to. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def lang=(_arg0); end + + # Tries to call encode; + # delegates to tokens otherwise. + # + # source://coderay//lib/coderay/tokens_proxy.rb#31 + def method_missing(method, *args, &blk); end + + # Returns the value of attribute options. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def options; end + + # Sets the attribute options + # + # @param value the value to set the attribute options to. + # + # source://coderay//lib/coderay/tokens_proxy.rb#9 + def options=(_arg0); end + + # A (cached) scanner instance to use for the scan task. + # + # source://coderay//lib/coderay/tokens_proxy.rb#43 + def scanner; end + + # The (cached) result of the tokenized input; a Tokens instance. + # + # source://coderay//lib/coderay/tokens_proxy.rb#38 + def tokens; end +end + +# source://coderay//lib/coderay/version.rb#2 +CodeRay::VERSION = T.let(T.unsafe(nil), String) + +# = WordList +# +# A Hash subclass designed for mapping word lists to token types. +# +# A WordList is a Hash with some additional features. +# It is intended to be used for keyword recognition. +# +# WordList is optimized to be used in Scanners, +# typically to decide whether a given ident is a special token. +# +# For case insensitive words use WordList::CaseIgnoring. +# +# Example: +# +# # define word arrays +# RESERVED_WORDS = %w[ +# asm break case continue default do else +# ] +# +# PREDEFINED_TYPES = %w[ +# int long short char void +# ] +# +# # make a WordList +# IDENT_KIND = WordList.new(:ident). +# add(RESERVED_WORDS, :reserved). +# add(PREDEFINED_TYPES, :predefined_type) +# +# ... +# +# def scan_tokens tokens, options +# ... +# +# elsif scan(/[A-Za-z_][A-Za-z_0-9]*/) +# # use it +# kind = IDENT_KIND[match] +# ... +# +# source://coderay//lib/coderay/helpers/word_list.rb#40 +class CodeRay::WordList < ::Hash + # Create a new WordList with +default+ as default value. + # + # @return [WordList] a new instance of WordList + # + # source://coderay//lib/coderay/helpers/word_list.rb#43 + def initialize(default = T.unsafe(nil)); end + + # Add words to the list and associate them with +value+. + # + # Returns +self+, so you can concat add calls. + # + # source://coderay//lib/coderay/helpers/word_list.rb#50 + def add(words, value = T.unsafe(nil)); end +end + +# A CaseIgnoring WordList is like a WordList, only that +# keys are compared case-insensitively (normalizing keys using +downcase+). +# +# source://coderay//lib/coderay/helpers/word_list.rb#60 +class CodeRay::WordList::CaseIgnoring < ::CodeRay::WordList + # source://coderay//lib/coderay/helpers/word_list.rb#62 + def [](key); end + + # source://coderay//lib/coderay/helpers/word_list.rb#66 + def []=(key, value); end +end diff --git a/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi b/sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi similarity index 84% rename from sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi rename to sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi index 95425bc..98fdf89 100644 --- a/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +++ b/sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi @@ -4,13 +4,13 @@ # This is an autogenerated file for types exported from the `concurrent-ruby` gem. # Please instead update this file by running `bin/tapioca gem concurrent-ruby`. + # {include:file:README.md} # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/constants.rb#1 module Concurrent extend ::Concurrent::Utility::EngineDetector extend ::Concurrent::Utility::NativeExtensionLoader - extend ::Logger::Severity extend ::Concurrent::Concern::Logging extend ::Concurrent::Concern::Deprecation @@ -93,7 +93,15 @@ module Concurrent # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#144 def leave_transaction; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/monotonic_time.rb#19 + # Returns the current time as tracked by the application monotonic clock. + # + # @param unit [Symbol] the time unit to be returned, can be either + # :float_second, :float_millisecond, :float_microsecond, :second, + # :millisecond, :microsecond, or :nanosecond default to :float_second. + # @return [Float] The current monotonic time since some unspecified + # starting point + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/monotonic_time.rb#15 def monotonic_time(unit = T.unsafe(nil)); end class << self @@ -101,7 +109,7 @@ module Concurrent # # @raise [Transaction::AbortError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#139 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#148 def abort_transaction; end # Run a block that reads and writes `TVar`s as a single atomic transaction. @@ -136,23 +144,61 @@ module Concurrent # end # @raise [ArgumentError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#82 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#148 def atomically; end + # Number of processors cores available for process scheduling. + # This method takes in account the CPU quota if the process is inside a cgroup with a + # dedicated CPU quota (typically Docker). + # Otherwise it returns the same value as #processor_count but as a Float. + # + # For performance reasons the calculated value will be memoized on the first + # call. + # + # @return [Float] number of available processors + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#194 + def available_processor_count; end + # @raise [ArgumentError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#56 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#80 def call_dataflow(method, executor, *inputs, &block); end - # @return [Logger] Logger with provided level and output. + # The maximum number of processors cores available for process scheduling. + # Returns `nil` if there is no enforced limit, or a `Float` if the + # process is inside a cgroup with a dedicated CPU quota (typically Docker). + # + # Note that nothing prevents setting a CPU quota higher than the actual number of + # cores on the system. + # + # For performance reasons the calculated value will be memoized on the first + # call. + # + # @return [nil, Float] Maximum number of available processors as set by a cgroup CPU quota, or nil if none set + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#209 + def cpu_quota; end + + # The CPU shares requested by the process. For performance reasons the calculated + # value will be memoized on the first call. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#20 + # @return [Float, nil] CPU shares requested by the process, or nil if not set + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#217 + def cpu_shares; end + + # Create a simple logger with provided level and output. + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#38 def create_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end + # Create a stdlib logger with provided level and output. + # If you use this deprecated method you might need to add logger to your Gemfile to avoid warnings from Ruby 3.3.5+. + # # @deprecated - # @return [Logger] Logger with provided level and output. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#52 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#73 def create_stdlib_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end # Dataflow allows you to create a task that will be scheduled when all of its data dependencies are available. @@ -166,16 +212,16 @@ module Concurrent # @yieldparam inputs [Future] each of the `Future` inputs to the dataflow # @yieldreturn [Object] the result of the block operation # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#34 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#37 def dataflow(*inputs, &block); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#44 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#47 def dataflow!(*inputs, &block); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#39 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#42 def dataflow_with(executor, *inputs, &block); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#49 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/dataflow.rb#52 def dataflow_with!(executor, *inputs, &block); end # Disables AtExit handlers including pool auto-termination handlers. @@ -193,7 +239,7 @@ module Concurrent # from within a gem. It should *only* be used from within the main # application and even then it should be used only when necessary. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#131 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#48 def disable_at_exit_handlers!; end # General access point to global executors. @@ -204,74 +250,119 @@ module Concurrent # - :immediate - {Concurrent.global_immediate_executor} # @return [Executor] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#166 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#83 def executor(executor_identifier); end # Global thread pool optimized for short, fast *operations*. # # @return [ThreadPoolExecutor] the thread pool # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#138 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#55 def global_fast_executor; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#149 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#66 def global_immediate_executor; end # Global thread pool optimized for long, blocking (IO) *tasks*. # # @return [ThreadPoolExecutor] the thread pool # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#145 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#62 def global_io_executor; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#92 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#114 def global_logger; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#96 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#118 def global_logger=(value); end # Global thread pool user for global *timers*. # # @return [Concurrent::TimerSet] the thread pool # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#156 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#73 def global_timer_set; end # Leave a transaction without committing or aborting - see `Concurrent::atomically`. # # @raise [Transaction::LeaveError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#144 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#148 def leave_transaction; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/monotonic_time.rb#19 + # Returns the current time as tracked by the application monotonic clock. + # + # @param unit [Symbol] the time unit to be returned, can be either + # :float_second, :float_millisecond, :float_microsecond, :second, + # :millisecond, :microsecond, or :nanosecond default to :float_second. + # @return [Float] The current monotonic time since some unspecified + # starting point + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/monotonic_time.rb#18 def monotonic_time(unit = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#170 + # @return [Boolean] + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb#7 + def mutex_owned_per_thread?; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#87 def new_fast_executor(opts = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#181 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#98 def new_io_executor(opts = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#127 + # Number of physical processor cores on the current system. For performance + # reasons the calculated value will be memoized on the first call. + # + # On Windows the Win32 API will be queried for the `NumberOfCores from + # Win32_Processor`. This will return the total number "of cores for the + # current instance of the processor." On Unix-like operating systems either + # the `hwprefs` or `sysctl` utility will be called in a subshell and the + # returned value will be used. In the rare case where none of these methods + # work or an exception is raised the function will simply return 1. + # + # @return [Integer] number physical processor cores on the current system + # @see http://linux.die.net/man/8/sysctl + # @see http://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx + # @see http://www.unix.com/man-page/osx/1/HWPREFS/ + # @see https://github.com/grosser/parallel/blob/4fc8b89d08c7091fe0419ca8fba1ec3ce5a8d185/lib/parallel.rb + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#181 def physical_processor_count; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#123 + # Number of processors seen by the OS and used for process scheduling. For + # performance reasons the calculated value will be memoized on the first + # call. + # + # When running under JRuby the Java runtime call + # `java.lang.Runtime.getRuntime.availableProcessors` will be used. According + # to the Java documentation this "value may change during a particular + # invocation of the virtual machine... [applications] should therefore + # occasionally poll this property." We still memoize this value once under + # JRuby. + # + # Otherwise Ruby's Etc.nprocessors will be used. + # + # @return [Integer] number of processors seen by the OS or Java runtime + # @see http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#availableProcessors() + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#160 def processor_count; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#121 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#142 def processor_counter; end # Use logger created by #create_simple_logger to log concurrent-ruby messages. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#46 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#66 def use_simple_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end # Use logger created by #create_stdlib_logger to log concurrent-ruby messages. # # @deprecated # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#79 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#101 def use_stdlib_logger(level = T.unsafe(nil), output = T.unsafe(nil)); end end end @@ -297,8 +388,8 @@ class Concurrent::AbstractExchanger < ::Concurrent::Synchronization::Object # signifies timeout. When `nil` is a valid value in the exchange consider # using {#exchange!} or {#try_exchange} instead. # - # @param value [Object] the value to exchange with another thread # @param timeout [Numeric, nil] in seconds, `nil` blocks indefinitely + # @param value [Object] the value to exchange with another thread # @return [Object] the value exchanged by the other thread or `nil` on timeout # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#69 @@ -314,8 +405,8 @@ class Concurrent::AbstractExchanger < ::Concurrent::Synchronization::Object # # On timeout a {Concurrent::TimeoutError} exception will be raised. # - # @param value [Object] the value to exchange with another thread # @param timeout [Numeric, nil] in seconds, `nil` blocks indefinitely + # @param value [Object] the value to exchange with another thread # @raise [Concurrent::TimeoutError] on timeout # @return [Object] the value exchanged by the other thread # @@ -344,8 +435,8 @@ class Concurrent::AbstractExchanger < ::Concurrent::Synchronization::Object # else # puts 'timeout' # end - # @param value [Object] the value to exchange with another thread # @param timeout [Numeric, nil] in seconds, `nil` blocks indefinitely + # @param value [Object] the value to exchange with another thread # @return [Concurrent::Maybe] on success a `Just` maybe will be returned with # the item exchanged by the other thread as `#value`; on timeout a # `Nothing` maybe will be returned with {Concurrent::TimeoutError} as `#reason` @@ -362,8 +453,8 @@ class Concurrent::AbstractExchanger < ::Concurrent::Synchronization::Object # for the exchange. When the timeout value is `nil` the method will # block indefinitely. # - # @param value [Object] the value to exchange with another thread # @param timeout [Numeric, nil] in seconds, `nil` blocks indefinitely + # @param value [Object] the value to exchange with another thread # @raise [NotImplementedError] # @return [Object, CANCEL] the value exchanged by the other thread; {CANCEL} on timeout # @@ -376,7 +467,6 @@ Concurrent::AbstractExchanger::CANCEL = T.let(T.unsafe(nil), Object) # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#10 class Concurrent::AbstractExecutorService < ::Concurrent::Synchronization::LockableObject - include ::Logger::Severity include ::Concurrent::Concern::Logging include ::Concurrent::ExecutorService include ::Concurrent::Concern::Deprecation @@ -388,32 +478,19 @@ class Concurrent::AbstractExecutorService < ::Concurrent::Synchronization::Locka # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#23 def initialize(opts = T.unsafe(nil), &block); end - # Set the auto-terminate behavior for this executor. - # - # @deprecated Has no effect - # @param value [Boolean] The new auto-terminate value to set for this executor. - # @return [Boolean] `true` when auto-termination is enabled else `false`. - # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#72 def auto_terminate=(value); end - # Is the executor auto-terminate when the application exits? - # - # @return [Boolean] `true` when auto-termination is enabled else `false`. + # @return [Boolean] # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#67 def auto_terminate?; end - # @return [Symbol] The fallback policy in effect. Either `:abort`, `:discard`, or `:caller_runs`. + # Returns the value of attribute fallback_policy. # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#18 def fallback_policy; end - # Begin an immediate shutdown. In-progress tasks will be allowed to - # complete but enqueued tasks will be dismissed and no new tasks - # will be accepted. Has no additional effect if the thread pool is - # not running. - # # @raise [NotImplementedError] # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#42 @@ -424,32 +501,22 @@ class Concurrent::AbstractExecutorService < ::Concurrent::Synchronization::Locka # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#20 def name; end - # Is the executor running? - # - # @return [Boolean] `true` when running, `false` when shutting down or shutdown + # @return [Boolean] # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#52 def running?; end - # Begin an orderly shutdown. Tasks already in the queue will be executed, - # but no new tasks will be accepted. Has no additional effect if the - # thread pool is not running. - # # @raise [NotImplementedError] # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#37 def shutdown; end - # Is the executor shutdown? - # - # @return [Boolean] `true` when shutdown, `false` when shutting down or running + # @return [Boolean] # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#62 def shutdown?; end - # Is the executor shuttingdown? - # - # @return [Boolean] `true` when not running and not shutdown, else `false` + # @return [Boolean] # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#57 def shuttingdown?; end @@ -457,14 +524,7 @@ class Concurrent::AbstractExecutorService < ::Concurrent::Synchronization::Locka # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#32 def to_s; end - # Block until executor shutdown is complete or until `timeout` seconds have - # passed. - # - # @note Does not initiate shutdown or termination. Either `shutdown` or `kill` - # must be called before this method (or on another thread). - # @param timeout [Integer] the maximum number of seconds to wait for shutdown to complete # @raise [NotImplementedError] - # @return [Boolean] `true` if shutdown complete or false on `timeout` # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#47 def wait_for_termination(timeout = T.unsafe(nil)); end @@ -508,114 +568,83 @@ end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb#15 Concurrent::AbstractExecutorService::FALLBACK_POLICIES = T.let(T.unsafe(nil), Array) -# A `ThreadLocalVar` is a variable where the value is different for each thread. -# Each variable may have a default value, but when you modify the variable only -# the current thread will ever see that change. -# +# An abstract implementation of local storage, with sub-classes for +# per-thread and per-fiber locals. # -# ## Thread-safe Variable Classes -# -# Each of the thread-safe variable classes is designed to solve a different -# problem. In general: -# -# * *{Concurrent::Agent}:* Shared, mutable variable providing independent, -# uncoordinated, *asynchronous* change of individual values. Best used when -# the value will undergo frequent, complex updates. Suitable when the result -# of an update does not need to be known immediately. -# * *{Concurrent::Atom}:* Shared, mutable variable providing independent, -# uncoordinated, *synchronous* change of individual values. Best used when -# the value will undergo frequent reads but only occasional, though complex, -# updates. Suitable when the result of an update must be known immediately. -# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated -# atomically. Updates are synchronous but fast. Best used when updates a -# simple set operations. Not suitable when updates are complex. -# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar -# but optimized for the given data type. -# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used -# when two or more threads need to exchange data. The threads will pair then -# block on each other until the exchange is complete. -# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread -# must give a value to another, which must take the value. The threads will -# block on each other until the exchange is complete. -# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which -# holds a different value for each thread which has access. Often used as -# an instance variable in objects which must maintain different state -# for different threads. -# * *{Concurrent::TVar}:* Shared, mutable variables which provide -# *coordinated*, *synchronous*, change of *many* stated. Used when multiple -# value must change together, in an all-or-nothing transaction. +# Each execution context (EC, thread or fiber) has a lazily initialized array +# of local variable values. Each time a new local variable is created, we +# allocate an "index" for it. # -# @example -# v = ThreadLocalVar.new(14) -# v.value #=> 14 -# v.value = 2 -# v.value #=> 2 -# @example -# v = ThreadLocalVar.new(14) +# For example, if the allocated index is 1, that means slot #1 in EVERY EC's +# locals array will be used for the value of that variable. # -# t1 = Thread.new do -# v.value #=> 14 -# v.value = 1 -# v.value #=> 1 -# end +# The good thing about using a per-EC structure to hold values, rather than +# a global, is that no synchronization is needed when reading and writing +# those values (since the structure is only ever accessed by a single +# thread). # -# t2 = Thread.new do -# v.value #=> 14 -# v.value = 2 -# v.value #=> 2 -# end +# Of course, when a local variable is GC'd, 1) we need to recover its index +# for use by other new local variables (otherwise the locals arrays could +# get bigger and bigger with time), and 2) we need to null out all the +# references held in the now-unused slots (both to avoid blocking GC of those +# objects, and also to prevent "stale" values from being passed on to a new +# local when the index is reused). # -# v.value #=> 14 -# @see https://docs.oracle.com/javase/7/docs/api/java/lang/ThreadLocal.html Java ThreadLocal +# Because we need to null out freed slots, we need to keep references to +# ALL the locals arrays, so we can null out the appropriate slots in all of +# them. This is why we need to use a finalizer to clean up the locals array +# when the EC goes out of scope. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/abstract_thread_local_var.rb#8 -class Concurrent::AbstractThreadLocalVar - # Creates a thread local variable. - # - # @param default [Object] the default value when otherwise unset - # @param default_block [Proc] Optional block that gets called to obtain the - # default value for each thread - # @return [AbstractThreadLocalVar] a new instance of AbstractThreadLocalVar +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#35 +class Concurrent::AbstractLocals + # @return [AbstractLocals] a new instance of AbstractLocals # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/abstract_thread_local_var.rb#11 - def initialize(default = T.unsafe(nil), &default_block); end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#36 + def initialize; end - # Bind the given value to thread local storage during - # execution of the given block. - # - # @param value [Object] the value to bind - # @return [Object] the value - # @yield the operation to be performed with the bound variable + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#89 + def fetch(index); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#71 + def free_index(index); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#55 + def next_index(local); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#102 + def set(index, value); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#43 + def synchronize; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#48 + def weak_synchronize; end + + private + + # When the local goes out of scope, clean up that slot across all locals currently assigned. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/abstract_thread_local_var.rb#38 - def bind(value, &block); end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#112 + def local_finalizer(index); end - # Returns the value in the current thread's copy of this thread-local variable. + # Returns the locals for the current scope, or nil if none exist. # # @raise [NotImplementedError] - # @return [Object] the current value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/abstract_thread_local_var.rb#28 - def value; end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#128 + def locals; end - # Sets the current thread's copy of this thread-local variable to the specified value. + # Returns the locals for the current scope, creating them if necessary. # - # @param value [Object] the value to set # @raise [NotImplementedError] - # @return [Object] the new value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/abstract_thread_local_var.rb#33 - def value=(value); end - - protected + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#133 + def locals!; end - # @raise [NotImplementedError] + # When a thread/fiber goes out of scope, remove the array from @all_arrays. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/abstract_thread_local_var.rb#53 - def allocate_storage; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/abstract_thread_local_var.rb#58 - def default; end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#119 + def thread_fiber_finalizer(array_object_id); end end # `Agent` is inspired by Clojure's [agent](http://clojure.org/agents) @@ -747,42 +776,10 @@ end # Calling either {#await} or {#wait} (with a timeout of `nil`) will # hopelessly deadlock the Agent with no possibility of recovery. # -# ## Thread-safe Variable Classes -# -# Each of the thread-safe variable classes is designed to solve a different -# problem. In general: -# -# * *{Concurrent::Agent}:* Shared, mutable variable providing independent, -# uncoordinated, *asynchronous* change of individual values. Best used when -# the value will undergo frequent, complex updates. Suitable when the result -# of an update does not need to be known immediately. -# * *{Concurrent::Atom}:* Shared, mutable variable providing independent, -# uncoordinated, *synchronous* change of individual values. Best used when -# the value will undergo frequent reads but only occasional, though complex, -# updates. Suitable when the result of an update must be known immediately. -# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated -# atomically. Updates are synchronous but fast. Best used when updates a -# simple set operations. Not suitable when updates are complex. -# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar -# but optimized for the given data type. -# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used -# when two or more threads need to exchange data. The threads will pair then -# block on each other until the exchange is complete. -# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread -# must give a value to another, which must take the value. The threads will -# block on each other until the exchange is complete. -# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which -# holds a different value for each thread which has access. Often used as -# an instance variable in objects which must maintain different state -# for different threads. -# * *{Concurrent::TVar}:* Shared, mutable variables which provide -# *coordinated*, *synchronous*, change of *many* stated. Used when multiple -# value must change together, in an all-or-nothing transaction. -# # @see http://clojure.org/Agents Clojure Agents # @see http://clojure.org/state Values and Change - Clojure's approach to Identity and State # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#144 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#145 class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject include ::Concurrent::Concern::Observable @@ -821,7 +818,7 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # @param opts [Hash] the configuration options # @return [Agent] a new instance of Agent # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#219 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#220 def initialize(initial, opts = T.unsafe(nil)); end # Dispatches an action to the Agent and returns immediately. Subsequently, @@ -832,7 +829,7 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # @return [Concurrent::Agent] self # @see #send_off # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#330 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#331 def <<(action); end # Blocks the current thread (indefinitely!) until all actions dispatched @@ -855,7 +852,7 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # # @return [Boolean] self # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#349 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#350 def await; end # Blocks the current thread until all actions dispatched thus far, from this @@ -872,7 +869,7 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # @param timeout [Float] the maximum number of seconds to wait # @return [Boolean] true if all actions complete before timeout else false # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#362 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#363 def await_for(timeout); end # Blocks the current thread until all actions dispatched thus far, from this @@ -887,10 +884,10 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # hopelessly deadlock the Agent with no possibility of recovery. # # @param timeout [Float] the maximum number of seconds to wait - # @raise [Concurrent::TimeoutError] when timout is reached + # @raise [Concurrent::TimeoutError] when timeout is reached # @return [Boolean] true if all actions complete before timeout # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#376 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#377 def await_for!(timeout); end # The current value (state) of the Agent, irrespective of any pending or @@ -898,7 +895,7 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # # @return [Object] the current value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#228 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#233 def deref; end # When {#failed?} and {#error_mode} is `:fail`, returns the error object @@ -907,12 +904,12 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # # @return [nil, Error] the error which caused the failure when {#failed?} # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#239 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#240 def error; end # The error mode this Agent is operating in. See {#initialize} for details. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#183 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#184 def error_mode; end # Is the Agent in a failed state? @@ -920,7 +917,7 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # @return [Boolean] # @see #restart # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#401 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#402 def failed?; end # Dispatches an action to the Agent and returns immediately. Subsequently, @@ -940,18 +937,18 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # * {#send_via} and {#send_via!} are used when a specific executor is to # be used for the action # + # @param action [Proc] the action dispatch to be enqueued # @param args [Array] zero or more arguments to be passed to # the action - # @param action [Proc] the action dispatch to be enqueued # @return [Boolean] true if the action is successfully enqueued, false if # the Agent is {#failed?} # @yield [agent, value, *args] process the old value and return the new - # @yieldparam value [Object] the current {#value} of the Agent # @yieldparam args [Array] zero or more arguments to pass to the # action + # @yieldparam value [Object] the current {#value} of the Agent # @yieldreturn [Object] the new value of the Agent # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#293 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#298 def post(*args, &action); end # When {#failed?} and {#error_mode} is `:fail`, returns the error object @@ -960,7 +957,7 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # # @return [nil, Error] the error which caused the failure when {#failed?} # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#239 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#244 def reason; end # When an Agent is {#failed?}, changes the Agent {#value} to `new_value` @@ -978,7 +975,7 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # @raise [Concurrent:AgentError] when not failed # @return [Boolean] true # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#423 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#424 def restart(new_value, opts = T.unsafe(nil)); end # Dispatches an action to the Agent and returns immediately. Subsequently, @@ -998,18 +995,18 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # * {#send_via} and {#send_via!} are used when a specific executor is to # be used for the action # + # @param action [Proc] the action dispatch to be enqueued # @param args [Array] zero or more arguments to be passed to # the action - # @param action [Proc] the action dispatch to be enqueued # @return [Boolean] true if the action is successfully enqueued, false if # the Agent is {#failed?} # @yield [agent, value, *args] process the old value and return the new - # @yieldparam value [Object] the current {#value} of the Agent # @yieldparam args [Array] zero or more arguments to pass to the # action + # @yieldparam value [Object] the current {#value} of the Agent # @yieldreturn [Object] the new value of the Agent # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#277 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#278 def send(*args, &action); end # Dispatches an action to the Agent and returns immediately. Subsequently, @@ -1029,18 +1026,18 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # * {#send_via} and {#send_via!} are used when a specific executor is to # be used for the action # + # @param action [Proc] the action dispatch to be enqueued # @param args [Array] zero or more arguments to be passed to # the action - # @param action [Proc] the action dispatch to be enqueued # @raise [Concurrent::Agent::Error] if the Agent is {#failed?} # @return [Boolean] true if the action is successfully enqueued # @yield [agent, value, *args] process the old value and return the new - # @yieldparam value [Object] the current {#value} of the Agent # @yieldparam args [Array] zero or more arguments to pass to the # action + # @yieldparam value [Object] the current {#value} of the Agent # @yieldreturn [Object] the new value of the Agent # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#286 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#287 def send!(*args, &action); end # Dispatches an action to the Agent and returns immediately. Subsequently, @@ -1060,18 +1057,18 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # * {#send_via} and {#send_via!} are used when a specific executor is to # be used for the action # + # @param action [Proc] the action dispatch to be enqueued # @param args [Array] zero or more arguments to be passed to # the action - # @param action [Proc] the action dispatch to be enqueued # @return [Boolean] true if the action is successfully enqueued, false if # the Agent is {#failed?} # @yield [agent, value, *args] process the old value and return the new - # @yieldparam value [Object] the current {#value} of the Agent # @yieldparam args [Array] zero or more arguments to pass to the # action + # @yieldparam value [Object] the current {#value} of the Agent # @yieldreturn [Object] the new value of the Agent # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#293 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#294 def send_off(*args, &action); end # Dispatches an action to the Agent and returns immediately. Subsequently, @@ -1091,18 +1088,18 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # * {#send_via} and {#send_via!} are used when a specific executor is to # be used for the action # + # @param action [Proc] the action dispatch to be enqueued # @param args [Array] zero or more arguments to be passed to # the action - # @param action [Proc] the action dispatch to be enqueued # @raise [Concurrent::Agent::Error] if the Agent is {#failed?} # @return [Boolean] true if the action is successfully enqueued # @yield [agent, value, *args] process the old value and return the new - # @yieldparam value [Object] the current {#value} of the Agent # @yieldparam args [Array] zero or more arguments to pass to the # action + # @yieldparam value [Object] the current {#value} of the Agent # @yieldreturn [Object] the new value of the Agent # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#301 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#302 def send_off!(*args, &action); end # Dispatches an action to the Agent and returns immediately. Subsequently, @@ -1122,20 +1119,20 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # * {#send_via} and {#send_via!} are used when a specific executor is to # be used for the action # + # @param action [Proc] the action dispatch to be enqueued # @param args [Array] zero or more arguments to be passed to # the action - # @param action [Proc] the action dispatch to be enqueued # @param executor [Concurrent::ExecutorService] the executor on which the # action is to be dispatched # @return [Boolean] true if the action is successfully enqueued, false if # the Agent is {#failed?} # @yield [agent, value, *args] process the old value and return the new - # @yieldparam value [Object] the current {#value} of the Agent # @yieldparam args [Array] zero or more arguments to pass to the # action + # @yieldparam value [Object] the current {#value} of the Agent # @yieldreturn [Object] the new value of the Agent # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#310 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#311 def send_via(executor, *args, &action); end # Dispatches an action to the Agent and returns immediately. Subsequently, @@ -1155,20 +1152,20 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # * {#send_via} and {#send_via!} are used when a specific executor is to # be used for the action # + # @param action [Proc] the action dispatch to be enqueued # @param args [Array] zero or more arguments to be passed to # the action - # @param action [Proc] the action dispatch to be enqueued # @param executor [Concurrent::ExecutorService] the executor on which the # action is to be dispatched # @raise [Concurrent::Agent::Error] if the Agent is {#failed?} # @return [Boolean] true if the action is successfully enqueued # @yield [agent, value, *args] process the old value and return the new - # @yieldparam value [Object] the current {#value} of the Agent # @yieldparam args [Array] zero or more arguments to pass to the # action + # @yieldparam value [Object] the current {#value} of the Agent # @yieldreturn [Object] the new value of the Agent # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#318 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#319 def send_via!(executor, *args, &action); end # Is the Agent in a failed state? @@ -1176,7 +1173,7 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # @return [Boolean] # @see #restart # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#401 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#406 def stopped?; end # The current value (state) of the Agent, irrespective of any pending or @@ -1184,7 +1181,7 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # # @return [Object] the current value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#228 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#229 def value; end # Blocks the current thread until all actions dispatched thus far, from this @@ -1204,38 +1201,38 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # @param timeout [Float] the maximum number of seconds to wait # @return [Boolean] true if all actions complete before timeout else false # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#392 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#393 def wait(timeout = T.unsafe(nil)); end private # @raise [ArgumentError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#509 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#510 def enqueue_action_job(action, args, executor); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#515 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#516 def enqueue_await_job(latch); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#542 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#543 def execute_next_job; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#575 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#576 def handle_error(error); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#528 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#529 def ns_enqueue_job(job, index = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#583 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#584 def ns_find_last_job_for_thread; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#489 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#490 def ns_initialize(initial, opts); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#538 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#539 def ns_post_next_job; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#569 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#570 def ns_validate(value); end class << self @@ -1255,7 +1252,7 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # @param agents [Array] the Agents on which to wait # @return [Boolean] true # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#448 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#449 def await(*agents); end # Blocks the current thread until all actions dispatched thus far to all @@ -1269,11 +1266,11 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # Calling either {#await} or {#wait} (with a timeout of `nil`) will # hopelessly deadlock the Agent with no possibility of recovery. # - # @param timeout [Float] the maximum number of seconds to wait # @param agents [Array] the Agents on which to wait + # @param timeout [Float] the maximum number of seconds to wait # @return [Boolean] true if all actions complete before timeout else false # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#462 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#463 def await_for(timeout, *agents); end # Blocks the current thread until all actions dispatched thus far to all @@ -1287,46 +1284,48 @@ class Concurrent::Agent < ::Concurrent::Synchronization::LockableObject # Calling either {#await} or {#wait} (with a timeout of `nil`) will # hopelessly deadlock the Agent with no possibility of recovery. # - # @param timeout [Float] the maximum number of seconds to wait # @param agents [Array] the Agents on which to wait - # @raise [Concurrent::TimeoutError] when timout is reached + # @param timeout [Float] the maximum number of seconds to wait + # @raise [Concurrent::TimeoutError] when timeout is reached # @return [Boolean] true if all actions complete before timeout # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#481 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#482 def await_for!(timeout, *agents); end end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#153 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#154 Concurrent::Agent::AWAIT_ACTION = T.let(T.unsafe(nil), Proc) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#150 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#151 Concurrent::Agent::AWAIT_FLAG = T.let(T.unsafe(nil), Object) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#156 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#157 Concurrent::Agent::DEFAULT_ERROR_HANDLER = T.let(T.unsafe(nil), Proc) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#159 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#160 Concurrent::Agent::DEFAULT_VALIDATOR = T.let(T.unsafe(nil), Proc) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#147 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#148 Concurrent::Agent::ERROR_MODES = T.let(T.unsafe(nil), Array) # Raised during action processing or any other time in an Agent's lifecycle. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#166 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#167 class Concurrent::Agent::Error < ::StandardError # @return [Error] a new instance of Error # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#167 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#168 def initialize(message = T.unsafe(nil)); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#162 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 class Concurrent::Agent::Job < ::Struct # Returns the value of attribute action # # @return [Object] the current value of action + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 def action; end # Sets the attribute action @@ -1334,12 +1333,14 @@ class Concurrent::Agent::Job < ::Struct # @param value [Object] the value to set the attribute action to. # @return [Object] the newly set value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#162 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 def action=(_); end # Returns the value of attribute args # # @return [Object] the current value of args + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 def args; end # Sets the attribute args @@ -1347,12 +1348,14 @@ class Concurrent::Agent::Job < ::Struct # @param value [Object] the value to set the attribute args to. # @return [Object] the newly set value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#162 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 def args=(_); end # Returns the value of attribute caller # # @return [Object] the current value of caller + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 def caller; end # Sets the attribute caller @@ -1360,12 +1363,14 @@ class Concurrent::Agent::Job < ::Struct # @param value [Object] the value to set the attribute caller to. # @return [Object] the newly set value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#162 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 def caller=(_); end # Returns the value of attribute executor # # @return [Object] the current value of executor + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 def executor; end # Sets the attribute executor @@ -1373,13 +1378,23 @@ class Concurrent::Agent::Job < ::Struct # @param value [Object] the value to set the attribute executor to. # @return [Object] the newly set value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#162 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 def executor=(_); end class << self + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 def [](*_arg0); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 def inspect; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 + def keyword_init?; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 def members; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#163 def new(*_arg0); end end end @@ -1387,11 +1402,11 @@ end # Raised when a new value obtained during action processing or at `#restart` # fails validation. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#175 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#176 class Concurrent::Agent::ValidationError < ::Concurrent::Agent::Error # @return [ValidationError] a new instance of ValidationError # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#176 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/agent.rb#177 def initialize(message = T.unsafe(nil)); end end @@ -1407,7 +1422,7 @@ end # may be lost. Use `#concat` instead. # @see http://ruby-doc.org/core/Array.html Ruby standard library `Array` # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/array.rb#63 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/array.rb#53 class Concurrent::Array < ::Array; end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/array.rb#22 @@ -1619,9 +1634,9 @@ Concurrent::ArrayImplementation = Array # horn.await.echo('two') # synchronous, blocking, thread-safe # # returns an IVar in the :complete state # @see Concurrent::Actor -# @see https://en.wikipedia.org/wiki/Actor_model "Actor Model" at Wikipedia -# @see http://www.erlang.org/doc/man/gen_server.html Erlang gen_server # @see http://c2.com/cgi/wiki?LetItCrash "Let It Crash" at http://c2.com/ +# @see http://www.erlang.org/doc/man/gen_server.html Erlang gen_server +# @see https://en.wikipedia.org/wiki/Actor_model "Actor Model" at Wikipedia # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#217 module Concurrent::Async @@ -1684,7 +1699,7 @@ module Concurrent::Async # requested method # @return [Concurrent::IVar] the completed result of the synchronous operation # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#430 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#433 def call; end # Causes the chained method call to be performed asynchronously on the @@ -1704,7 +1719,7 @@ module Concurrent::Async # the requested method # @return [Concurrent::IVar] the pending result of the asynchronous operation # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#412 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#415 def cast; end # Initialize the internal serializer and other stnchronization mechanisms. @@ -1729,14 +1744,14 @@ module Concurrent::Async # if too few arguments are given but impossible to determine if too many # arguments are given. This check may also fail to recognize dynamic behavior # of the object, such as methods simulated with `method_missing`. - # @param obj [Object] the object to check against - # @param method [Symbol] the method to check the object for # @param args [Array] zero or more arguments for the arity check + # @param method [Symbol] the method to check the object for + # @param obj [Object] the object to check against # @raise [NameError] the object does not respond to `method` method # @raise [ArgumentError] the given `args` do not match the arity of `method` - # @see http://www.ruby-doc.org/core-2.1.1/Method.html#method-i-arity Method#arity # @see http://ruby-doc.org/core-2.1.0/Object.html#method-i-respond_to-3F Object#respond_to? # @see http://www.ruby-doc.org/core-2.1.0/BasicObject.html#method-i-method_missing BasicObject#method_missing + # @see http://www.ruby-doc.org/core-2.1.1/Method.html#method-i-arity Method#arity # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#250 def validate_argc(obj, method, *args); end @@ -1757,8 +1772,8 @@ class Concurrent::Async::AsyncDelegator < ::Concurrent::Synchronization::Lockabl # Delegates method calls to the wrapped object. # - # @param method [Symbol] the method being called # @param args [Array] zero or more arguments to the method + # @param method [Symbol] the method being called # @raise [NameError] the object does not respond to `method` method # @raise [ArgumentError] the given `args` do not match the arity of `method` # @return [IVar] the result of the method call @@ -1802,8 +1817,8 @@ class Concurrent::Async::AwaitDelegator # Delegates method calls to the wrapped object. # - # @param method [Symbol] the method being called # @param args [Array] zero or more arguments to the method + # @param method [Symbol] the method being called # @raise [NameError] the object does not respond to `method` method # @raise [ArgumentError] the given `args` do not match the arity of `method` # @return [IVar] the result of the method call @@ -1825,7 +1840,7 @@ end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#269 module Concurrent::Async::ClassMethods # source://concurrent-ruby//lib/concurrent-ruby/concurrent/async.rb#270 - def new(*args, &block); end + def new(*args, **_arg1, &block); end end # Atoms provide a way to manage shared, synchronous, independent state. @@ -1915,19 +1930,20 @@ end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#95 class Concurrent::Atom < ::Concurrent::Synchronization::Object include ::Concurrent::Concern::Observable + extend ::Concurrent::Synchronization::SafeInitialization # Create a new atom with the given initial value. # # @option opts - # @param value [Object] The initial value # @param opts [Hash] The options used to configure the atom + # @param value [Object] The initial value # @raise [ArgumentError] if the validator is not a `Proc` (when given) # @return [Atom] a new instance of Atom # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#121 def initialize(value, opts = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#169 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#99 def __initialize_atomic_fields__; end # Atomically sets the value of atom to the new value if and only if the @@ -1935,14 +1951,14 @@ class Concurrent::Atom < ::Concurrent::Synchronization::Object # value successfully validates against the (optional) validator given # at construction. # - # @param old_value [Object] The expected current value. # @param new_value [Object] The intended new value. + # @param old_value [Object] The expected current value. # @return [Boolean] True if the value is changed else false. # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#181 def compare_and_set(old_value, new_value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#125 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#102 def deref; end # Atomically sets the value of atom to the new value without regard for the @@ -1978,8 +1994,8 @@ class Concurrent::Atom < ::Concurrent::Synchronization::Object # validations are complete. # @yield [value, args] Calculates a new value for the atom based on the # current value and any supplied arguments. - # @yieldparam value [Object] The current value of the atom. # @yieldparam args [Object] All arguments passed to the function, in order. + # @yieldparam value [Object] The current value of the atom. # @yieldreturn [Object] The intended new value of the atom. # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#157 @@ -1989,18 +2005,18 @@ class Concurrent::Atom < ::Concurrent::Synchronization::Object # # @return [Object] The current value. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#125 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#99 def value; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#137 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#99 def compare_and_set_value(expected, value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#133 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#99 def swap_value(value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#141 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#99 def update_value(&block); end # Is the new value valid? @@ -2012,13 +2028,8 @@ class Concurrent::Atom < ::Concurrent::Synchronization::Object # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#216 def valid?(new_value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#129 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atom.rb#99 def value=(value); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 - def new(*args, &block); end - end end # A boolean value that can be updated atomically. Reads and writes to an atomic @@ -2079,63 +2090,29 @@ end class Concurrent::AtomicBoolean < ::Concurrent::MutexAtomicBoolean # @return [String] Short string representation. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb#120 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb#125 def inspect; end # @return [String] Short string representation. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb#120 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb#121 def to_s; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb#81 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb#82 Concurrent::AtomicBooleanImplementation = Concurrent::MutexAtomicBoolean # Define update methods that use direct paths # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#19 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb#9 module Concurrent::AtomicDirectUpdate - # Pass the current value to the given block, replacing it - # with the block's result. Return nil if the update fails. - # - # @note This method was altered to avoid raising an exception by default. - # Instead, this method now returns `nil` in case of failure. For more info, - # please see: https://github.com/ruby-concurrency/concurrent-ruby/pull/336 - # @return [Object] the new value, or nil if update failed - # @yield [Object] Calculate a new value for the atomic reference using - # given (old) value - # @yieldparam old_value [Object] the starting value of the atomic reference - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#48 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb#15 def try_update; end - # Pass the current value to the given block, replacing it - # with the block's result. Raise an exception if the update - # fails. - # - # @note This behavior mimics the behavior of the original - # `AtomicReference#try_update` API. The reason this was changed was to - # avoid raising exceptions (which are inherently slow) by default. For more - # info: https://github.com/ruby-concurrency/concurrent-ruby/pull/336 - # @raise [Concurrent::ConcurrentUpdateError] if the update fails - # @return [Object] the new value - # @yield [Object] Calculate a new value for the atomic reference using - # given (old) value - # @yieldparam old_value [Object] the starting value of the atomic reference - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#72 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb#24 def try_update!; end - # Pass the current value to the given block, replacing it - # with the block's result. May retry if the value changes - # during the block's execution. - # - # @return [Object] the new value - # @yield [Object] Calculate a new value for the atomic reference using - # given (old) value - # @yieldparam old_value [Object] the starting value of the atomic reference - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb#10 def update; end end @@ -2197,16 +2174,16 @@ end class Concurrent::AtomicFixnum < ::Concurrent::MutexAtomicFixnum # @return [String] Short string representation. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb#137 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb#142 def inspect; end # @return [String] Short string representation. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb#137 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb#138 def to_s; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb#98 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb#99 Concurrent::AtomicFixnumImplementation = Concurrent::MutexAtomicFixnum # An atomic reference which maintains an object reference along with a mark bit @@ -2214,14 +2191,16 @@ Concurrent::AtomicFixnumImplementation = Concurrent::MutexAtomicFixnum # # @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicMarkableReference.html java.util.concurrent.atomic.AtomicMarkableReference # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#7 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#10 class Concurrent::AtomicMarkableReference < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + # @return [AtomicMarkableReference] a new instance of AtomicMarkableReference # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#12 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#15 def initialize(value = T.unsafe(nil), mark = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#169 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#12 def __initialize_atomic_fields__; end # Atomically sets the value and mark to the given updated value and @@ -2232,13 +2211,13 @@ class Concurrent::AtomicMarkableReference < ::Concurrent::Synchronization::Objec # that the actual value was not equal to the expected value or the # actual mark was not equal to the expected mark # - # @param expected_val [Object] the expected value - # @param new_val [Object] the new value # @param expected_mark [Boolean] the expected mark + # @param expected_val [Object] the expected value # @param new_mark [Boolean] the new mark + # @param new_val [Object] the new value # @return [Boolean] `true` if successful. A `false` return indicates # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#30 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#33 def compare_and_set(expected_val, new_val, expected_mark, new_mark); end # Atomically sets the value and mark to the given updated value and @@ -2249,44 +2228,44 @@ class Concurrent::AtomicMarkableReference < ::Concurrent::Synchronization::Objec # that the actual value was not equal to the expected value or the # actual mark was not equal to the expected mark # - # @param expected_val [Object] the expected value - # @param new_val [Object] the new value # @param expected_mark [Boolean] the expected mark + # @param expected_val [Object] the expected value # @param new_mark [Boolean] the new mark + # @param new_val [Object] the new value # @return [Boolean] `true` if successful. A `false` return indicates # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#30 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#59 def compare_and_swap(expected_val, new_val, expected_mark, new_mark); end # Gets the current reference and marked values. # # @return [Array] the current reference and marked values # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#61 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#64 def get; end # Gets the current marked value # # @return [Boolean] the current marked value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#75 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#78 def mark; end # Gets the current marked value # # @return [Boolean] the current marked value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#75 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#82 def marked?; end # _Unconditionally_ sets to the given value of both the reference and # the mark. # - # @param new_val [Object] the new value # @param new_mark [Boolean] the new mark + # @param new_val [Object] the new value # @return [Array] both the new value and the new mark # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#88 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#91 def set(new_val, new_mark); end # Pass the current value to the given block, replacing it with the @@ -2297,10 +2276,10 @@ class Concurrent::AtomicMarkableReference < ::Concurrent::Synchronization::Objec # @return [Array] the new value and marked state, or nil if # @yield [Object] Calculate a new value and marked state for the atomic # reference using given (old) value and (old) marked - # @yieldparam old_val [Object] the starting value of the atomic reference # @yieldparam old_mark [Boolean] the starting state of marked + # @yieldparam old_val [Object] the starting value of the atomic reference # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#149 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#152 def try_update; end # Pass the current value to the given block, replacing it @@ -2311,10 +2290,10 @@ class Concurrent::AtomicMarkableReference < ::Concurrent::Synchronization::Objec # @return [Array] the new value and marked state # @yield [Object] Calculate a new value and marked state for the atomic # reference using given (old) value and (old) marked - # @yieldparam old_val [Object] the starting value of the atomic reference # @yieldparam old_mark [Boolean] the starting state of marked + # @yieldparam old_val [Object] the starting value of the atomic reference # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#125 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#128 def try_update!; end # Pass the current value and marked state to the given block, replacing it @@ -2324,69 +2303,53 @@ class Concurrent::AtomicMarkableReference < ::Concurrent::Synchronization::Objec # @return [Array] the new value and new mark # @yield [Object] Calculate a new value and marked state for the atomic # reference using given (old) value and (old) marked - # @yieldparam old_val [Object] the starting value of the atomic reference # @yieldparam old_mark [Boolean] the starting state of marked + # @yieldparam old_val [Object] the starting value of the atomic reference # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#102 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#105 def update; end # Gets the current value of the reference # # @return [Object] the current value of the reference # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#68 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#71 def value; end private - # Sets the reference to new_reference if the current reference is expected_reference - # - # @return [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#137 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#12 def compare_and_set_reference(expected, value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#160 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#163 def immutable_array(*args); end - # @return [Object] The reference. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#125 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#12 def reference; end - # Set the reference. - # - # @return [Object] new_reference. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#129 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#12 def reference=(value); end - # Set the reference to new_reference and return the old reference. - # - # @return [Object] old reference - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#133 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#12 def swap_reference(value); end - # Updates the reference using the block. - # - # @return [Object] new reference - # @yield [Object] Calculate a new reference using given (old) reference - # @yieldparam old [Object] reference - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#141 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb#12 def update_reference(&block); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 - def new(*args, &block); end - end end # Special "compare and set" handling of numeric values. # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb#7 module Concurrent::AtomicNumericCompareAndSetWrapper + # Atomically sets the value to the given updated value if + # the current value == the expected value. + # + # that the actual value was not equal to the expected value. + # + # @param new_value [Object] the new value + # @param old_value [Object] the expected value + # @return [Boolean] `true` if successful. A `false` return indicates + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb#10 def compare_and_set(old_value, new_value); end end @@ -2430,207 +2393,213 @@ end # @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicReference.html # @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/package-summary.html # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#196 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#126 class Concurrent::AtomicReference < ::Concurrent::MutexAtomicReference # @return [String] Short string representation. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#199 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#133 def inspect; end # @return [String] Short string representation. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#199 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#129 def to_s; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#148 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#18 Concurrent::AtomicReferenceImplementation = Concurrent::MutexAtomicReference # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#30 class Concurrent::CRubySet < ::Set - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#17 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def initialize(*args, &block); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def &(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def +(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def -(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def <(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def <<(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def <=(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 + def <=>(*args); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def ==(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def ===(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def >(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def >=(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def ^(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def add(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def add?(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def classify(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def clear(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def collect!(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def compare_by_identity(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def compare_by_identity?(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def delete(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def delete?(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def delete_if(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def difference(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def disjoint?(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def divide(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def each(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def empty?(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def eql?(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def filter!(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def flatten(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def flatten!(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def flatten_merge(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def freeze(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def hash(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def include?(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def inspect(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def intersect?(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def intersection(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 + def join(*args); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def keep_if(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def length(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def map!(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def member?(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def merge(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def pretty_print(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def pretty_print_cycle(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def proper_subset?(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def proper_superset?(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def reject!(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def replace(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def reset(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def select!(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def size(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def subset?(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def subtract(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def superset?(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def to_a(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def to_s(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def to_set(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def union(*args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def |(*args); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#22 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#33 def initialize_copy(other); end end @@ -2685,7 +2654,7 @@ end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#9 class Concurrent::CancelledOperationError < ::Concurrent::Error; end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#8 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#7 module Concurrent::Collection; end # A thread safe observer set implemented using copy-on-read approach: @@ -2850,7 +2819,7 @@ class Concurrent::Collection::CopyOnWriteObserverSet < ::Concurrent::Synchroniza def observers=(new_set); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#11 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#10 Concurrent::Collection::MapImplementation = Concurrent::Collection::MriMapBackend # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#10 @@ -2858,7 +2827,7 @@ class Concurrent::Collection::MriMapBackend < ::Concurrent::Collection::NonConcu # @return [MriMapBackend] a new instance of MriMapBackend # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#12 - def initialize(options = T.unsafe(nil)); end + def initialize(options = T.unsafe(nil), &default_proc); end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb#17 def []=(key, value); end @@ -2904,78 +2873,75 @@ class Concurrent::Collection::NonConcurrentMapBackend # @return [NonConcurrentMapBackend] a new instance of NonConcurrentMapBackend # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#15 - def initialize(options = T.unsafe(nil)); end + def initialize(options = T.unsafe(nil), &default_proc); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#19 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#21 def [](key); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#23 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#25 def []=(key, value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#92 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#94 def clear; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#57 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#59 def compute(key); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#27 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#29 def compute_if_absent(key); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#51 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#53 def compute_if_present(key); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#79 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#81 def delete(key); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#83 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#85 def delete_pair(key, value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#97 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#99 def each_pair; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#69 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#71 def get_and_set(key, value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#108 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#110 def get_or_default(key, default_value); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#75 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#77 def key?(key); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#61 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#63 def merge_pair(key, value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#44 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#46 def replace_if_exists(key, new_value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#35 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#37 def replace_pair(key, old_value, new_value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#104 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#106 def size; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#19 - def _get(key); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#23 - def _set(key, value); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#122 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#130 def dupped_backend; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#116 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#124 def initialize_copy(other); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#126 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#134 def pair?(key, expected_value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#130 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#116 + def set_backend(default_proc); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb#138 def store_computed_value(key, new_value); end end @@ -2999,95 +2965,179 @@ end # When running under all other interpreters it extends `RubyNonConcurrentPriorityQueue`. # # @note This implementation is *not* thread safe. -# @see http://en.wikipedia.org/wiki/Priority_queue -# @see http://ruby-doc.org/stdlib-2.0.0/libdoc/thread/rdoc/Queue.html -# @see http://algs4.cs.princeton.edu/24pq/index.php#2.6 # @see http://algs4.cs.princeton.edu/24pq/MaxPQ.java.html +# @see http://algs4.cs.princeton.edu/24pq/index.php#2.6 # @see http://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html +# @see http://en.wikipedia.org/wiki/Priority_queue +# @see http://ruby-doc.org/stdlib-2.0.0/libdoc/thread/rdoc/Queue.html # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb#50 class Concurrent::Collection::NonConcurrentPriorityQueue < ::Concurrent::Collection::RubyNonConcurrentPriorityQueue - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#78 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb#59 def <<(item); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#65 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb#56 def deq; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#78 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb#60 def enq(item); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#48 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb#52 def has_priority?(item); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#65 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb#57 def shift; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#54 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb#54 def size; end end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb#10 Concurrent::Collection::NonConcurrentPriorityQueueImplementation = Concurrent::Collection::RubyNonConcurrentPriorityQueue +# A queue collection in which the elements are sorted based on their +# comparison (spaceship) operator `<=>`. Items are added to the queue +# at a position relative to their priority. On removal the element +# with the "highest" priority is removed. By default the sort order is +# from highest to lowest, but a lowest-to-highest sort order can be +# set on construction. +# +# The API is based on the `Queue` class from the Ruby standard library. +# +# The pure Ruby implementation, `RubyNonConcurrentPriorityQueue` uses a heap algorithm +# stored in an array. The algorithm is based on the work of Robert Sedgewick +# and Kevin Wayne. +# +# The JRuby native implementation is a thin wrapper around the standard +# library `java.util.NonConcurrentPriorityQueue`. +# +# When running under JRuby the class `NonConcurrentPriorityQueue` extends `JavaNonConcurrentPriorityQueue`. +# When running under all other interpreters it extends `RubyNonConcurrentPriorityQueue`. +# +# @note This implementation is *not* thread safe. +# @see http://algs4.cs.princeton.edu/24pq/MaxPQ.java.html +# @see http://algs4.cs.princeton.edu/24pq/index.php#2.6 +# @see http://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html +# @see http://en.wikipedia.org/wiki/Priority_queue +# @see http://ruby-doc.org/stdlib-2.0.0/libdoc/thread/rdoc/Queue.html +# # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#8 class Concurrent::Collection::RubyNonConcurrentPriorityQueue + # Create a new priority queue with no items. + # + # @option opts + # @param opts [Hash] the options for creating the queue # @return [RubyNonConcurrentPriorityQueue] a new instance of RubyNonConcurrentPriorityQueue # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#11 def initialize(opts = T.unsafe(nil)); end + # Inserts the specified element into this priority queue. + # + # @param item [Object] the item to insert onto the queue # @raise [ArgumentError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#78 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#85 def <<(item); end + # Removes all of the elements from this priority queue. + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#18 def clear; end + # Deletes all items from `self` that are equal to `item`. + # + # @param item [Object] the item to be removed from the queue + # @return [Object] true if the item is found else false + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#25 def delete(item); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#65 + # Retrieves and removes the head of this queue, or returns `nil` if this + # queue is empty. + # + # @return [Object] the head of the queue or `nil` when empty + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#74 def deq; end - # @return [Boolean] + # Returns `true` if `self` contains no elements. + # + # @return [Boolean] true if there are no items in the queue else false # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#43 def empty?; end + # Inserts the specified element into this priority queue. + # + # @param item [Object] the item to insert onto the queue # @raise [ArgumentError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#78 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#86 def enq(item); end - # @return [Boolean] + # Returns `true` if the given item is present in `self` (that is, if any + # element == `item`), otherwise returns false. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#48 + # @param item [Object] the item to search for + # @return [Boolean] true if the item is found else false + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#51 def has_priority?(item); end - # @return [Boolean] + # Returns `true` if the given item is present in `self` (that is, if any + # element == `item`), otherwise returns false. + # + # @param item [Object] the item to search for + # @return [Boolean] true if the item is found else false # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#48 def include?(item); end + # The current length of the queue. + # + # @return [Fixnum] the number of items in the queue + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#54 def length; end + # Retrieves, but does not remove, the head of this queue, or returns `nil` + # if this queue is empty. + # + # @return [Object] the head of the queue or `nil` when empty + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#60 def peek; end + # Retrieves and removes the head of this queue, or returns `nil` if this + # queue is empty. + # + # @return [Object] the head of the queue or `nil` when empty + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#65 def pop; end + # Inserts the specified element into this priority queue. + # + # @param item [Object] the item to insert onto the queue # @raise [ArgumentError] # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#78 def push(item); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#65 + # Retrieves and removes the head of this queue, or returns `nil` if this + # queue is empty. + # + # @return [Object] the head of the queue or `nil` when empty + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#75 def shift; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#54 + # The current length of the queue. + # + # @return [Fixnum] the number of items in the queue + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb#57 def size; end private @@ -3133,14 +3183,18 @@ class Concurrent::Collection::RubyNonConcurrentPriorityQueue end end +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/timeout_queue.rb#15 +class Concurrent::Collection::TimeoutQueue < ::Thread::Queue; end + +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/timeout_queue.rb#5 +Concurrent::Collection::TimeoutQueueImplementation = Thread::Queue + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#2 module Concurrent::Concern; end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/deprecation.rb#8 module Concurrent::Concern::Deprecation - include ::Logger::Severity include ::Concurrent::Concern::Logging - extend ::Logger::Severity extend ::Concurrent::Concern::Logging extend ::Concurrent::Concern::Deprecation @@ -3164,7 +3218,7 @@ module Concurrent::Concern::Dereferenceable # # @return [Object] the current value of the object # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#21 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/dereferenceable.rb#24 def deref; end # Return the value this object represents after applying the options specified @@ -3220,19 +3274,38 @@ end # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#9 module Concurrent::Concern::Logging - include ::Logger::Severity - # Logs through {Concurrent.global_logger}, it can be overridden by setting @logger # - # @param level [Integer] one of Logger::Severity constants - # @param progname [String] e.g. a path of an Actor + # @param level [Integer] one of Concurrent::Concern::Logging constants # @param message [String, nil] when nil block is used to generate the message + # @param progname [String] e.g. a path of an Actor # @yieldreturn [String] a message # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#17 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#19 def log(level, progname, message = T.unsafe(nil), &block); end end +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11 +Concurrent::Concern::Logging::DEBUG = T.let(T.unsafe(nil), Integer) + +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11 +Concurrent::Concern::Logging::ERROR = T.let(T.unsafe(nil), Integer) + +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11 +Concurrent::Concern::Logging::FATAL = T.let(T.unsafe(nil), Integer) + +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11 +Concurrent::Concern::Logging::INFO = T.let(T.unsafe(nil), Integer) + +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#12 +Concurrent::Concern::Logging::SEV_LABEL = T.let(T.unsafe(nil), Array) + +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11 +Concurrent::Concern::Logging::UNKNOWN = T.let(T.unsafe(nil), Integer) + +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#11 +Concurrent::Concern::Logging::WARN = T.let(T.unsafe(nil), Integer) + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#10 module Concurrent::Concern::Obligation include ::Concurrent::Concern::Dereferenceable @@ -3273,7 +3346,7 @@ module Concurrent::Concern::Obligation # @raise [Exception] raises the reason when rejected # @return [Obligation] self # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#86 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#89 def no_error!(timeout = T.unsafe(nil)); end # Is obligation completion still pending? @@ -3287,7 +3360,7 @@ module Concurrent::Concern::Obligation # # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#20 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#23 def realized?; end # If an exception was raised during processing this will return the @@ -3364,8 +3437,8 @@ module Concurrent::Concern::Obligation # Atomic compare and set operation # State is set to `next_state` only if `current state == expected_current`. # - # @param next_state [Symbol] # @param expected_current [Symbol] + # @param next_state [Symbol] # @return [Boolean] true is state is changed, false otherwise # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/obligation.rb#174 @@ -3454,9 +3527,9 @@ module Concurrent::Concern::Observable # Adds an observer to this set. If a block is passed, the observer will be # created by this method and no other params should be passed. # - # @param observer [Object] the observer to add # @param func [Symbol] the function to call on the observer during notification. # Default is :update + # @param observer [Object] the observer to add # @return [Object] the added observer # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/observable.rb#61 @@ -3487,8 +3560,8 @@ module Concurrent::Concern::Observable # As `#add_observer` but can be used for chaining. # - # @param observer [Object] the observer to add # @param func [Symbol] the function to call on the observer during notification. + # @param observer [Object] the observer to add # @return [Observable] self # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/observable.rb#70 @@ -3509,12 +3582,12 @@ module Concurrent::Concern::Observable def observers=(_arg0); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#143 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#70 class Concurrent::ConcurrentUpdateError < ::ThreadError; end # frozen pre-allocated backtrace to speed ConcurrentUpdateError # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb#144 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#72 Concurrent::ConcurrentUpdateError::CONC_UP_ERR_BACKTRACE = T.let(T.unsafe(nil), Array) # Raised when errors occur during configuration. @@ -3657,6 +3730,8 @@ class Concurrent::CyclicBarrier::Generation < ::Struct # Returns the value of attribute status # # @return [Object] the current value of status + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#30 def status; end # Sets the attribute status @@ -3668,9 +3743,19 @@ class Concurrent::CyclicBarrier::Generation < ::Struct def status=(_); end class << self + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#30 def [](*_arg0); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#30 def inspect; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#30 + def keyword_init?; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#30 def members; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb#30 def new(*_arg0); end end end @@ -3686,7 +3771,7 @@ end # # When a `Delay` is created its state is set to `pending`. The value and # reason are both `nil`. The first time the `#value` method is called the -# enclosed opration will be run and the calling thread will block. Other +# enclosed operation will be run and the calling thread will block. Other # threads attempting to call `#value` will block as well. Once the operation # is complete the *value* will be set to the result of the operation or the # *reason* will be set to the raised exception, as appropriate. All threads @@ -3729,7 +3814,7 @@ class Concurrent::Delay < ::Concurrent::Synchronization::LockableObject # Return the value this object represents after applying the options # specified by the `#set_deref_options` method. If the delayed operation - # raised an exception this method will return nil. The execption object + # raised an exception this method will return nil. The exception object # can be accessed via the `#reason` method. # # @note The default behavior of `Delay` is to block indefinitely when @@ -3944,15 +4029,14 @@ end # threads.each {|t| t.join(2) } # @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Exchanger.html java.util.concurrent.Exchanger # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#335 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#336 class Concurrent::Exchanger < ::Concurrent::RubyExchanger; end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#326 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#327 Concurrent::ExchangerImplementation = Concurrent::RubyExchanger # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/executor_service.rb#157 module Concurrent::ExecutorService - include ::Logger::Severity include ::Concurrent::Concern::Logging # Submit a task to the executor for asynchronous processing. @@ -3993,6 +4077,98 @@ module Concurrent::ExecutorService def serialized?; end end +# A `FiberLocalVar` is a variable where the value is different for each fiber. +# Each variable may have a default value, but when you modify the variable only +# the current fiber will ever see that change. +# +# This is similar to Ruby's built-in fiber-local variables (`Thread.current[:name]`), +# but with these major advantages: +# * `FiberLocalVar` has its own identity, it doesn't need a Symbol. +# * Each Ruby's built-in fiber-local variable leaks some memory forever (it's a Symbol held forever on the fiber), +# so it's only OK to create a small amount of them. +# `FiberLocalVar` has no such issue and it is fine to create many of them. +# * Ruby's built-in fiber-local variables leak forever the value set on each fiber (unless set to nil explicitly). +# `FiberLocalVar` automatically removes the mapping for each fiber once the `FiberLocalVar` instance is GC'd. +# +# @example +# v = FiberLocalVar.new(14) +# v.value #=> 14 +# v.value = 2 +# v.value #=> 2 +# @example +# v = FiberLocalVar.new(14) +# +# Fiber.new do +# v.value #=> 14 +# v.value = 1 +# v.value #=> 1 +# end.resume +# +# Fiber.new do +# v.value #=> 14 +# v.value = 2 +# v.value #=> 2 +# end.resume +# +# v.value #=> 14 +# +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#41 +class Concurrent::FiberLocalVar + # Creates a fiber local variable. + # + # @param default [Object] the default value when otherwise unset + # @param default_block [Proc] Optional block that gets called to obtain the + # default value for each fiber + # @return [FiberLocalVar] a new instance of FiberLocalVar + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#49 + def initialize(default = T.unsafe(nil), &default_block); end + + # Bind the given value to fiber local storage during + # execution of the given block. + # + # @param value [Object] the value to bind + # @return [Object] the value + # @yield the operation to be performed with the bound variable + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#86 + def bind(value); end + + # Returns the value in the current fiber's copy of this fiber-local variable. + # + # @return [Object] the current value + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#68 + def value; end + + # Sets the current fiber's copy of this fiber-local variable to the specified value. + # + # @param value [Object] the value to set + # @return [Object] the new value + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#76 + def value=(value); end + + protected + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#101 + def default; end +end + +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb#42 +Concurrent::FiberLocalVar::LOCALS = T.let(T.unsafe(nil), Concurrent::FiberLocals) + +# An array-backed storage of indexed variables per fiber. +# +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#166 +class Concurrent::FiberLocals < ::Concurrent::AbstractLocals + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#167 + def locals; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#171 + def locals!; end +end + # A thread pool that reuses a fixed number of threads operating off an unbounded queue. # At any point, at most `num_threads` will be active processing tasks. When all threads are busy new # tasks `#post` to the thread pool are enqueued until a thread becomes available. @@ -4047,12 +4223,12 @@ end # # @note Failure to properly shutdown a thread pool can lead to unpredictable results. # Please read *Shutting Down Thread Pools* for more information. -# @see http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html Java Tutorials: Thread Pools # @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html Java Executors class # @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html Java ExecutorService interface +# @see http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html Java Tutorials: Thread Pools # @see https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean- # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb#197 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb#199 class Concurrent::FixedThreadPool < ::Concurrent::ThreadPoolExecutor # Create a new thread pool. # @@ -4064,15 +4240,15 @@ class Concurrent::FixedThreadPool < ::Concurrent::ThreadPoolExecutor # @return [FixedThreadPool] a new instance of FixedThreadPool # @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool-int- # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb#211 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb#213 def initialize(num_threads, opts = T.unsafe(nil)); end end # {include:file:docs-source/future.md} # -# @see http://ruby-doc.org/stdlib-2.1.1/libdoc/observer/rdoc/Observable.html Ruby Observable module # @see http://clojuredocs.org/clojure_core/clojure.core/future Clojure's future function # @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html java.util.concurrent.Future +# @see http://ruby-doc.org/stdlib-2.1.1/libdoc/observer/rdoc/Observable.html Ruby Observable module # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#21 class Concurrent::Future < ::Concurrent::IVar @@ -4107,28 +4283,19 @@ class Concurrent::Future < ::Concurrent::IVar # passes the block to a new thread/thread pool for eventual execution. # Does nothing if the `Future` is in any state other than `:unscheduled`. # + # @example Instance and execute in one line + # future = Concurrent::Future.new{ sleep(1); 42 }.execute + # future.state #=> :pending # @example Instance and execute in separate steps # future = Concurrent::Future.new{ sleep(1); 42 } # future.state #=> :unscheduled # future.execute # future.state #=> :pending - # @example Instance and execute in one line - # future = Concurrent::Future.new{ sleep(1); 42 }.execute - # future.state #=> :pending # @return [Future] a reference to `self` # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#53 def execute; end - # Set the `IVar` to a value and wake or notify all threads waiting on it. - # - # @param value [Object] the value to store in the `IVar` - # @raise [ArgumentError] if both a value and a block are given - # @raise [Concurrent::MultipleAssignmentError] if the `IVar` has already - # been set or otherwise completed - # @return [IVar] self - # @yield A block operation to use for setting the value - # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/future.rb#82 def set(value = T.unsafe(nil), &block); end @@ -4165,19 +4332,19 @@ class Concurrent::Future < ::Concurrent::IVar end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#101 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#18 Concurrent::GLOBAL_FAST_EXECUTOR = T.let(T.unsafe(nil), Concurrent::Delay) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#113 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#30 Concurrent::GLOBAL_IMMEDIATE_EXECUTOR = T.let(T.unsafe(nil), Concurrent::ImmediateExecutor) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#105 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#22 Concurrent::GLOBAL_IO_EXECUTOR = T.let(T.unsafe(nil), Concurrent::Delay) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#89 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#111 Concurrent::GLOBAL_LOGGER = T.let(T.unsafe(nil), Concurrent::AtomicReference) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#109 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#26 Concurrent::GLOBAL_TIMER_SET = T.let(T.unsafe(nil), Concurrent::Delay) # A thread-safe subclass of Hash. This version locks against the object @@ -4187,7 +4354,7 @@ Concurrent::GLOBAL_TIMER_SET = T.let(T.unsafe(nil), Concurrent::Delay) # # @see http://ruby-doc.org/core/Hash.html Ruby standard library `Hash` # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/hash.rb#56 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/hash.rb#49 class Concurrent::Hash < ::Hash; end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/hash.rb#16 @@ -4231,7 +4398,7 @@ Concurrent::HashImplementation = Hash # 2. For recent application: # [DataDrivenFuture in Habanero Java from Rice](http://www.cs.rice.edu/~vs3/hjlib/doc/edu/rice/hj/api/HjDataDrivenFuture.html). # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#47 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#48 class Concurrent::IVar < ::Concurrent::Synchronization::LockableObject include ::Concurrent::Concern::Dereferenceable include ::Concurrent::Concern::Obligation @@ -4242,11 +4409,11 @@ class Concurrent::IVar < ::Concurrent::Synchronization::LockableObject # @option opts # @option opts # @option opts - # @param value [Object] the initial value # @param opts [Hash] the options to create a message with + # @param value [Object] the initial value # @return [IVar] a new instance of IVar # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#61 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#62 def initialize(value = T.unsafe(nil), opts = T.unsafe(nil), &block); end # Add an observer on this object that will receive notification on update. @@ -4257,12 +4424,12 @@ class Concurrent::IVar < ::Concurrent::Synchronization::LockableObject # final `value` (or `nil` on rejection), and the final `reason` (or `nil` on # fulfillment). # - # @param observer [Object] the object that will be notified of changes # @param func [Symbol] symbol naming the method to call when this # `Observable` has changes` + # @param observer [Object] the object that will be notified of changes # @raise [ArgumentError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#80 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#81 def add_observer(observer = T.unsafe(nil), func = T.unsafe(nil), &block); end # Set the `IVar` to failed due to some error and wake or notify all threads waiting on it. @@ -4272,7 +4439,7 @@ class Concurrent::IVar < ::Concurrent::Synchronization::LockableObject # been set or otherwise completed # @return [IVar] self # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#134 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#135 def fail(reason = T.unsafe(nil)); end # Set the `IVar` to a value and wake or notify all threads waiting on it. @@ -4284,7 +4451,7 @@ class Concurrent::IVar < ::Concurrent::Synchronization::LockableObject # @return [IVar] self # @yield A block operation to use for setting the value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#112 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#113 def set(value = T.unsafe(nil)); end # Attempt to set the `IVar` with the given value or block. Return a @@ -4297,32 +4464,32 @@ class Concurrent::IVar < ::Concurrent::Synchronization::LockableObject # @return [Boolean] true if the value was set else false # @yield A block operation to use for setting the value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#144 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#145 def try_set(value = T.unsafe(nil), &block); end protected - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#201 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#202 def check_for_block_or_value!(block_given, value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#176 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#177 def complete(success, value, reason); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#183 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#184 def complete_without_notification(success, value, reason); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#189 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#190 def notify_observers(value, reason); end # @raise [MultipleAssignmentError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#194 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#195 def ns_complete_without_notification(success, value, reason); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#154 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#155 def ns_initialize(value, opts); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#167 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/ivar.rb#168 def safe_execute(task, args = T.unsafe(nil)); end end @@ -4354,35 +4521,68 @@ class Concurrent::ImmediateExecutor < ::Concurrent::AbstractExecutorService # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#21 def initialize; end + # Submit a task to the executor for asynchronous processing. + # + # @param task [Proc] the asynchronous task to perform + # @return [self] returns itself + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#34 def <<(task); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#55 - def kill; end - - # @raise [ArgumentError] + # Begin an orderly shutdown. Tasks already in the queue will be executed, + # but no new tasks will be accepted. Has no additional effect if the + # thread pool is not running. + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#59 + def kill; end + + # Submit a task to the executor for asynchronous processing. + # + # @param args [Array] zero or more arguments to be passed to the task + # @raise [ArgumentError] if no task is given + # @return [Boolean] `true` if the task is queued, `false` if the executor + # is not running + # @yield the asynchronous task to perform # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#26 def post(*args, &task); end - # @return [Boolean] + # Is the executor running? + # + # @return [Boolean] `true` when running, `false` when shutting down or shutdown # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#40 def running?; end + # Begin an orderly shutdown. Tasks already in the queue will be executed, + # but no new tasks will be accepted. Has no additional effect if the + # thread pool is not running. + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#55 def shutdown; end - # @return [Boolean] + # Is the executor shutdown? + # + # @return [Boolean] `true` when shutdown, `false` when shutting down or running # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#50 def shutdown?; end - # @return [Boolean] + # Is the executor shuttingdown? + # + # @return [Boolean] `true` when not running and not shutdown, else `false` # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#45 def shuttingdown?; end + # Block until executor shutdown is complete or until `timeout` seconds have + # passed. + # + # @note Does not initiate shutdown or termination. Either `shutdown` or `kill` + # must be called before this method (or on another thread). + # @param timeout [Integer] the maximum number of seconds to wait for shutdown to complete + # @return [Boolean] `true` if shutdown complete or false on `timeout` + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/immediate_executor.rb#62 def wait_for_termination(timeout = T.unsafe(nil)); end end @@ -4421,13 +4621,13 @@ module Concurrent::ImmutableStruct # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#68 def select(&block); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#17 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#21 def to_a; end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#41 def to_h; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#29 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#33 def to_s; end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/immutable_struct.rb#17 @@ -4470,7 +4670,7 @@ Concurrent::ImmutableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) # # @note Intended for use primarily in testing and debugging. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb#20 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb#19 class Concurrent::IndirectImmediateExecutor < ::Concurrent::ImmediateExecutor # Creates a new executor # @@ -4503,169 +4703,174 @@ class Concurrent::InitializationError < ::Concurrent::Error; end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#13 class Concurrent::LifecycleError < ::Concurrent::Error; end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#4 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#6 class Concurrent::LockFreeStack < ::Concurrent::Synchronization::Object include ::Enumerable + extend ::Concurrent::Synchronization::SafeInitialization # @param head [Node] # @return [LockFreeStack] a new instance of LockFreeStack # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#49 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#51 def initialize(head = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#169 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#37 def __initialize_atomic_fields__; end # @return [true, false] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#116 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#118 def clear; end # @return [self] # @yield over the cleared stack # @yieldparam value [Object] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#140 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#142 def clear_each(&block); end # @param head [Node] # @return [true, false] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#126 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#128 def clear_if(head); end # @param head [Node] # @return [true, false] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#97 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#99 def compare_and_clear(head); end # @param head [Node] # @return [true, false] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#83 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#85 def compare_and_pop(head); end # @param head [Node] # @param value [Object] # @return [true, false] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#63 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#65 def compare_and_push(head, value); end # @param head [Node] # @return [self] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#105 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#107 def each(head = T.unsafe(nil)); end # @param head [Node] # @return [true, false] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#56 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#58 def empty?(head = T.unsafe(nil)); end # @return [String] Short string representation. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#152 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#158 def inspect; end # @return [Node] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#77 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#79 def peek; end # @return [Object] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#88 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#90 def pop; end # @param value [Object] # @return [self] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#69 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#71 def push(value); end # @param head [Node] # @param new_head [Node] # @return [true, false] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#133 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#135 def replace_if(head, new_head); end # @return [String] Short string representation. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#152 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#154 def to_s; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#137 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#37 def compare_and_set_head(expected, value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#125 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#37 def head; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#129 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#37 def head=(value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#133 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#37 def swap_head(value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#141 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#37 def update_head(&block); end class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 - def new(*args, &block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#39 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#41 def of1(value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#44 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#46 def of2(value1, value2); end end end # The singleton for empty node # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#30 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#32 Concurrent::LockFreeStack::EMPTY = T.let(T.unsafe(nil), Concurrent::LockFreeStack::Node) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#8 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#10 class Concurrent::LockFreeStack::Node # @return [Node] a new instance of Node # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#21 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#23 def initialize(value, next_node); end # @return [Node] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#12 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#14 def next_node; end # @return [Object] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#15 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#17 def value; end # allow to nil-ify to free GC when the entry is no longer relevant, not synchronised # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#19 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#21 def value=(_arg0); end class << self + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb#28 def [](*_arg0); end end end +# Either {FiberLocalVar} or {ThreadLocalVar} depending on whether Mutex (and Monitor) +# are held, respectively, per Fiber or per Thread. +# +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb#22 +Concurrent::LockLocalVar = Concurrent::FiberLocalVar + # An `MVar` is a synchronized single element container. They are empty or # contain one item. Taking a value from an empty `MVar` blocks, as does # putting a value into a full one. You can either think of them as blocking # queue of length one, or a special kind of mutable variable. # # On top of the fundamental `#put` and `#take` operations, we also provide a -# `#mutate` that is atomic with respect to operations on the same instance. +# `#modify` that is atomic with respect to operations on the same instance. # These operations all support timeouts. # # We also support non-blocking operations `#try_put!` and `#try_take!`, a @@ -4693,6 +4898,7 @@ end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#38 class Concurrent::MVar < ::Concurrent::Synchronization::Object include ::Concurrent::Concern::Dereferenceable + extend ::Concurrent::Synchronization::SafeInitialization # Create a new `MVar`, either empty or with an initial value. # @@ -4726,12 +4932,12 @@ class Concurrent::MVar < ::Concurrent::Synchronization::Object def full?; end # Atomically `take`, yield the value to a block for transformation, and then - # `put` the transformed value. Returns the transformed value. A timeout can + # `put` the transformed value. Returns the pre-transform value. A timeout can # be set to limit the time spent blocked, in which case it returns `TIMEOUT` # if the time is exceeded. # # @raise [ArgumentError] - # @return [Object] the transformed value, or `TIMEOUT` + # @return [Object] the pre-transform value, or `TIMEOUT` # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#123 def modify(timeout = T.unsafe(nil)); end @@ -4801,11 +5007,6 @@ class Concurrent::MVar < ::Concurrent::Synchronization::Object # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mvar.rb#228 def wait_while(condition, timeout); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 - def new(*args, &block); end - end end # Unique value that represents that an `MVar` was empty @@ -4826,30 +5027,8 @@ Concurrent::MVar::TIMEOUT = T.let(T.unsafe(nil), Object) # does. For most uses it should do fine though, and we recommend you consider # `Concurrent::Map` instead of `Concurrent::Hash` for your concurrency-safe hash needs. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#37 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#39 class Concurrent::Map < ::Concurrent::Collection::MriMapBackend - # @return [Map] a new instance of Map - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#121 - def initialize(options = T.unsafe(nil), &block); end - - # Get a value with key - # - # @param key [Object] - # @return [Object] the value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#135 - def [](key); end - - # Set a value with key - # - # @param key [Object] - # @param value [Object] - # @return [Object] the new value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#153 - def []=(key, value); end - # Iterates over each key value pair. # This method is atomic. # @@ -4860,7 +5039,7 @@ class Concurrent::Map < ::Concurrent::Collection::MriMapBackend # @yieldparam key [Object] # @yieldparam value [Object] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#270 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#279 def each; end # Iterates over each key. @@ -4872,7 +5051,7 @@ class Concurrent::Map < ::Concurrent::Collection::MriMapBackend # @yield for each key in the map # @yieldparam key [Object] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#251 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#255 def each_key; end # Iterates over each key value pair. @@ -4885,7 +5064,7 @@ class Concurrent::Map < ::Concurrent::Collection::MriMapBackend # @yieldparam key [Object] # @yieldparam value [Object] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#270 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#274 def each_pair; end # Iterates over each value. @@ -4897,14 +5076,14 @@ class Concurrent::Map < ::Concurrent::Collection::MriMapBackend # @yield for each value in the map # @yieldparam value [Object] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#260 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#264 def each_value; end # Is map empty? # # @return [true, false] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#287 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#291 def empty?; end # Get a value with key, or default_value when key is absent, @@ -4918,33 +5097,30 @@ class Concurrent::Map < ::Concurrent::Collection::MriMapBackend # between the fetch operation and yielding to the block. Additionally, # this method does not support recursion. This is due to internal # constraints that are very unlikely to change in the near future. - # @param key [Object] # @param default_value [Object] + # @param key [Object] # @raise [KeyError] when key is missing and no default_value is provided # @return [Object] the value or default value # @yield default value for a key # @yieldparam key [Object] # @yieldreturn [Object] default value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#178 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#183 def fetch(key, default_value = T.unsafe(nil)); end # Fetch value with key, or store default value when key is absent, # or fail when no default_value is given. This is a two step operation, # therefore not atomic. The store can overwrite other concurrently # stored value. - # This method is atomic. # - # @note Atomic methods taking a block do not allow the `self` instance - # to be used within the block. Doing so will cause a deadlock. - # @param key [Object] # @param default_value [Object] + # @param key [Object] # @return [Object] the value or default value # @yield default value for a key # @yieldparam key [Object] # @yieldreturn [Object] default value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#201 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#205 def fetch_or_store(key, default_value = T.unsafe(nil)); end # Get a value with key @@ -4952,10 +5128,10 @@ class Concurrent::Map < ::Concurrent::Collection::MriMapBackend # @param key [Object] # @return [Object] the value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#135 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#162 def get(key); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#317 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#321 def inspect; end # Find key of a value. @@ -4963,22 +5139,22 @@ class Concurrent::Map < ::Concurrent::Collection::MriMapBackend # @param value [Object] # @return [Object, nil] key or nil when not found # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#280 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#284 def key(value); end # All keys # # @return [::Array] keys # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#232 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#236 def keys; end # @raise [TypeError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#301 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#305 def marshal_dump; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#309 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#313 def marshal_load(hash); end # Set a value with key @@ -4987,7 +5163,7 @@ class Concurrent::Map < ::Concurrent::Collection::MriMapBackend # @param value [Object] # @return [Object] the new value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#153 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#163 def put(key, value); end # Insert value into map with key if key is absent in one atomic step. @@ -4996,7 +5172,7 @@ class Concurrent::Map < ::Concurrent::Collection::MriMapBackend # @param value [Object] # @return [Object, nil] the previous value when key was present or nil when there was no key # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#211 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#215 def put_if_absent(key, value); end # Is the value stored in the map. Iterates over all values. @@ -5004,30 +5180,30 @@ class Concurrent::Map < ::Concurrent::Collection::MriMapBackend # @param value [Object] # @return [true, false] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#223 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#227 def value?(value); end # All values # # @return [::Array] values # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#240 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#244 def values; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#327 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#331 def initialize_copy(other); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#332 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#336 def populate_from(hash); end # @raise [KeyError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#323 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#327 def raise_fetch_no_key; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#337 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/map.rb#341 def validate_options_hash!(options); end end @@ -5132,12 +5308,13 @@ class Concurrent::MaxRestartFrequencyError < ::Concurrent::Error; end # # In a Rails controller... # result = ClientService.new(10).find # returns a Maybe # render json: result.or(NullClient.new) -# @see https://hackage.haskell.org/package/base-4.2.0.1/docs/Data-Maybe.html Haskell Data.Maybe # @see https://github.com/purescript/purescript-maybe/blob/master/docs/Data.Maybe.md PureScript Data.Maybe +# @see https://hackage.haskell.org/package/base-4.2.0.1/docs/Data-Maybe.html Haskell Data.Maybe # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#104 class Concurrent::Maybe < ::Concurrent::Synchronization::Object include ::Comparable + extend ::Concurrent::Synchronization::SafeInitialization # Create a new `Maybe` with the given attributes. # @@ -5162,7 +5339,7 @@ class Concurrent::Maybe < ::Concurrent::Synchronization::Object # # @return [Boolean] True if `Just` or false if `Nothing`. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#176 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#179 def fulfilled?; end # The value of a `Maybe` when `Just`. Will be `NONE` when `Nothing`. @@ -5198,19 +5375,19 @@ class Concurrent::Maybe < ::Concurrent::Synchronization::Object # The reason for the `Maybe` when `Nothing`. Will be `NONE` when `Just`. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#117 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#191 def reason; end # Is this `Maybe` a `nothing` (rejected with an exception upon fulfillment)? # # @return [Boolean] True if `Nothing` or false if `Just`. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#184 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#187 def rejected?; end # The value of a `Maybe` when `Just`. Will be `NONE` when `Nothing`. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#114 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#189 def value; end class << self @@ -5253,7 +5430,7 @@ class Concurrent::Maybe < ::Concurrent::Synchronization::Object private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/maybe.rb#119 def new(*args, &block); end end end @@ -5377,8 +5554,8 @@ module Concurrent::MutableStruct # @return [Synchronization::AbstractStruct] a new struct with the new values # @yield an options block for resolving duplicate keys # @yieldparam member [String, Symbol] the name of the member which is duplicated - # @yieldparam selfvalue [Object] the value of the member in `self` # @yieldparam othervalue [Object] the value of the member in `other` + # @yieldparam selfvalue [Object] the value of the member in `self` # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#94 def merge(other, &block); end @@ -5398,7 +5575,7 @@ module Concurrent::MutableStruct # # @return [Array] the values for this struct # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#51 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#54 def to_a; end # Returns a hash containing the names and values for the struct’s members. @@ -5412,7 +5589,7 @@ module Concurrent::MutableStruct # # @return [String] the contents of this struct in a string # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#72 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#75 def to_s; end # Returns the values for this struct as an Array. @@ -5475,43 +5652,123 @@ end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/mutable_struct.rb#220 Concurrent::MutableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) +# A boolean value that can be updated atomically. Reads and writes to an atomic +# boolean and thread-safe and guaranteed to succeed. Reads and writes may block +# briefly but no explicit locking is required. +# +# +# ## Thread-safe Variable Classes +# +# Each of the thread-safe variable classes is designed to solve a different +# problem. In general: +# +# * *{Concurrent::Agent}:* Shared, mutable variable providing independent, +# uncoordinated, *asynchronous* change of individual values. Best used when +# the value will undergo frequent, complex updates. Suitable when the result +# of an update does not need to be known immediately. +# * *{Concurrent::Atom}:* Shared, mutable variable providing independent, +# uncoordinated, *synchronous* change of individual values. Best used when +# the value will undergo frequent reads but only occasional, though complex, +# updates. Suitable when the result of an update must be known immediately. +# * *{Concurrent::AtomicReference}:* A simple object reference that can be updated +# atomically. Updates are synchronous but fast. Best used when updates a +# simple set operations. Not suitable when updates are complex. +# {Concurrent::AtomicBoolean} and {Concurrent::AtomicFixnum} are similar +# but optimized for the given data type. +# * *{Concurrent::Exchanger}:* Shared, stateless synchronization point. Used +# when two or more threads need to exchange data. The threads will pair then +# block on each other until the exchange is complete. +# * *{Concurrent::MVar}:* Shared synchronization point. Used when one thread +# must give a value to another, which must take the value. The threads will +# block on each other until the exchange is complete. +# * *{Concurrent::ThreadLocalVar}:* Shared, mutable, isolated variable which +# holds a different value for each thread which has access. Often used as +# an instance variable in objects which must maintain different state +# for different threads. +# * *{Concurrent::TVar}:* Shared, mutable variables which provide +# *coordinated*, *synchronous*, change of *many* stated. Used when multiple +# value must change together, in an all-or-nothing transaction. +# Performance: +# +# ``` +# Testing with ruby 2.1.2 +# Testing with Concurrent::MutexAtomicBoolean... +# 2.790000 0.000000 2.790000 ( 2.791454) +# Testing with Concurrent::CAtomicBoolean... +# 0.740000 0.000000 0.740000 ( 0.740206) +# +# Testing with jruby 1.9.3 +# Testing with Concurrent::MutexAtomicBoolean... +# 5.240000 2.520000 7.760000 ( 3.683000) +# Testing with Concurrent::JavaAtomicBoolean... +# 3.340000 0.010000 3.350000 ( 0.855000) +# ``` +# +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicBoolean.html java.util.concurrent.atomic.AtomicBoolean +# # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#8 -class Concurrent::MutexAtomicBoolean < ::Concurrent::Synchronization::LockableObject +class Concurrent::MutexAtomicBoolean + extend ::Concurrent::Synchronization::SafeInitialization + + # Creates a new `AtomicBoolean` with the given initial value. + # + # @param initial [Boolean] the initial value # @return [MutexAtomicBoolean] a new instance of MutexAtomicBoolean # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#11 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#12 def initialize(initial = T.unsafe(nil)); end - # @return [Boolean] + # Is the current value `false` + # + # @return [Boolean] true if the current value is `false`, else false # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#32 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#34 def false?; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#42 + # Explicitly sets the value to false. + # + # @return [Boolean] true if value has changed, otherwise false + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#44 def make_false; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#37 + # Explicitly sets the value to true. + # + # @return [Boolean] true if value has changed, otherwise false + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#39 def make_true; end - # @return [Boolean] + # Is the current value `true` + # + # @return [Boolean] true if the current value is `true`, else false # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#27 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#29 def true?; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#17 + # Retrieves the current `Boolean` value. + # + # @return [Boolean] the current value + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#19 def value; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#22 + # Explicitly sets the value. + # + # @param value [Boolean] the new value to be set + # @return [Boolean] the current value + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#24 def value=(value); end protected - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#49 - def ns_initialize(initial); end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#51 + def synchronize; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#56 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb#62 def ns_make_value(value); end end @@ -5570,14 +5827,16 @@ end # @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicLong.html java.util.concurrent.atomic.AtomicLong # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#9 -class Concurrent::MutexAtomicFixnum < ::Concurrent::Synchronization::LockableObject +class Concurrent::MutexAtomicFixnum + extend ::Concurrent::Synchronization::SafeInitialization + # Creates a new `AtomicFixnum` with the given initial value. # # @param initial [Fixnum] the initial value # @raise [ArgumentError] if the initial value is not a `Fixnum` # @return [MutexAtomicFixnum] a new instance of MutexAtomicFixnum # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#12 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#13 def initialize(initial = T.unsafe(nil)); end # Atomically sets the value to the given updated value if the current @@ -5587,7 +5846,7 @@ class Concurrent::MutexAtomicFixnum < ::Concurrent::Synchronization::LockableObj # @param update [Fixnum] the new value # @return [Boolean] true if the value was updated else false # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#42 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#44 def compare_and_set(expect, update); end # Decreases the current value by the given amount (defaults to 1). @@ -5595,7 +5854,7 @@ class Concurrent::MutexAtomicFixnum < ::Concurrent::Synchronization::LockableObj # @param delta [Fixnum] the amount by which to decrease the current value # @return [Fixnum] the current value after decrementation # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#35 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#37 def decrement(delta = T.unsafe(nil)); end # Decreases the current value by the given amount (defaults to 1). @@ -5603,7 +5862,7 @@ class Concurrent::MutexAtomicFixnum < ::Concurrent::Synchronization::LockableObj # @param delta [Fixnum] the amount by which to decrease the current value # @return [Fixnum] the current value after decrementation # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#35 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#41 def down(delta = T.unsafe(nil)); end # Increases the current value by the given amount (defaults to 1). @@ -5611,7 +5870,7 @@ class Concurrent::MutexAtomicFixnum < ::Concurrent::Synchronization::LockableObj # @param delta [Fixnum] the amount by which to increase the current value # @return [Fixnum] the current value after incrementation # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#28 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#30 def increment(delta = T.unsafe(nil)); end # Increases the current value by the given amount (defaults to 1). @@ -5619,7 +5878,7 @@ class Concurrent::MutexAtomicFixnum < ::Concurrent::Synchronization::LockableObj # @param delta [Fixnum] the amount by which to increase the current value # @return [Fixnum] the current value after incrementation # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#28 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#34 def up(delta = T.unsafe(nil)); end # Pass the current value to the given block, replacing it @@ -5631,14 +5890,14 @@ class Concurrent::MutexAtomicFixnum < ::Concurrent::Synchronization::LockableObj # given (old) value # @yieldparam old_value [Object] the starting value of the atomic reference # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#54 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#56 def update; end # Retrieves the current `Fixnum` value. # # @return [Fixnum] the current value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#18 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#20 def value; end # Explicitly sets the value. @@ -5647,58 +5906,97 @@ class Concurrent::MutexAtomicFixnum < ::Concurrent::Synchronization::LockableObj # @raise [ArgumentError] if the new value is not a `Fixnum` # @return [Fixnum] the current value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#23 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#25 def value=(value); end protected - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#63 - def ns_initialize(initial); end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#65 + def synchronize; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#70 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb#76 def ns_set(value); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#5 -class Concurrent::MutexAtomicReference < ::Concurrent::Synchronization::LockableObject +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#9 +class Concurrent::MutexAtomicReference include ::Concurrent::AtomicDirectUpdate include ::Concurrent::AtomicNumericCompareAndSetWrapper + extend ::Concurrent::Synchronization::SafeInitialization + # @param value [Object] The initial value. # @return [MutexAtomicReference] a new instance of MutexAtomicReference # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#11 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#16 def initialize(value = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#39 + # Atomically sets the value to the given updated value if + # the current value == the expected value. + # + # that the actual value was not equal to the expected value. + # + # @param new_value [Object] the new value + # @param old_value [Object] the expected value + # @return [Boolean] `true` if successful. A `false` return indicates + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#45 def _compare_and_set(old_value, new_value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb#10 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#13 def compare_and_swap(old_value, new_value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#17 + # Gets the current value. + # + # @return [Object] the current value + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#23 def get; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#29 + # Atomically sets to the given value and returns the old value. + # + # @param new_value [Object] the new value + # @return [Object] the old value + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#35 def get_and_set(new_value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#23 + # Sets to the given value. + # + # @param new_value [Object] the new value + # @return [Object] the new value + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#29 def set(new_value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#29 + # Atomically sets to the given value and returns the old value. + # + # @param new_value [Object] the new value + # @return [Object] the old value + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#42 def swap(new_value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#17 + # Gets the current value. + # + # @return [Object] the current value + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#26 def value; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#23 + # Sets to the given value. + # + # @param new_value [Object] the new value + # @return [Object] the new value + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#32 def value=(new_value); end protected - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#52 - def ns_initialize(value); end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb#59 + def synchronize; end end # A synchronization object that allows one thread to wait on multiple other threads. @@ -5748,44 +6046,16 @@ class Concurrent::MutexCountDownLatch < ::Concurrent::Synchronization::LockableO def ns_initialize(count); end end -# A counting semaphore. Conceptually, a semaphore maintains a set of -# permits. Each {#acquire} blocks if necessary until a permit is -# available, and then takes it. Each {#release} adds a permit, potentially -# releasing a blocking acquirer. -# However, no actual permit objects are used; the Semaphore just keeps a -# count of the number available and acts accordingly. -# Alternatively, permits may be acquired within a block, and automatically -# released after the block finishes executing. -# # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#9 class Concurrent::MutexSemaphore < ::Concurrent::Synchronization::LockableObject - # Create a new `Semaphore` with the initial `count`. - # - # @param count [Fixnum] the initial count - # @raise [ArgumentError] if `count` is not an integer or is less than zero # @return [MutexSemaphore] a new instance of MutexSemaphore # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#12 def initialize(count); end - # Acquires the given number of permits from this semaphore, - # blocking until all are available. If a block is given, - # yields to it and releases the permits afterwards. - # - # is given, its return value is returned. - # - # @param permits [Fixnum] Number of permits to acquire - # @raise [ArgumentError] if `permits` is not an integer or is less than - # one - # @return [nil, BasicObject] Without a block, `nil` is returned. If a block - # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#20 def acquire(permits = T.unsafe(nil)); end - # Returns the current number of permits available in this semaphore. - # - # @return [Integer] - # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#38 def available_permits; end @@ -5806,31 +6076,9 @@ class Concurrent::MutexSemaphore < ::Concurrent::Synchronization::LockableObject # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#99 def reduce_permits(reduction); end - # Releases the given number of permits, returning them to the semaphore. - # - # @param permits [Fixnum] Number of permits to return to the semaphore. - # @raise [ArgumentError] if `permits` is not a number or is less than one - # @return [nil] - # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#77 def release(permits = T.unsafe(nil)); end - # Acquires the given number of permits from this semaphore, - # only if all are available at the time of invocation or within - # `timeout` interval. If a block is given, yields to it if the permits - # were successfully acquired, and releases them afterward, returning the - # block's return value. - # - # @param permits [Fixnum] the number of permits to acquire - # @param timeout [Fixnum] the number of seconds to wait for the counter - # or `nil` to return immediately - # @raise [ArgumentError] if `permits` is not an integer or is less than - # one - # @return [true, false, nil, BasicObject] `false` if no permits are - # available, `true` when acquired a permit. If a block is given, the - # block's return value is returned if the permits were acquired; if not, - # `nil` is returned. - # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb#54 def try_acquire(permits = T.unsafe(nil), timeout = T.unsafe(nil)); end @@ -5856,7 +6104,7 @@ Concurrent::NULL = T.let(T.unsafe(nil), Object) # Suppresses all output when used for logging. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/configuration.rb#86 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/concern/logging.rb#108 Concurrent::NULL_LOGGER = T.let(T.unsafe(nil), Proc) # source://concurrent-ruby//lib/concurrent-ruby/concurrent/options.rb#6 @@ -5930,7 +6178,7 @@ end # Start by requiring promises # # ```ruby -# require 'concurrent' +# require 'concurrent/promise' # ``` # # Then create one @@ -5967,7 +6215,7 @@ end # - if parent is *rejected* the child will be *pending* (but will ultimately be *rejected*) # # Promises are executed asynchronously from the main thread. By the time a -# child Promise finishes intialization it may be in a different state than its +# child Promise finishes initialization it may be in a different state than its # parent (by the time a child is created its parent may have completed # execution and changed state). Despite being asynchronous, however, the order # of execution of Promise objects in a chain (or tree) is strictly defined. @@ -6031,7 +6279,7 @@ end # c2 = p.then(-> reason { raise 'Boom!' }) # # c1.wait.state #=> :fulfilled -# c1.value #=> 45 +# c1.value #=> 42 # c2.wait.state #=> :rejected # c2.reason #=> # # ``` @@ -6063,8 +6311,8 @@ class Concurrent::Promise < ::Concurrent::IVar # @param opts [Hash] a customizable set of options # @raise [ArgumentError] if no block is given # @return [Promise] a new instance of Promise - # @see http://wiki.commonjs.org/wiki/Promises/A # @see http://promises-aplus.github.io/promises-spec/ + # @see http://wiki.commonjs.org/wiki/Promises/A # @yield The block operation to be performed asynchronously. # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#210 @@ -6076,7 +6324,7 @@ class Concurrent::Promise < ::Concurrent::IVar # @return [Promise] self # @yield The block to execute # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#360 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#364 def catch(&block); end # Execute an `:unscheduled` `Promise`. Immediately sets the state to `:pending` and @@ -6116,7 +6364,7 @@ class Concurrent::Promise < ::Concurrent::IVar # @return [Promise] self # @yield The block to execute # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#360 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promise.rb#365 def on_error(&block); end # Chain onto this promise an action to be undertaken on success @@ -6326,7 +6574,7 @@ class Concurrent::PromiseExecutionError < ::StandardError; end # {include:file:docs-source/promises-main.md} # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#11 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#13 module Concurrent::Promises extend ::Concurrent::Promises::FactoryMethods::Configuration extend ::Concurrent::Promises::FactoryMethods @@ -6334,39 +6582,40 @@ end # @abstract # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2036 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2047 class Concurrent::Promises::AbstractAnyPromise < ::Concurrent::Promises::BlockedPromise; end # Common ancestor of {Event} and {Future} classes, many shared methods are defined here. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#511 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#513 class Concurrent::Promises::AbstractEventFuture < ::Concurrent::Synchronization::Object include ::Concurrent::Promises::InternalStates + extend ::Concurrent::Synchronization::SafeInitialization # @return [AbstractEventFuture] a new instance of AbstractEventFuture # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#520 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#522 def initialize(promise, default_executor); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#169 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#515 def __initialize_atomic_fields__; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#736 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#738 def add_callback_clear_delayed_node(node); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#731 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#733 def add_callback_notify_blocked(promise, index); end # For inspection. # # @return [Array] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#700 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#702 def blocks; end # For inspection. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#708 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#710 def callbacks; end # Shortcut of {#chain_on} with default `:io` executor supplied. @@ -6374,23 +6623,23 @@ class Concurrent::Promises::AbstractEventFuture < ::Concurrent::Synchronization: # @return [Future] # @see #chain_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#594 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#596 def chain(*args, &task); end # Chains the task to be executed asynchronously on executor after it is resolved. # - # @overload an_event.chain_on # @overload a_future.chain_on + # @overload an_event.chain_on + # @param args [Object] arguments which are passed to the task when it's executed. + # (It might be prepended with other arguments, see the @yield section). # @param executor [Executor, :io, :fast] Instance of an executor or a name of the # global executor. The task is executed on it, default executor remains unchanged. - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yeild section). # @return [Future] # @yieldreturn will become result of the returned Future. # Its returned value becomes {Future#value} fulfilling it, # raised exception becomes {Future#reason} rejecting it. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#612 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#614 def chain_on(executor, *args, &task); end # Resolves the resolvable when receiver is resolved. @@ -6398,29 +6647,27 @@ class Concurrent::Promises::AbstractEventFuture < ::Concurrent::Synchronization: # @param resolvable [Resolvable] # @return [self] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#627 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#629 def chain_resolvable(resolvable); end # Returns default executor. # # @return [Executor] default executor # @see #with_default_executor + # @see FactoryMethods#any_fulfilled_future_on # @see FactoryMethods#future_on # @see FactoryMethods#resolvable_future - # @see FactoryMethods#any_fulfilled_future_on # @see similar # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#588 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#590 def default_executor; end # @return [String] Short string representation. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#617 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#623 def inspect; end - # @return [Object] The internal_state. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#125 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#515 def internal_state; end # Shortcut of {#on_resolution_using} with default `:io` executor supplied. @@ -6428,65 +6675,65 @@ class Concurrent::Promises::AbstractEventFuture < ::Concurrent::Synchronization: # @return [self] # @see #on_resolution_using # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#635 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#637 def on_resolution(*args, &callback); end # Stores the callback to be executed synchronously on resolving thread after it is # resolved. # - # @overload an_event.on_resolution! # @overload a_future.on_resolution! + # @overload an_event.on_resolution! # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yeild section). + # (It might be prepended with other arguments, see the @yield section). # @return [self] # @yieldreturn is forgotten. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#653 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#655 def on_resolution!(*args, &callback); end # Stores the callback to be executed asynchronously on executor after it is resolved. # - # @overload an_event.on_resolution_using # @overload a_future.on_resolution_using + # @overload an_event.on_resolution_using + # @param args [Object] arguments which are passed to the task when it's executed. + # (It might be prepended with other arguments, see the @yield section). # @param executor [Executor, :io, :fast] Instance of an executor or a name of the # global executor. The task is executed on it, default executor remains unchanged. - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yeild section). # @return [self] # @yieldreturn is forgotten. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#671 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#673 def on_resolution_using(executor, *args, &callback); end # Is it in pending state? # # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#547 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#549 def pending?; end # For inspection. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#714 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#716 def promise; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#686 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#688 def resolve_with(state, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end # Is it in resolved state? # # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#553 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#555 def resolved?; end # Returns its state. # - # @overload an_event.state # @overload a_future.state + # @overload an_event.state # @return [Symbol] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#541 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#543 def state; end # Resolves the resolvable when receiver is resolved. @@ -6494,12 +6741,12 @@ class Concurrent::Promises::AbstractEventFuture < ::Concurrent::Synchronization: # @param resolvable [Resolvable] # @return [self] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#627 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#633 def tangle(resolvable); end # @return [String] Short string representation. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#617 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#619 def to_s; end # Propagates touch. Requests all the delayed futures, which it depends on, to be @@ -6507,14 +6754,14 @@ class Concurrent::Promises::AbstractEventFuture < ::Concurrent::Synchronization: # # @return [self] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#560 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#562 def touch; end # For inspection. # # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#720 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#722 def touched?; end # Wait (block the Thread) until receiver is {#resolved?}. @@ -6526,12 +6773,12 @@ class Concurrent::Promises::AbstractEventFuture < ::Concurrent::Synchronization: # @return [self, true, false] self implies timeout was not used, true implies timeout was used # and it was resolved, false implies it was not resolved within timeout. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#576 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#578 def wait(timeout = T.unsafe(nil)); end # For inspection. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#726 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#728 def waiting_threads; end # Crates new object with same class with the executor set as its new default executor. @@ -6543,292 +6790,270 @@ class Concurrent::Promises::AbstractEventFuture < ::Concurrent::Synchronization: # @see Event#with_default_executor # @see Future#with_default_executor # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#681 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#683 def with_default_executor(executor); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#741 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#743 def with_hidden_resolvable; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#748 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#750 def add_callback(method, *args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#801 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#812 def async_callback_on_resolution(state, executor, args, callback); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#785 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#796 def call_callback(method, state, args); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#789 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#800 def call_callbacks(state); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#761 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#763 def callback_clear_delayed_node(state, node); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#807 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#818 def callback_notify_blocked(state, promise, index); end - # Sets the internal_state to new_internal_state if the current internal_state is expected_internal_state - # - # @return [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#137 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#515 def compare_and_set_internal_state(expected, value); end - # Set the internal_state. - # - # @return [Object] new_internal_state. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#129 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#515 def internal_state=(value); end - # Set the internal_state to new_internal_state and return the old internal_state. - # - # @return [Object] old internal_state - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#133 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#515 def swap_internal_state(value); end - # Updates the internal_state using the block. - # - # @return [Object] new internal_state - # @yield [Object] Calculate a new internal_state using given (old) internal_state - # @yieldparam old [Object] internal_state - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#141 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#515 def update_internal_state(&block); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#766 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#768 def wait_until_resolved(timeout); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#797 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#808 def with_async(executor, *args, &block); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 - def new(*args, &block); end - end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1785 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1796 class Concurrent::Promises::AbstractFlatPromise < ::Concurrent::Promises::BlockedPromise # @return [AbstractFlatPromise] a new instance of AbstractFlatPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1787 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1798 def initialize(delayed_because, blockers_count, event_or_future); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1797 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1808 def touch; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1817 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1828 def add_delayed_of(future); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1809 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1820 def on_resolvable(resolved_future, index); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1813 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1824 def resolvable?(countdown, future, index); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1805 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1816 def touched?; end end # @abstract # @private # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1538 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1549 class Concurrent::Promises::AbstractPromise < ::Concurrent::Synchronization::Object include ::Concurrent::Promises::InternalStates + extend ::Concurrent::Synchronization::SafeInitialization # @return [AbstractPromise] a new instance of AbstractPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1542 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1553 def initialize(future); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1553 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1564 def default_executor; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1570 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1581 def delayed_because; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1547 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1562 def event; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1547 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1558 def future; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1564 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1579 def inspect; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1557 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1568 def state; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1564 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1575 def to_s; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1561 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1572 def touch; end private # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1581 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1592 def evaluate_to(*args, block); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1576 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1587 def resolve_with(new_state, raise_on_reassign = T.unsafe(nil)); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 - def new(*args, &block); end - end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2073 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2084 class Concurrent::Promises::AnyFulfilledFuturePromise < ::Concurrent::Promises::AnyResolvedFuturePromise private # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2077 - def resolvable?(countdown, future, index); end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2088 + def resolvable?(countdown, event_or_future, index); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2039 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2050 class Concurrent::Promises::AnyResolvedEventPromise < ::Concurrent::Promises::AbstractAnyPromise # @return [AnyResolvedEventPromise] a new instance of AnyResolvedEventPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2043 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2054 def initialize(delayed, blockers_count, default_executor); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2051 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2062 def on_resolvable(resolved_future, index); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2047 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2058 def resolvable?(countdown, future, index); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2056 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2067 class Concurrent::Promises::AnyResolvedFuturePromise < ::Concurrent::Promises::AbstractAnyPromise # @return [AnyResolvedFuturePromise] a new instance of AnyResolvedFuturePromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2060 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2071 def initialize(delayed, blockers_count, default_executor); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2068 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2079 def on_resolvable(resolved_future, index); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2064 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2075 def resolvable?(countdown, future, index); end end # @abstract # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1608 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1619 class Concurrent::Promises::BlockedPromise < ::Concurrent::Promises::InnerPromise # @return [BlockedPromise] a new instance of BlockedPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1650 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1661 def initialize(delayed, blockers_count, future); end # for inspection only # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1672 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1683 def blocked_by; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1663 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1674 def delayed_because; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1656 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1667 def on_blocker_resolution(future, index); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1667 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1678 def touch; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1680 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1691 def clear_and_propagate_touch(stack_or_element = T.unsafe(nil)); end # @raise [NotImplementedError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1699 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1710 def on_resolvable(resolved_future, index); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1695 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1706 def process_on_blocker_resolution(future, index); end # @return [true, false] if resolvable # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1691 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1702 def resolvable?(countdown, future, index); end class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1641 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1652 def add_delayed(delayed1, delayed2); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1634 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1645 def new_blocked_by(blockers, *args, &block); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1612 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1623 def new_blocked_by1(blocker, *args, &block); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1619 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1630 def new_blocked_by2(blocker1, blocker2, *args, &block); end + + private + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1621 + def new(*args, &block); end end end # @abstract # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1705 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1716 class Concurrent::Promises::BlockedTaskPromise < ::Concurrent::Promises::BlockedPromise # @raise [ArgumentError] # @return [BlockedTaskPromise] a new instance of BlockedTaskPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1706 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1717 def initialize(delayed, blockers_count, default_executor, executor, args, &task); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1714 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1725 def executor; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1755 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1766 class Concurrent::Promises::ChainPromise < ::Concurrent::Promises::BlockedTaskPromise private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1758 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1769 def on_resolvable(resolved_future, index); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2084 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2095 class Concurrent::Promises::DelayPromise < ::Concurrent::Promises::InnerPromise # @return [DelayPromise] a new instance of DelayPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2086 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2097 def initialize(default_executor); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2097 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2108 def delayed_because; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2093 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2104 def touch; end end @@ -6836,7 +7061,7 @@ end # pending or resolved. It should be always resolved. Use {Future} to communicate rejections and # cancellation. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#815 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#826 class Concurrent::Promises::Event < ::Concurrent::Promises::AbstractEventFuture # Creates a new event or a future which will be resolved when receiver and other are. # Returns an event if receiver and other are events, otherwise returns a future. @@ -6846,7 +7071,7 @@ class Concurrent::Promises::Event < ::Concurrent::Promises::AbstractEventFuture # # @return [Future, Event] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#828 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#847 def &(other); end # Creates a new event which will be resolved when the first of receiver, `event_or_future` @@ -6854,7 +7079,7 @@ class Concurrent::Promises::Event < ::Concurrent::Promises::AbstractEventFuture # # @return [Event] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#842 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#853 def any(event_or_future); end # Creates new event dependent on receiver which will not evaluate until touched, see {#touch}. @@ -6862,7 +7087,7 @@ class Concurrent::Promises::Event < ::Concurrent::Promises::AbstractEventFuture # # @return [Event] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#852 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#863 def delay; end # Creates new event dependent on receiver scheduled to execute on/in intended_time. @@ -6873,24 +7098,24 @@ class Concurrent::Promises::Event < ::Concurrent::Promises::AbstractEventFuture # `Time` means to run on `intended_time`. # @return [Event] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#864 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#875 def schedule(intended_time); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#594 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#828 def then(*args, &task); end # Returns self, since this is event # # @return [Event] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#882 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#893 def to_event; end # Converts event to a future. The future is fulfilled when the event is resolved, the future may never fail. # # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#874 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#885 def to_future; end # Crates new object with same class with the executor set as its new default executor. @@ -6898,7 +7123,7 @@ class Concurrent::Promises::Event < ::Concurrent::Promises::AbstractEventFuture # # @return [Event] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#888 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#899 def with_default_executor(executor); end # Creates a new event or a future which will be resolved when receiver and other are. @@ -6909,7 +7134,7 @@ class Concurrent::Promises::Event < ::Concurrent::Promises::AbstractEventFuture # # @return [Future, Event] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#828 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#839 def zip(other); end # Creates a new event which will be resolved when the first of receiver, `event_or_future` @@ -6917,58 +7142,60 @@ class Concurrent::Promises::Event < ::Concurrent::Promises::AbstractEventFuture # # @return [Event] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#842 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#857 def |(event_or_future); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#899 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#910 def callback_on_resolution(state, args, callback); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#894 + # @raise [Concurrent::MultipleAssignmentError] + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#905 def rejected_resolution(raise_on_reassign, state); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1961 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1972 class Concurrent::Promises::EventWrapperPromise < ::Concurrent::Promises::BlockedPromise # @return [EventWrapperPromise] a new instance of EventWrapperPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1962 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1973 def initialize(delayed, blockers_count, default_executor); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1968 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1979 def on_resolvable(resolved_future, index); end end # Container of all {Future}, {Event} factory methods. They are never constructed directly with # new. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#44 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#46 module Concurrent::Promises::FactoryMethods include ::Concurrent::Promises::FactoryMethods::Configuration extend ::Concurrent::ReInclude - extend ::Concurrent::Promises::FactoryMethods extend ::Concurrent::Promises::FactoryMethods::Configuration + extend ::Concurrent::Promises::FactoryMethods # Shortcut of {#any_resolved_future_on} with default `:io` executor supplied. # # @return [Future] # @see #any_resolved_future_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#276 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#282 def any(*futures_and_or_events); end # Shortcut of {#any_event_on} with default `:io` executor supplied. # - # @return [Future] + # @return [Event] # @see #any_event_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#317 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#319 def any_event(*futures_and_or_events); end - # Creates new event which becomes resolved after first of the futures_and_or_events resolves. + # Creates a new event which becomes resolved after the first futures_and_or_events resolves. # If resolved it does not propagate {Concurrent::AbstractEventFuture#touch}, leaving delayed # futures un-executed if they are not required any more. # @@ -6978,7 +7205,7 @@ module Concurrent::Promises::FactoryMethods # @param futures_and_or_events [AbstractEventFuture] # @return [Event] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#327 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#329 def any_event_on(default_executor, *futures_and_or_events); end # Shortcut of {#any_fulfilled_future_on} with default `:io` executor supplied. @@ -6986,12 +7213,12 @@ module Concurrent::Promises::FactoryMethods # @return [Future] # @see #any_fulfilled_future_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#298 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#300 def any_fulfilled_future(*futures_and_or_events); end - # Creates new future which is resolved after first of futures_and_or_events is fulfilled. - # Its result equals result of the first resolved future or if all futures_and_or_events reject, - # it has reason of the last resolved future. + # Creates a new future which is resolved after the first futures_and_or_events is fulfilled. + # Its result equals the result of the first resolved future or if all futures_and_or_events reject, + # it has reason of the last rejected future. # If resolved it does not propagate {Concurrent::AbstractEventFuture#touch}, leaving delayed # futures un-executed if they are not required any more. # If event is supplied, which does not have value and can be only resolved, it's @@ -7003,7 +7230,7 @@ module Concurrent::Promises::FactoryMethods # @param futures_and_or_events [AbstractEventFuture] # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#311 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#313 def any_fulfilled_future_on(default_executor, *futures_and_or_events); end # Shortcut of {#any_resolved_future_on} with default `:io` executor supplied. @@ -7011,11 +7238,11 @@ module Concurrent::Promises::FactoryMethods # @return [Future] # @see #any_resolved_future_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#276 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#278 def any_resolved_future(*futures_and_or_events); end - # Creates new future which is resolved after first futures_and_or_events is resolved. - # Its result equals result of the first resolved future. + # Creates a new future which is resolved after the first futures_and_or_events is resolved. + # Its result equals the result of the first resolved future. # If resolved it does not propagate {Concurrent::AbstractEventFuture#touch}, leaving delayed # futures un-executed if they are not required any more. # If event is supplied, which does not have value and can be only resolved, it's @@ -7027,7 +7254,7 @@ module Concurrent::Promises::FactoryMethods # @param futures_and_or_events [AbstractEventFuture] # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#292 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#294 def any_resolved_future_on(default_executor, *futures_and_or_events); end # Shortcut of {#delay_on} with default `:io` executor supplied. @@ -7035,10 +7262,10 @@ module Concurrent::Promises::FactoryMethods # @return [Future, Event] # @see #delay_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#188 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#190 def delay(*args, &task); end - # Creates new event or future which is resolved only after it is touched, + # Creates a new event or future which is resolved only after it is touched, # see {Concurrent::AbstractEventFuture#touch}. # # @overload delay_on @@ -7047,10 +7274,10 @@ module Concurrent::Promises::FactoryMethods # global executor. Default executor propagates to chained futures unless overridden with # executor parameter or changed with {AbstractEventFuture#with_default_executor}. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#205 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#207 def delay_on(default_executor, *args, &task); end - # Creates resolved future with will be fulfilled with the given value. + # Creates a resolved future which will be fulfilled with the given value. # # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the # global executor. Default executor propagates to chained futures unless overridden with @@ -7058,7 +7285,7 @@ module Concurrent::Promises::FactoryMethods # @param value [Object] # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#125 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#127 def fulfilled_future(value, default_executor = T.unsafe(nil)); end # Shortcut of {#future_on} with default `:io` executor supplied. @@ -7066,24 +7293,24 @@ module Concurrent::Promises::FactoryMethods # @return [Future] # @see #future_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#92 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#94 def future(*args, &task); end - # Constructs new Future which will be resolved after block is evaluated on default executor. + # Constructs a new Future which will be resolved after block is evaluated on default executor. # Evaluation begins immediately. # + # @param args [Object] arguments which are passed to the task when it's executed. + # (It might be prepended with other arguments, see the @yield section). # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the # global executor. Default executor propagates to chained futures unless overridden with # executor parameter or changed with {AbstractEventFuture#with_default_executor}. - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yeild section). # @return [Future] # @yield [*args] to the task. # @yieldreturn will become result of the returned Future. # Its returned value becomes {Future#value} fulfilling it, # raised exception becomes {Future#reason} rejecting it. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#104 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#106 def future_on(default_executor, *args, &task); end # General constructor. Behaves differently based on the argument's type. It's provided for convenience @@ -7100,10 +7327,10 @@ module Concurrent::Promises::FactoryMethods # @return [Event, Future] # @see rejected_future, resolved_event, fulfilled_future # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#172 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#174 def make_future(argument = T.unsafe(nil), default_executor = T.unsafe(nil)); end - # Creates resolved future with will be rejected with the given reason. + # Creates a resolved future which will be rejected with the given reason. # # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the # global executor. Default executor propagates to chained futures unless overridden with @@ -7111,7 +7338,7 @@ module Concurrent::Promises::FactoryMethods # @param reason [Object] # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#134 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#136 def rejected_future(reason, default_executor = T.unsafe(nil)); end # Shortcut of {#resolvable_event_on} with default `:io` executor supplied. @@ -7119,18 +7346,18 @@ module Concurrent::Promises::FactoryMethods # @return [ResolvableEvent] # @see #resolvable_event_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#61 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#63 def resolvable_event; end - # Created resolvable event, user is responsible for resolving the event once by - # {Promises::ResolvableEvent#resolve}. + # Creates a resolvable event, user is responsible for resolving the event once + # by calling {Promises::ResolvableEvent#resolve}. # # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the # global executor. Default executor propagates to chained futures unless overridden with # executor parameter or changed with {AbstractEventFuture#with_default_executor}. # @return [ResolvableEvent] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#70 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#72 def resolvable_event_on(default_executor = T.unsafe(nil)); end # Shortcut of {#resolvable_future_on} with default `:io` executor supplied. @@ -7138,7 +7365,7 @@ module Concurrent::Promises::FactoryMethods # @return [ResolvableFuture] # @see #resolvable_future_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#76 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#78 def resolvable_future; end # Creates resolvable future, user is responsible for resolving the future once by @@ -7150,7 +7377,7 @@ module Concurrent::Promises::FactoryMethods # executor parameter or changed with {AbstractEventFuture#with_default_executor}. # @return [ResolvableFuture] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#86 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#88 def resolvable_future_on(default_executor = T.unsafe(nil)); end # Creates resolved event. @@ -7160,21 +7387,21 @@ module Concurrent::Promises::FactoryMethods # executor parameter or changed with {AbstractEventFuture#with_default_executor}. # @return [Event] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#142 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#144 def resolved_event(default_executor = T.unsafe(nil)); end - # Creates resolved future with will be either fulfilled with the given value or rejection with + # Creates a resolved future with will be either fulfilled with the given value or rejected with # the given reason. # - # @param fulfilled [true, false] - # @param value [Object] - # @param reason [Object] # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the # global executor. Default executor propagates to chained futures unless overridden with # executor parameter or changed with {AbstractEventFuture#with_default_executor}. + # @param fulfilled [true, false] + # @param reason [Object] + # @param value [Object] # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#116 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#118 def resolved_future(fulfilled, value, reason, default_executor = T.unsafe(nil)); end # Shortcut of {#schedule_on} with default `:io` executor supplied. @@ -7182,10 +7409,10 @@ module Concurrent::Promises::FactoryMethods # @return [Future, Event] # @see #schedule_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#212 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#214 def schedule(intended_time, *args, &task); end - # Creates new event or future which is resolved in intended_time. + # Creates a new event or future which is resolved in intended_time. # # @overload schedule_on # @overload schedule_on @@ -7195,7 +7422,7 @@ module Concurrent::Promises::FactoryMethods # @param intended_time [Numeric, Time] `Numeric` means to run in `intended_time` seconds. # `Time` means to run on `intended_time`. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#231 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#233 def schedule_on(default_executor, intended_time, *args, &task); end # Shortcut of {#zip_futures_on} with default `:io` executor supplied. @@ -7203,7 +7430,7 @@ module Concurrent::Promises::FactoryMethods # @return [Future] # @see #zip_futures_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#238 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#258 def zip(*futures_and_or_events); end # Shortcut of {#zip_events_on} with default `:io` executor supplied. @@ -7211,10 +7438,10 @@ module Concurrent::Promises::FactoryMethods # @return [Event] # @see #zip_events_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#260 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#262 def zip_events(*futures_and_or_events); end - # Creates new event which is resolved after all futures_and_or_events are resolved. + # Creates a new event which is resolved after all futures_and_or_events are resolved. # (Future is resolved when fulfilled or rejected.) # # @param default_executor [Executor, :io, :fast] Instance of an executor or a name of the @@ -7223,7 +7450,7 @@ module Concurrent::Promises::FactoryMethods # @param futures_and_or_events [AbstractEventFuture] # @return [Event] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#270 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#272 def zip_events_on(default_executor, *futures_and_or_events); end # Shortcut of {#zip_futures_on} with default `:io` executor supplied. @@ -7231,11 +7458,11 @@ module Concurrent::Promises::FactoryMethods # @return [Future] # @see #zip_futures_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#238 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#240 def zip_futures(*futures_and_or_events); end - # Creates new future which is resolved after all futures_and_or_events are resolved. - # Its value is array of zipped future values. Its reason is array of reasons for rejection. + # Creates a new future which is resolved after all futures_and_or_events are resolved. + # Its value is an array of zipped future values. Its reason is an array of reasons for rejection. # If there is an error it rejects. # If event is supplied, which does not have value and can be only resolved, it's # represented as `:fulfilled` with value `nil`. @@ -7246,51 +7473,51 @@ module Concurrent::Promises::FactoryMethods # @param futures_and_or_events [AbstractEventFuture] # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#252 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#254 def zip_futures_on(default_executor, *futures_and_or_events); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#48 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#50 module Concurrent::Promises::FactoryMethods::Configuration # @return [Executor, :io, :fast] the executor which is used when none is supplied # to a factory method. The method can be overridden in the receivers of # `include FactoryMethod` # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#52 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#54 def default_executor; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1829 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1840 class Concurrent::Promises::FlatEventPromise < ::Concurrent::Promises::AbstractFlatPromise # @return [FlatEventPromise] a new instance of FlatEventPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1833 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1844 def initialize(delayed, blockers_count, default_executor); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1837 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1848 def process_on_blocker_resolution(future, index); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1862 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1873 class Concurrent::Promises::FlatFuturePromise < ::Concurrent::Promises::AbstractFlatPromise # @raise [ArgumentError] # @return [FlatFuturePromise] a new instance of FlatFuturePromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1866 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1877 def initialize(delayed, blockers_count, levels, default_executor); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1873 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1884 def process_on_blocker_resolution(future, index); end end # Represents a value which will become available in future. May reject with a reason instead, # e.g. when the tasks raises an exception. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#906 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#917 class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # Creates a new event or a future which will be resolved when receiver and other are. # Returns an event if receiver and other are events, otherwise returns a future. @@ -7300,7 +7527,7 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1059 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1078 def &(other); end # Creates a new event which will be resolved when the first of receiver, `event_or_future` @@ -7309,10 +7536,10 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1074 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1085 def any(event_or_future); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1204 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1215 def apply(args, block); end # Creates new future dependent on receiver which will not evaluate until touched, see {#touch}. @@ -7320,7 +7547,7 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1084 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1095 def delay; end # Allows rejected Future to be risen with `raise` method. @@ -7332,7 +7559,7 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # @raise [Concurrent::Error] when raising not rejected future # @return [Exception] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1002 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1013 def exception(*args); end # Creates new future which will have result of the future returned by receiver. If receiver @@ -7341,7 +7568,7 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # @param level [Integer] how many levels of futures should flatten # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1109 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1124 def flat(level = T.unsafe(nil)); end # Creates new event which will be resolved when the returned event by receiver is. @@ -7349,7 +7576,7 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # # @return [Event] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1119 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1130 def flat_event; end # Creates new future which will have result of the future returned by receiver. If receiver @@ -7358,19 +7585,19 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # @param level [Integer] how many levels of futures should flatten # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1109 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1120 def flat_future(level = T.unsafe(nil)); end # Is it in fulfilled state? # # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#910 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#921 def fulfilled?; end # @return [String] Short string representation. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1224 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1243 def inspect; end # Shortcut of {#on_fulfillment_using} with default `:io` executor supplied. @@ -7378,33 +7605,33 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # @return [self] # @see #on_fulfillment_using # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1125 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1136 def on_fulfillment(*args, &callback); end # Stores the callback to be executed synchronously on resolving thread after it is # fulfilled. Does nothing on rejection. # # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yeild section). + # (It might be prepended with other arguments, see the @yield section). # @return [self] # @yield [value, *args] to the callback. # @yieldreturn is forgotten. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1136 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1147 def on_fulfillment!(*args, &callback); end # Stores the callback to be executed asynchronously on executor after it is # fulfilled. Does nothing on rejection. # + # @param args [Object] arguments which are passed to the task when it's executed. + # (It might be prepended with other arguments, see the @yield section). # @param executor [Executor, :io, :fast] Instance of an executor or a name of the # global executor. The task is executed on it, default executor remains unchanged. - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yeild section). # @return [self] # @yield [value, *args] to the callback. # @yieldreturn is forgotten. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1148 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1159 def on_fulfillment_using(executor, *args, &callback); end # Shortcut of {#on_rejection_using} with default `:io` executor supplied. @@ -7412,33 +7639,33 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # @return [self] # @see #on_rejection_using # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1154 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1165 def on_rejection(*args, &callback); end # Stores the callback to be executed synchronously on resolving thread after it is # rejected. Does nothing on fulfillment. # # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yeild section). + # (It might be prepended with other arguments, see the @yield section). # @return [self] # @yield [reason, *args] to the callback. # @yieldreturn is forgotten. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1165 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1176 def on_rejection!(*args, &callback); end # Stores the callback to be executed asynchronously on executor after it is # rejected. Does nothing on fulfillment. # + # @param args [Object] arguments which are passed to the task when it's executed. + # (It might be prepended with other arguments, see the @yield section). # @param executor [Executor, :io, :fast] Instance of an executor or a name of the # global executor. The task is executed on it, default executor remains unchanged. - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yeild section). # @return [self] # @yield [reason, *args] to the callback. # @yieldreturn is forgotten. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1177 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1188 def on_rejection_using(executor, *args, &callback); end # Returns reason of future's rejection. @@ -7453,14 +7680,14 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # @param timeout_value [Object] a value returned by the method when it times out # @return [Object, timeout_value] the reason, or timeout_value on timeout, or nil on fulfillment. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#955 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#966 def reason(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end # Is it in rejected state? # # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#917 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#928 def rejected?; end # Shortcut of {#rescue_on} with default `:io` executor supplied. @@ -7468,23 +7695,23 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # @return [Future] # @see #rescue_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1041 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1052 def rescue(*args, &task); end # Chains the task to be executed asynchronously on executor after it rejects. Does not run # the task if it fulfills. It will resolve though, triggering any dependent futures. # + # @param args [Object] arguments which are passed to the task when it's executed. + # (It might be prepended with other arguments, see the @yield section). # @param executor [Executor, :io, :fast] Instance of an executor or a name of the # global executor. The task is executed on it, default executor remains unchanged. - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yeild section). # @return [Future] # @yield [reason, *args] to the task. # @yieldreturn will become result of the returned Future. # Its returned value becomes {Future#value} fulfilling it, # raised exception becomes {Future#reason} rejecting it. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1053 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1064 def rescue_on(executor, *args, &task); end # Returns triplet fulfilled?, value, reason. @@ -7496,7 +7723,7 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # @return [Array(Boolean, Object, Object), nil] triplet of fulfilled?, value, reason, or nil # on timeout. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#970 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#981 def result(timeout = T.unsafe(nil)); end # Allows to use futures as green threads. The receiver has to evaluate to a future which @@ -7517,7 +7744,7 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # which is suppose to continue running. # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1199 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1210 def run(run_test = T.unsafe(nil)); end # Creates new event dependent on receiver scheduled to execute on/in intended_time. @@ -7528,7 +7755,7 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # `Time` means to run on `intended_time`. # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1091 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1102 def schedule(intended_time); end # Shortcut of {#then_on} with default `:io` executor supplied. @@ -7536,42 +7763,42 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # @return [Future] # @see #then_on # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1023 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1034 def then(*args, &task); end # Chains the task to be executed asynchronously on executor after it fulfills. Does not run # the task if it rejects. It will resolve though, triggering any dependent futures. # + # @param args [Object] arguments which are passed to the task when it's executed. + # (It might be prepended with other arguments, see the @yield section). # @param executor [Executor, :io, :fast] Instance of an executor or a name of the # global executor. The task is executed on it, default executor remains unchanged. - # @param args [Object] arguments which are passed to the task when it's executed. - # (It might be prepended with other arguments, see the @yeild section). # @return [Future] # @yield [value, *args] to the task. # @yieldreturn will become result of the returned Future. # Its returned value becomes {Future#value} fulfilling it, # raised exception becomes {Future#reason} rejecting it. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1035 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1046 def then_on(executor, *args, &task); end # Converts future to event which is resolved when future is resolved by fulfillment or rejection. # # @return [Event] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1211 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1222 def to_event; end # Returns self, since this is a future # # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1219 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1230 def to_future; end # @return [String] Short string representation. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1224 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1235 def to_s; end # Return value of the future. @@ -7588,7 +7815,7 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # timeout_value on timeout, # nil on rejection. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#939 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#950 def value(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end # Return value of the future. @@ -7606,7 +7833,7 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # or nil on rejection, # or timeout_value on timeout. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#986 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#997 def value!(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil)); end # Wait (block the Thread) until receiver is {#resolved?}. @@ -7619,7 +7846,7 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # @return [self, true, false] self implies timeout was not used, true implies timeout was used # and it was resolved, false implies it was not resolved within timeout. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#976 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#987 def wait!(timeout = T.unsafe(nil)); end # Crates new object with same class with the executor set as its new default executor. @@ -7627,7 +7854,7 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1100 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1111 def with_default_executor(executor); end # Creates a new event or a future which will be resolved when receiver and other are. @@ -7638,7 +7865,7 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1059 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1070 def zip(other); end # Creates a new event which will be resolved when the first of receiver, `event_or_future` @@ -7647,253 +7874,253 @@ class Concurrent::Promises::Future < ::Concurrent::Promises::AbstractEventFuture # # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1074 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1089 def |(event_or_future); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1261 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1272 def async_callback_on_fulfillment(state, executor, args, callback); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1267 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1278 def async_callback_on_rejection(state, executor, args, callback); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1273 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1284 def callback_on_fulfillment(state, args, callback); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1277 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1288 def callback_on_rejection(state, args, callback); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1281 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1292 def callback_on_resolution(state, args, callback); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1240 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1251 def rejected_resolution(raise_on_reassign, state); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1236 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1247 def run_test(v); end # @raise [self] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1255 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1266 def wait_until_resolved!(timeout = T.unsafe(nil)); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1973 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1984 class Concurrent::Promises::FutureWrapperPromise < ::Concurrent::Promises::BlockedPromise # @return [FutureWrapperPromise] a new instance of FutureWrapperPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1974 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1985 def initialize(delayed, blockers_count, default_executor); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1980 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1991 def on_resolvable(resolved_future, index); end end # will be immediately resolved # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1772 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1783 class Concurrent::Promises::ImmediateEventPromise < ::Concurrent::Promises::InnerPromise # @return [ImmediateEventPromise] a new instance of ImmediateEventPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1773 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1784 def initialize(default_executor); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1778 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1789 class Concurrent::Promises::ImmediateFuturePromise < ::Concurrent::Promises::InnerPromise # @return [ImmediateFuturePromise] a new instance of ImmediateFuturePromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1779 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1790 def initialize(default_executor, fulfilled, value, reason); end end # @abstract # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1604 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1615 class Concurrent::Promises::InnerPromise < ::Concurrent::Promises::AbstractPromise; end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#336 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#338 module Concurrent::Promises::InternalStates; end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#395 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#397 class Concurrent::Promises::InternalStates::Fulfilled < ::Concurrent::Promises::InternalStates::ResolvedWithResult # @return [Fulfilled] a new instance of Fulfilled # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#397 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#399 def initialize(value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#405 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#407 def apply(args, block); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#401 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#403 def fulfilled?; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#413 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#415 def reason; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#417 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#419 def to_sym; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#409 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#411 def value; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#423 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#425 class Concurrent::Promises::InternalStates::FulfilledArray < ::Concurrent::Promises::InternalStates::Fulfilled - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#424 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#426 def apply(args, block); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#486 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#488 Concurrent::Promises::InternalStates::PENDING = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Pending) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#457 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#459 class Concurrent::Promises::InternalStates::PartiallyRejected < ::Concurrent::Promises::InternalStates::ResolvedWithResult # @return [PartiallyRejected] a new instance of PartiallyRejected # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#458 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#460 def initialize(value, reason); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#480 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#482 def apply(args, block); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#464 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#466 def fulfilled?; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#476 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#478 def reason; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#468 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#470 def to_sym; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#472 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#474 def value; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#349 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#351 class Concurrent::Promises::InternalStates::Pending < ::Concurrent::Promises::InternalStates::State # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#350 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#352 def resolved?; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#354 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#356 def to_sym; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#488 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#490 Concurrent::Promises::InternalStates::RESERVED = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Reserved) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#490 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#492 Concurrent::Promises::InternalStates::RESOLVED = T.let(T.unsafe(nil), Concurrent::Promises::InternalStates::Fulfilled) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#430 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#432 class Concurrent::Promises::InternalStates::Rejected < ::Concurrent::Promises::InternalStates::ResolvedWithResult # @return [Rejected] a new instance of Rejected # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#431 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#433 def initialize(reason); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#451 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#453 def apply(args, block); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#435 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#437 def fulfilled?; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#443 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#445 def reason; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#447 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#449 def to_sym; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#439 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#441 def value; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#360 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#362 class Concurrent::Promises::InternalStates::Reserved < ::Concurrent::Promises::InternalStates::Pending; end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#364 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#366 class Concurrent::Promises::InternalStates::ResolvedWithResult < ::Concurrent::Promises::InternalStates::State # @raise [NotImplementedError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#389 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#391 def apply; end # @raise [NotImplementedError] # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#377 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#379 def fulfilled?; end # @raise [NotImplementedError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#385 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#387 def reason; end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#365 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#367 def resolved?; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#373 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#375 def result; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#369 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#371 def to_sym; end # @raise [NotImplementedError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#381 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#383 def value; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#338 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#340 class Concurrent::Promises::InternalStates::State # @raise [NotImplementedError] # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#339 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#341 def resolved?; end # @raise [NotImplementedError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#343 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#345 def to_sym; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1737 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1748 class Concurrent::Promises::RescuePromise < ::Concurrent::Promises::BlockedTaskPromise # @return [RescuePromise] a new instance of RescuePromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1740 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1751 def initialize(delayed, blockers_count, default_executor, executor, args, &task); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1744 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1755 def on_resolvable(resolved_future, index); end end # Marker module of Future, Event resolved manually. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1288 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1299 module Concurrent::Promises::Resolvable include ::Concurrent::Promises::InternalStates end # A Event which can be resolved by user. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1293 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1304 class Concurrent::Promises::ResolvableEvent < ::Concurrent::Promises::Event include ::Concurrent::Promises::Resolvable @@ -7903,10 +8130,10 @@ class Concurrent::Promises::ResolvableEvent < ::Concurrent::Promises::Event # @param reserved [true, false] Set to true if the resolvable is {#reserve}d by you, # marks resolution of reserved resolvable events and futures explicitly. # Advanced feature, ignore unless you use {Resolvable#reserve} from edge. - # @return [self, false] false is returner when raise_on_reassign is false and the receiver + # @return [self, false] false is returned when raise_on_reassign is false and the receiver # is already resolved. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1313 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1324 def resolve(raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end # Behaves as {AbstractEventFuture#wait} but has one additional optional argument @@ -7916,28 +8143,28 @@ class Concurrent::Promises::ResolvableEvent < ::Concurrent::Promises::Event # @return [self, true, false] # @see AbstractEventFuture#wait # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1331 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1342 def wait(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end # Creates new event wrapping receiver, effectively hiding the resolve method. # # @return [Event] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1320 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1331 def with_hidden_resolvable; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1589 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1600 class Concurrent::Promises::ResolvableEventPromise < ::Concurrent::Promises::AbstractPromise # @return [ResolvableEventPromise] a new instance of ResolvableEventPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1590 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1601 def initialize(default_executor); end end # A Future which can be resolved by user. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1343 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1354 class Concurrent::Promises::ResolvableFuture < ::Concurrent::Promises::Future include ::Concurrent::Promises::Resolvable @@ -7948,7 +8175,7 @@ class Concurrent::Promises::ResolvableFuture < ::Concurrent::Promises::Future # @yield [*args] to the block. # @yieldreturn [Object] value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1384 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1395 def evaluate_to(*args, &block); end # Evaluates the block and sets its result as future's value fulfilling, if the block raises @@ -7959,21 +8186,21 @@ class Concurrent::Promises::ResolvableFuture < ::Concurrent::Promises::Future # @yield [*args] to the block. # @yieldreturn [Object] value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1395 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1406 def evaluate_to!(*args, &block); end # Makes the future fulfilled with `value`, # which triggers all dependent futures. # - # @param value [Object] # @param raise_on_reassign [Boolean] should method raise exception if already resolved # @param reserved [true, false] Set to true if the resolvable is {#reserve}d by you, # marks resolution of reserved resolvable events and futures explicitly. # Advanced feature, ignore unless you use {Resolvable#reserve} from edge. - # @return [self, false] false is returner when raise_on_reassign is false and the receiver + # @param value [Object] + # @return [self, false] false is returned when raise_on_reassign is false and the receiver # is already resolved. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1364 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1375 def fulfill(value, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end # Behaves as {Future#reason} but has one additional optional argument @@ -7984,37 +8211,37 @@ class Concurrent::Promises::ResolvableFuture < ::Concurrent::Promises::Future # @return [Exception, timeout_value, nil] # @see Future#reason # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1492 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1503 def reason(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end # Makes the future rejected with `reason`, # which triggers all dependent futures. # - # @param reason [Object] # @param raise_on_reassign [Boolean] should method raise exception if already resolved + # @param reason [Object] # @param reserved [true, false] Set to true if the resolvable is {#reserve}d by you, # marks resolution of reserved resolvable events and futures explicitly. # Advanced feature, ignore unless you use {Resolvable#reserve} from edge. - # @return [self, false] false is returner when raise_on_reassign is false and the receiver + # @return [self, false] false is returned when raise_on_reassign is false and the receiver # is already resolved. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1374 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1385 def reject(reason, raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end # Makes the future resolved with result of triplet `fulfilled?`, `value`, `reason`, # which triggers all dependent futures. # # @param fulfilled [true, false] - # @param value [Object] - # @param reason [Object] # @param raise_on_reassign [Boolean] should method raise exception if already resolved + # @param reason [Object] # @param reserved [true, false] Set to true if the resolvable is {#reserve}d by you, # marks resolution of reserved resolvable events and futures explicitly. # Advanced feature, ignore unless you use {Resolvable#reserve} from edge. - # @return [self, false] false is returner when raise_on_reassign is false and the receiver + # @param value [Object] + # @return [self, false] false is returned when raise_on_reassign is false and the receiver # is already resolved. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1354 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1365 def resolve(fulfilled = T.unsafe(nil), value = T.unsafe(nil), reason = T.unsafe(nil), raise_on_reassign = T.unsafe(nil), reserved = T.unsafe(nil)); end # Behaves as {Future#result} but has one additional optional argument @@ -8025,7 +8252,7 @@ class Concurrent::Promises::ResolvableFuture < ::Concurrent::Promises::Future # @return [::Array(Boolean, Object, Exception), nil] # @see Future#result # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1513 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1524 def result(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end # Behaves as {Future#value} but has one additional optional argument @@ -8036,7 +8263,7 @@ class Concurrent::Promises::ResolvableFuture < ::Concurrent::Promises::Future # @return [Object, timeout_value, nil] # @see Future#value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1448 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1459 def value(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end # Behaves as {Future#value!} but has one additional optional argument @@ -8048,7 +8275,7 @@ class Concurrent::Promises::ResolvableFuture < ::Concurrent::Promises::Future # @return [Object, timeout_value, nil] # @see Future#value! # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1470 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1481 def value!(timeout = T.unsafe(nil), timeout_value = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end # Behaves as {AbstractEventFuture#wait} but has one additional optional argument @@ -8059,7 +8286,7 @@ class Concurrent::Promises::ResolvableFuture < ::Concurrent::Promises::Future # @return [self, true, false] # @see AbstractEventFuture#wait # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1410 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1421 def wait(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end # Behaves as {Future#wait!} but has one additional optional argument @@ -8071,120 +8298,123 @@ class Concurrent::Promises::ResolvableFuture < ::Concurrent::Promises::Future # @return [self, true, false] # @see Future#wait! # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1427 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1438 def wait!(timeout = T.unsafe(nil), resolve_on_timeout = T.unsafe(nil)); end # Creates new future wrapping receiver, effectively hiding the resolve method and similar. # # @return [Future] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1531 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1542 def with_hidden_resolvable; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1595 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1606 class Concurrent::Promises::ResolvableFuturePromise < ::Concurrent::Promises::AbstractPromise # @return [ResolvableFuturePromise] a new instance of ResolvableFuturePromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1596 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1607 def initialize(default_executor); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1611 + def evaluate_to(*args, block); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1898 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1909 class Concurrent::Promises::RunFuturePromise < ::Concurrent::Promises::AbstractFlatPromise # @return [RunFuturePromise] a new instance of RunFuturePromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1902 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1913 def initialize(delayed, blockers_count, default_executor, run_test); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1907 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1918 def process_on_blocker_resolution(future, index); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2103 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2114 class Concurrent::Promises::ScheduledPromise < ::Concurrent::Promises::InnerPromise # @return [ScheduledPromise] a new instance of ScheduledPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2114 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2125 def initialize(default_executor, intended_time); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2108 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2119 def inspect; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2104 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2115 def intended_time; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1719 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1730 class Concurrent::Promises::ThenPromise < ::Concurrent::Promises::BlockedTaskPromise # @return [ThenPromise] a new instance of ThenPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1722 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1733 def initialize(delayed, blockers_count, default_executor, executor, args, &task); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1726 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1737 def on_resolvable(resolved_future, index); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1929 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1940 class Concurrent::Promises::ZipEventEventPromise < ::Concurrent::Promises::BlockedPromise # @return [ZipEventEventPromise] a new instance of ZipEventEventPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1930 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1941 def initialize(delayed, blockers_count, default_executor); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1936 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1947 def on_resolvable(resolved_future, index); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2020 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2031 class Concurrent::Promises::ZipEventsPromise < ::Concurrent::Promises::BlockedPromise # @return [ZipEventsPromise] a new instance of ZipEventsPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2024 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2035 def initialize(delayed, blockers_count, default_executor); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2030 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2041 def on_resolvable(resolved_future, index); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1941 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1952 class Concurrent::Promises::ZipFutureEventPromise < ::Concurrent::Promises::BlockedPromise # @return [ZipFutureEventPromise] a new instance of ZipFutureEventPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1942 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1953 def initialize(delayed, blockers_count, default_executor); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1956 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1967 def on_resolvable(resolved_future, index); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1949 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1960 def process_on_blocker_resolution(future, index); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1985 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1996 class Concurrent::Promises::ZipFuturesPromise < ::Concurrent::Promises::BlockedPromise # @return [ZipFuturesPromise] a new instance of ZipFuturesPromise # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1989 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2000 def initialize(delayed, blockers_count, default_executor); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2002 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2013 def on_resolvable(resolved_future, index); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#1996 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/promises.rb#2007 def process_on_blocker_resolution(future, index); end end @@ -8220,15 +8450,15 @@ end # C1.new.respond_to? :a # => false # C2.new.respond_to? :a # => true # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/re_include.rb#34 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/re_include.rb#36 module Concurrent::ReInclude - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/re_include.rb#42 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/re_include.rb#44 def extended(base); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/re_include.rb#48 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/re_include.rb#50 def include(*modules); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/re_include.rb#36 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/re_include.rb#38 def included(base); end end @@ -8253,13 +8483,15 @@ end # This will lead to deadlock # @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html java.util.concurrent.ReentrantReadWriteLock # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#30 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#31 class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + # Create a new `ReadWriteLock` in the unlocked state. # # @return [ReadWriteLock] a new instance of ReadWriteLock # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#58 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#59 def initialize; end # Acquire a read lock. If a write lock has been acquired will block until @@ -8269,7 +8501,7 @@ class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object # is exceeded. # @return [Boolean] true if the lock is successfully acquired # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#110 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#111 def acquire_read_lock; end # Acquire a write lock. Will block and wait for all active readers and writers. @@ -8278,28 +8510,28 @@ class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object # is exceeded. # @return [Boolean] true if the lock is successfully acquired # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#159 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#160 def acquire_write_lock; end # Queries whether any threads are waiting to acquire the read or write lock. # # @return [Boolean] true if any threads are waiting for a lock else false # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#213 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#214 def has_waiters?; end # Release a previously acquired read lock. # # @return [Boolean] true if the lock is successfully released # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#139 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#140 def release_read_lock; end # Release a previously acquired write lock. # # @return [Boolean] true if the lock is successfully released # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#195 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#196 def release_write_lock; end # Execute a block operation within a read lock. @@ -8310,7 +8542,7 @@ class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object # @return [Object] the result of the block operation. # @yield the task to be performed within the lock. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#74 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#75 def with_read_lock; end # Execute a block operation within a write lock. @@ -8321,65 +8553,60 @@ class Concurrent::ReadWriteLock < ::Concurrent::Synchronization::Object # @return [Object] the result of the block operation. # @yield the task to be performed within the lock. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#93 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#94 def with_write_lock; end # Queries if the write lock is held by any thread. # # @return [Boolean] true if the write lock is held else false` # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#206 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#207 def write_locked?; end private # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#245 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#246 def max_readers?(c = T.unsafe(nil)); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#250 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#251 def max_writers?(c = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#220 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#221 def running_readers(c = T.unsafe(nil)); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#225 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#226 def running_readers?(c = T.unsafe(nil)); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#230 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#231 def running_writer?(c = T.unsafe(nil)); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#240 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#241 def waiting_writer?(c = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#235 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#236 def waiting_writers(c = T.unsafe(nil)); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 - def new(*args, &block); end - end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#39 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#40 Concurrent::ReadWriteLock::MAX_READERS = T.let(T.unsafe(nil), Integer) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#42 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#43 Concurrent::ReadWriteLock::MAX_WRITERS = T.let(T.unsafe(nil), Integer) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#36 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#37 Concurrent::ReadWriteLock::RUNNING_WRITER = T.let(T.unsafe(nil), Integer) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#33 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb#34 Concurrent::ReadWriteLock::WAITING_WRITER = T.let(T.unsafe(nil), Integer) # Re-entrant read-write lock implementation @@ -8423,13 +8650,15 @@ Concurrent::ReadWriteLock::WAITING_WRITER = T.let(T.unsafe(nil), Integer) # lock.with_write_lock { data.modify! } # @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html java.util.concurrent.ReentrantReadWriteLock # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#51 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#53 class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + # Create a new `ReentrantReadWriteLock` in the unlocked state. # # @return [ReentrantReadWriteLock] a new instance of ReentrantReadWriteLock # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#107 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#109 def initialize; end # Acquire a read lock. If a write lock is held by another thread, will block @@ -8439,7 +8668,7 @@ class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object # is exceeded. # @return [Boolean] true if the lock is successfully acquired # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#160 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#162 def acquire_read_lock; end # Acquire a write lock. Will block and wait for all active readers and writers. @@ -8448,21 +8677,21 @@ class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object # is exceeded. # @return [Boolean] true if the lock is successfully acquired # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#255 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#257 def acquire_write_lock; end # Release a previously acquired read lock. # # @return [Boolean] true if the lock is successfully released # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#234 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#236 def release_read_lock; end # Release a previously acquired write lock. # # @return [Boolean] true if the lock is successfully released # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#327 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#329 def release_write_lock; end # Try to acquire a read lock and return true if we succeed. If it cannot be @@ -8470,7 +8699,7 @@ class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object # # @return [Boolean] true if the lock is successfully acquired # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#213 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#215 def try_read_lock; end # Try to acquire a write lock and return true if we succeed. If it cannot be @@ -8478,7 +8707,7 @@ class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object # # @return [Boolean] true if the lock is successfully acquired # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#308 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#310 def try_write_lock; end # Execute a block operation within a read lock. @@ -8489,7 +8718,7 @@ class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object # @return [Object] the result of the block operation. # @yield the task to be performed within the lock. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#124 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#126 def with_read_lock; end # Execute a block operation within a write lock. @@ -8500,77 +8729,72 @@ class Concurrent::ReentrantReadWriteLock < ::Concurrent::Synchronization::Object # @return [Object] the result of the block operation. # @yield the task to be performed within the lock. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#143 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#145 def with_write_lock; end private # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#368 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#370 def max_readers?(c = T.unsafe(nil)); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#373 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#375 def max_writers?(c = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#343 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#345 def running_readers(c = T.unsafe(nil)); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#348 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#350 def running_readers?(c = T.unsafe(nil)); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#353 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#355 def running_writer?(c = T.unsafe(nil)); end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#363 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#365 def waiting_or_running_writer?(c = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#358 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#360 def waiting_writers(c = T.unsafe(nil)); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 - def new(*args, &block); end - end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#92 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#94 Concurrent::ReentrantReadWriteLock::MAX_READERS = T.let(T.unsafe(nil), Integer) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#94 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#96 Concurrent::ReentrantReadWriteLock::MAX_WRITERS = T.let(T.unsafe(nil), Integer) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#82 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#84 Concurrent::ReentrantReadWriteLock::READER_BITS = T.let(T.unsafe(nil), Integer) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#100 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#102 Concurrent::ReentrantReadWriteLock::READ_LOCK_MASK = T.let(T.unsafe(nil), Integer) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#90 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#92 Concurrent::ReentrantReadWriteLock::RUNNING_WRITER = T.let(T.unsafe(nil), Integer) # Used with @Counter: # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#88 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#90 Concurrent::ReentrantReadWriteLock::WAITING_WRITER = T.let(T.unsafe(nil), Integer) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#84 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#86 Concurrent::ReentrantReadWriteLock::WRITER_BITS = T.let(T.unsafe(nil), Integer) # Used with @HeldCount: # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#98 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#100 Concurrent::ReentrantReadWriteLock::WRITE_LOCK_HELD = T.let(T.unsafe(nil), Integer) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#102 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb#104 Concurrent::ReentrantReadWriteLock::WRITE_LOCK_MASK = T.let(T.unsafe(nil), Integer) # Raised by an `Executor` when it is unable to process a given task, @@ -8585,49 +8809,31 @@ class Concurrent::RejectedExecutionError < ::Concurrent::Error; end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/errors.rb#52 class Concurrent::ResourceLimitError < ::Concurrent::Error; end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#134 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#129 class Concurrent::RubyExchanger < ::Concurrent::AbstractExchanger + extend ::Concurrent::Synchronization::SafeInitialization + # @return [RubyExchanger] a new instance of RubyExchanger # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#159 def initialize; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#169 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#165 def __initialize_atomic_fields__; end - # Sets the slot to new_slot if the current slot is expected_slot - # - # @return [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#137 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#165 def compare_and_set_slot(expected, value); end - # @return [Object] The slot. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#125 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#165 def slot; end - # Set the slot. - # - # @return [Object] new_slot. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#129 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#165 def slot=(value); end - # Set the slot to new_slot and return the old slot. - # - # @return [Object] old slot - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#133 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#165 def swap_slot(value); end - # Updates the slot using the block. - # - # @return [Object] new slot - # @yield [Object] Calculate a new slot using given (old) slot - # @yieldparam old [Object] slot - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#141 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#165 def update_slot(&block); end private @@ -8639,34 +8845,27 @@ class Concurrent::RubyExchanger < ::Concurrent::AbstractExchanger # for the exchange. When the timeout value is `nil` the method will # block indefinitely. # - # @param value [Object] the value to exchange with another thread # @param timeout [Numeric, nil] in seconds, `nil` blocks indefinitely + # @param value [Object] the value to exchange with another thread # @return [Object, CANCEL] the value exchanged by the other thread; {CANCEL} on timeout # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#170 def do_exchange(value, timeout); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 - def new(*args, &block); end - end end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#138 class Concurrent::RubyExchanger::Node < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + # @return [Node] a new instance of Node # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#142 def initialize(item); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#169 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#139 def __initialize_atomic_fields__; end - # Sets the value to new_value if the current value is expected_value - # - # @return [true, false] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#137 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#139 def compare_and_set_value(expected, value); end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#153 @@ -8675,38 +8874,17 @@ class Concurrent::RubyExchanger::Node < ::Concurrent::Synchronization::Object # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#149 def latch; end - # Set the value to new_value and return the old value. - # - # @return [Object] old value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#133 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#139 def swap_value(value); end - # Updates the value using the block. - # - # @return [Object] new value - # @yield [Object] Calculate a new value using given (old) value - # @yieldparam old [Object] value - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#141 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#139 def update_value(&block); end - # @return [Object] The value. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#125 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#139 def value; end - # Set the value. - # - # @return [Object] new_value. - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#129 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/exchanger.rb#139 def value=(value); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 - def new(*args, &block); end - end end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#8 @@ -8716,17 +8894,40 @@ class Concurrent::RubyExecutorService < ::Concurrent::AbstractExecutorService # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#11 def initialize(*args, &block); end + # Begin an immediate shutdown. In-progress tasks will be allowed to + # complete but enqueued tasks will be dismissed and no new tasks + # will be accepted. Has no additional effect if the thread pool is + # not running. + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#42 def kill; end - # @raise [ArgumentError] + # Submit a task to the executor for asynchronous processing. + # + # @param args [Array] zero or more arguments to be passed to the task + # @raise [ArgumentError] if no task is given + # @return [Boolean] `true` if the task is queued, `false` if the executor + # is not running + # @yield the asynchronous task to perform # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#17 def post(*args, &task); end + # Begin an orderly shutdown. Tasks already in the queue will be executed, + # but no new tasks will be accepted. Has no additional effect if the + # thread pool is not running. + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#33 def shutdown; end + # Block until executor shutdown is complete or until `timeout` seconds have + # passed. + # + # @note Does not initiate shutdown or termination. Either `shutdown` or `kill` + # must be called before this method (or on another thread). + # @param timeout [Integer] the maximum number of seconds to wait for shutdown to complete + # @return [Boolean] `true` if shutdown complete or false on `timeout` + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb#52 def wait_for_termination(timeout = T.unsafe(nil)); end @@ -8757,160 +8958,199 @@ class Concurrent::RubyExecutorService < ::Concurrent::AbstractExecutorService def stopped_event; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb#8 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb#9 class Concurrent::RubySingleThreadExecutor < ::Concurrent::RubyThreadPoolExecutor + include ::Concurrent::SerialExecutorService + # @return [RubySingleThreadExecutor] a new instance of RubySingleThreadExecutor # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb#11 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb#13 def initialize(opts = T.unsafe(nil)); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#8 -class Concurrent::RubyThreadLocalVar < ::Concurrent::AbstractThreadLocalVar - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#54 - def value; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#70 - def value=(value); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#87 - def allocate_storage; end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#173 - def get_default; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#136 - def get_threadlocal_array(thread = T.unsafe(nil)); end - - # noinspection RubyClassVariableUsageInspection - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#126 - def next_index; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#140 - def set_threadlocal_array(array, thread = T.unsafe(nil)); end - - # This exists only for use in testing - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#157 - def value_for(thread); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#41 - def semi_sync(&block); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#111 - def thread_finalizer(id); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#94 - def thread_local_finalizer(index); end - end -end - -# Each thread has a (lazily initialized) array of thread-local variable values -# Each time a new thread-local var is created, we allocate an "index" for it -# For example, if the allocated index is 1, that means slot #1 in EVERY -# thread's thread-local array will be used for the value of that TLV +# **Thread Pool Options** # -# The good thing about using a per-THREAD structure to hold values, rather -# than a per-TLV structure, is that no synchronization is needed when -# reading and writing those values (since the structure is only ever -# accessed by a single thread) +# Thread pools support several configuration options: # -# Of course, when a TLV is GC'd, 1) we need to recover its index for use -# by other new TLVs (otherwise the thread-local arrays could get bigger -# and bigger with time), and 2) we need to null out all the references -# held in the now-unused slots (both to avoid blocking GC of those objects, -# and also to prevent "stale" values from being passed on to a new TLV -# when the index is reused) -# Because we need to null out freed slots, we need to keep references to -# ALL the thread-local arrays -- ARRAYS is for that -# But when a Thread is GC'd, we need to drop the reference to its thread-local -# array, so we don't leak memory +# * `idletime`: The number of seconds that a thread may be idle before being reclaimed. +# * `name`: The name of the executor (optional). Printed in the executor's `#to_s` output and +# a `-worker-` name is given to its threads if supported by used Ruby +# implementation. `` is uniq for each thread. +# * `max_queue`: The maximum number of tasks that may be waiting in the work queue at +# any one time. When the queue size reaches `max_queue` and no new threads can be created, +# subsequent tasks will be rejected in accordance with the configured `fallback_policy`. +# * `auto_terminate`: When true (default), the threads started will be marked as daemon. +# * `fallback_policy`: The policy defining how rejected tasks are handled. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#31 -Concurrent::RubyThreadLocalVar::FREE = T.let(T.unsafe(nil), Array) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#32 -Concurrent::RubyThreadLocalVar::LOCK = T.let(T.unsafe(nil), Thread::Mutex) - -# used as a hash set +# Three fallback policies are supported: # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb#33 -Concurrent::RubyThreadLocalVar::THREAD_LOCAL_ARRAYS = T.let(T.unsafe(nil), Hash) - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#12 +# * `:abort`: Raise a `RejectedExecutionError` exception and discard the task. +# * `:discard`: Discard the task and return false. +# * `:caller_runs`: Execute the task on the calling thread. +# +# **Shutting Down Thread Pools** +# +# Killing a thread pool while tasks are still being processed, either by calling +# the `#kill` method or at application exit, will have unpredictable results. There +# is no way for the thread pool to know what resources are being used by the +# in-progress tasks. When those tasks are killed the impact on those resources +# cannot be predicted. The *best* practice is to explicitly shutdown all thread +# pools using the provided methods: +# +# * Call `#shutdown` to initiate an orderly termination of all in-progress tasks +# * Call `#wait_for_termination` with an appropriate timeout interval an allow +# the orderly shutdown to complete +# * Call `#kill` *only when* the thread pool fails to shutdown in the allotted time +# +# On some runtime platforms (most notably the JVM) the application will not +# exit until all thread pools have been shutdown. To prevent applications from +# "hanging" on exit, all threads can be marked as daemon according to the +# `:auto_terminate` option. +# +# ```ruby +# pool1 = Concurrent::FixedThreadPool.new(5) # threads will be marked as daemon +# pool2 = Concurrent::FixedThreadPool.new(5, auto_terminate: false) # mark threads as non-daemon +# ``` +# +# @note Failure to properly shutdown a thread pool can lead to unpredictable results. +# Please read *Shutting Down Thread Pools* for more information. +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html Java Executors class +# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html Java ExecutorService interface +# @see http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html Java Tutorials: Thread Pools +# @see https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean- +# +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#13 class Concurrent::RubyThreadPoolExecutor < ::Concurrent::RubyExecutorService # @return [RubyThreadPoolExecutor] a new instance of RubyThreadPoolExecutor # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#45 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#47 def initialize(opts = T.unsafe(nil)); end - # @return [Boolean] + # The number of threads that are actively executing tasks. + # + # @return [Integer] The number of threads that are actively executing tasks. + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#67 + def active_count; end + + # Does the task queue have a maximum size? + # + # @return [Boolean] True if the task queue has a maximum size else false. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#65 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#74 def can_overflow?; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#60 + # The number of tasks that have been completed by the pool since construction. + # + # @return [Integer] The number of tasks that have been completed by the pool since construction. + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#62 def completed_task_count; end - # Returns the value of attribute idletime. + # The number of seconds that a thread may be idle before being reclaimed. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#36 + # @return [Integer] The number of seconds that a thread may be idle before being reclaimed. + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#38 def idletime; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#50 + # The largest number of threads that have been created in the pool since construction. + # + # @return [Integer] The largest number of threads that have been created in the pool since construction. + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#52 def largest_length; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#70 + # The number of threads currently in the pool. + # + # @return [Integer] The number of threads currently in the pool. + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#79 def length; end - # Returns the value of attribute max_length. + # The maximum number of threads that may be created in the pool. + # + # @return [Integer] The maximum number of threads that may be created in the pool. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#30 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#32 def max_length; end - # Returns the value of attribute max_queue. + # The maximum number of tasks that may be waiting in the work queue at any one time. + # When the queue size reaches `max_queue` subsequent tasks will be rejected in + # accordance with the configured `fallback_policy`. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#39 + # @return [Integer] The maximum number of tasks that may be waiting in the work queue at any one time. + # When the queue size reaches `max_queue` subsequent tasks will be rejected in + # accordance with the configured `fallback_policy`. + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#41 def max_queue; end - # Returns the value of attribute min_length. + # The minimum number of threads that may be retained in the pool. + # + # @return [Integer] The minimum number of threads that may be retained in the pool. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#33 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#35 def min_length; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#111 + # Prune the thread pool of unneeded threads + # + # What is being pruned is controlled by the min_threads and idletime + # parameters passed at pool creation time + # + # This is a no-op on all pool implementations as they prune themselves + # automatically, and has been deprecated. + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#139 def prune_pool; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#75 + # removes the worker if it can be pruned + # + # @return [true, false] if the worker was pruned + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#104 + def prune_worker(worker); end + + # The number of tasks in the queue awaiting execution. + # + # @return [Integer] The number of tasks in the queue awaiting execution. + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#84 def queue_length; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#96 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#124 def ready_worker(worker, last_message); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#80 + # Number of tasks that may be enqueued before reaching `max_queue` and rejecting + # new tasks. A value of -1 indicates that the queue may grow without bound. + # + # @return [Integer] Number of tasks that may be enqueued before reaching `max_queue` and rejecting + # new tasks. A value of -1 indicates that the queue may grow without bound. + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#89 def remaining_capacity; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#91 - def remove_busy_worker(worker); end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#116 + def remove_worker(worker); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#55 + # The number of tasks that have been scheduled for execution on the pool since construction. + # + # @return [Integer] The number of tasks that have been scheduled for execution on the pool since construction. + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#57 def scheduled_task_count; end - # Returns the value of attribute synchronous. + # Whether or not a value of 0 for :max_queue option means the queue must perform direct hand-off or rather unbounded queue. + # + # @return [true, false] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#42 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#44 def synchronous; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#101 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#129 def worker_died(worker); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#106 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#134 def worker_task_completed; end private @@ -8919,104 +9159,118 @@ class Concurrent::RubyThreadPoolExecutor < ::Concurrent::RubyExecutorService # # @return [nil, Worker] nil of max capacity is reached # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#234 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#257 def ns_add_busy_worker; end # tries to assign task to a worker, tries to get one from @ready or to create new one # # @return [true, false] if task is assigned to a worker # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#194 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#217 def ns_assign_worker(*args, &task); end # tries to enqueue task # # @return [true, false] if enqueued # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#212 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#235 def ns_enqueue(*args, &task); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#153 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#178 def ns_execute(*args, &task); end # @raise [ArgumentError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#118 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#146 def ns_initialize(opts); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#182 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#205 def ns_kill_execution; end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#148 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#173 def ns_limited_queue?; end - # try oldest worker if it is idle for enough time, it's returned back at the start + # @return [Integer] number of excess idle workers which can be removed without + # going below min_length, or all workers if not running # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#273 - def ns_prune_pool; end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#305 + def ns_prunable_capacity; end # handle ready worker, giving it new job or assigning back to @ready # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#246 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#269 def ns_ready_worker(worker, last_message, success = T.unsafe(nil)); end - # removes a worker which is not in not tracked in @ready + # removes a worker which is not tracked in @ready # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#264 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#287 def ns_remove_busy_worker(worker); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#289 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#294 + def ns_remove_ready_worker(worker); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#314 def ns_reset_if_forked; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#167 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#190 def ns_shutdown_execution; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#224 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#247 def ns_worker_died(worker); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#15 +# Default maximum number of threads that will be created in the pool. +# +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#17 Concurrent::RubyThreadPoolExecutor::DEFAULT_MAX_POOL_SIZE = T.let(T.unsafe(nil), Integer) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#21 +# Default maximum number of tasks that may be added to the task queue. +# +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#23 Concurrent::RubyThreadPoolExecutor::DEFAULT_MAX_QUEUE_SIZE = T.let(T.unsafe(nil), Integer) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#18 +# Default minimum number of threads that will be retained in the pool. +# +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#20 Concurrent::RubyThreadPoolExecutor::DEFAULT_MIN_POOL_SIZE = T.let(T.unsafe(nil), Integer) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#27 +# Default value of the :synchronous option. +# +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#29 Concurrent::RubyThreadPoolExecutor::DEFAULT_SYNCHRONOUS = T.let(T.unsafe(nil), FalseClass) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#24 +# Default maximum number of seconds a thread in the pool may remain idle +# before being reclaimed. +# +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#26 Concurrent::RubyThreadPoolExecutor::DEFAULT_THREAD_IDLETIMEOUT = T.let(T.unsafe(nil), Integer) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#303 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#328 class Concurrent::RubyThreadPoolExecutor::Worker - include ::Logger::Severity include ::Concurrent::Concern::Logging # @return [Worker] a new instance of Worker # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#306 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#331 def initialize(pool, id); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#317 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#342 def <<(message); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#325 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#350 def kill; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#321 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#346 def stop; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#331 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#356 def create_worker(queue, pool, idletime); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#351 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb#381 def run_task(pool, task, args); end end @@ -9084,7 +9338,7 @@ end # # @example Basic usage # -# require 'concurrent' +# require 'concurrent/scheduled_task' # require 'csv' # require 'open-uri' # @@ -9121,21 +9375,20 @@ end # price.state #=> :fulfilled # price.fulfilled? #=> true # price.value #=> 63.65 -# @example Successful task execution +# @example Failed task execution # -# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' } -# task.state #=> :unscheduled -# task.execute -# task.state #=> pending +# task = Concurrent::ScheduledTask.execute(2){ raise StandardError.new('Call me maybe?') } +# task.pending? #=> true # # # wait for it... # sleep(3) # # task.unscheduled? #=> false # task.pending? #=> false -# task.fulfilled? #=> true -# task.rejected? #=> false -# task.value #=> 'What does the fox say?' +# task.fulfilled? #=> false +# task.rejected? #=> true +# task.value #=> nil +# task.reason #=> # # @example One line creation and execution # # task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' }.execute @@ -9143,20 +9396,21 @@ end # # task = Concurrent::ScheduledTask.execute(2){ 'What do you get when you multiply 6 by 9?' } # task.state #=> pending -# @example Failed task execution +# @example Successful task execution # -# task = Concurrent::ScheduledTask.execute(2){ raise StandardError.new('Call me maybe?') } -# task.pending? #=> true +# task = Concurrent::ScheduledTask.new(2){ 'What does the fox say?' } +# task.state #=> :unscheduled +# task.execute +# task.state #=> pending # # # wait for it... # sleep(3) # # task.unscheduled? #=> false # task.pending? #=> false -# task.fulfilled? #=> false -# task.rejected? #=> true -# task.value #=> nil -# task.reason #=> # +# task.fulfilled? #=> true +# task.rejected? #=> false +# task.value #=> 'What does the fox say?' # @example Task execution with observation # # observer = Class.new{ @@ -9227,7 +9481,7 @@ class Concurrent::ScheduledTask < ::Concurrent::IVar # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#163 def executor; end - # The `delay` value given at instanciation. + # The `delay` value given at instantiation. # # @return [Float] the initial delay. # @@ -9273,6 +9527,9 @@ class Concurrent::ScheduledTask < ::Concurrent::IVar protected + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#301 + def fail(reason = T.unsafe(nil)); end + # Reschedule the task using the given delay and the current time. # A task can only be reset while it is `:pending`. # @@ -9290,6 +9547,12 @@ class Concurrent::ScheduledTask < ::Concurrent::IVar # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#312 def ns_schedule(delay); end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#301 + def set(value = T.unsafe(nil)); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/scheduled_task.rb#301 + def try_set(value = T.unsafe(nil), &block); end + class << self # Create a new `ScheduledTask` object with the given block, execute it, and return the # `:pending` object. @@ -9357,10 +9620,10 @@ end # # 0 # # 1 # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/semaphore.rb#164 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/semaphore.rb#161 class Concurrent::Semaphore < ::Concurrent::MutexSemaphore; end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/semaphore.rb#99 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/semaphore.rb#96 Concurrent::SemaphoreImplementation = Concurrent::MutexSemaphore # Indicates that the including `ExecutorService` guarantees @@ -9383,12 +9646,15 @@ Concurrent::SemaphoreImplementation = Concurrent::MutexSemaphore # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb#24 module Concurrent::SerialExecutorService - include ::Logger::Severity include ::Concurrent::Concern::Logging include ::Concurrent::ExecutorService + # Does this executor guarantee serialization of its operations? + # # @note Always returns `true` - # @return [Boolean] + # @return [Boolean] True if the executor guarantees that all operations + # will be post in the order they are received and no two operations may + # occur simultaneously. Else false. # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb#30 def serialized?; end @@ -9398,7 +9664,6 @@ end # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#8 class Concurrent::SerializedExecution < ::Concurrent::Synchronization::LockableObject - include ::Logger::Severity include ::Concurrent::Concern::Logging # @return [SerializedExecution] a new instance of SerializedExecution @@ -9408,8 +9673,8 @@ class Concurrent::SerializedExecution < ::Concurrent::Synchronization::LockableO # Submit a task to the executor for asynchronous processing. # - # @param executor [Executor] to be used for this job # @param args [Array] zero or more arguments to be passed to the task + # @param executor [Executor] to be used for this job # @raise [ArgumentError] if no task is given # @return [Boolean] `true` if the task is queued, `false` if the executor # is not running @@ -9446,6 +9711,8 @@ class Concurrent::SerializedExecution::Job < ::Struct # Returns the value of attribute args # # @return [Object] the current value of args + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16 def args; end # Sets the attribute args @@ -9459,6 +9726,8 @@ class Concurrent::SerializedExecution::Job < ::Struct # Returns the value of attribute block # # @return [Object] the current value of block + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16 def block; end # Sets the attribute block @@ -9475,6 +9744,8 @@ class Concurrent::SerializedExecution::Job < ::Struct # Returns the value of attribute executor # # @return [Object] the current value of executor + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16 def executor; end # Sets the attribute executor @@ -9486,9 +9757,19 @@ class Concurrent::SerializedExecution::Job < ::Struct def executor=(_); end class << self + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16 def [](*_arg0); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16 def inspect; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16 + def keyword_init?; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16 def members; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution.rb#16 def new(*_arg0); end end end @@ -9496,12 +9777,11 @@ end # A wrapper/delegator for any `ExecutorService` that # guarantees serialized execution of tasks. # -# @see [SimpleDelegator](http://www.ruby-doc.org/stdlib-2.1.2/libdoc/delegate/rdoc/SimpleDelegator.html) # @see Concurrent::SerializedExecution +# @see [SimpleDelegator](http://www.ruby-doc.org/stdlib-2.1.2/libdoc/delegate/rdoc/SimpleDelegator.html) # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb#12 class Concurrent::SerializedExecutionDelegator < ::SimpleDelegator - include ::Logger::Severity include ::Concurrent::Concern::Logging include ::Concurrent::ExecutorService include ::Concurrent::SerialExecutorService @@ -9535,7 +9815,7 @@ end # may be lost. Use `#merge` instead. # @see http://ruby-doc.org/stdlib-2.4.0/libdoc/set/rdoc/Set.html Ruby standard library `Set` # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#71 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#61 class Concurrent::Set < ::Concurrent::CRubySet; end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/set.rb#23 @@ -9546,51 +9826,134 @@ Concurrent::SetImplementation = Concurrent::CRubySet # or any time thereafter. Attempting to assign a value to a member # that has already been set will result in a `Concurrent::ImmutabilityError`. # -# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct` # @see http://en.wikipedia.org/wiki/Final_(Java) Java `final` keyword +# @see http://ruby-doc.org/core/Struct.html Ruby standard library `Struct` # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#14 module Concurrent::SettableStruct include ::Concurrent::Synchronization::AbstractStruct + # Equality + # + # @return [Boolean] true if other has the same struct subclass and has + # equal member values (according to `Object#==`) + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#50 def ==(other); end + # Attribute Reference + # + # @param member [Symbol, String, Integer] the string or symbol name of the member + # for which to obtain the value or the member's index + # @raise [NameError] if the member does not exist + # @raise [IndexError] if the index is out of range. + # @return [Object] the value of the given struct member or the member at the given index. + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#45 def [](member); end + # Attribute Assignment + # + # Sets the value of the given struct member or the member at the given index. + # + # @param member [Symbol, String, Integer] the string or symbol name of the member + # for which to obtain the value or the member's index + # @raise [NameError] if the name does not exist + # @raise [IndexError] if the index is out of range. # @raise [Concurrent::ImmutabilityError] if the given member has already been set + # @return [Object] the value of the given struct member or the member at the given index. # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#75 def []=(member, value); end + # Yields the value of each struct member in order. If no block is given + # an enumerator is returned. + # + # @yield the operation to be performed on each struct member + # @yieldparam value [Object] each struct value (in order) + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#55 def each(&block); end + # Yields the name and value of each struct member in order. If no block is + # given an enumerator is returned. + # + # @yield the operation to be performed on each struct member/value pair + # @yieldparam member [Object] each struct member (in order) + # @yieldparam value [Object] each struct value (in order) + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#61 def each_pair(&block); end + # Describe the contents of this struct in a string. + # + # @return [String] the contents of this struct in a string + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#29 def inspect; end + # Returns a new struct containing the contents of `other` and the contents + # of `self`. If no block is specified, the value for entries with duplicate + # keys will be that of `other`. Otherwise the value for each duplicate key + # is determined by calling the block with the key, its value in `self` and + # its value in `other`. + # + # @param other [Hash] the hash from which to set the new values + # @raise [ArgumentError] of given a member that is not defined in the struct + # @return [Synchronization::AbstractStruct] a new struct with the new values + # @yield an options block for resolving duplicate keys + # @yieldparam member [String, Symbol] the name of the member which is duplicated + # @yieldparam othervalue [Object] the value of the member in `other` + # @yieldparam selfvalue [Object] the value of the member in `self` + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#35 def merge(other, &block); end + # Yields each member value from the struct to the block and returns an Array + # containing the member values from the struct for which the given block + # returns a true value (equivalent to `Enumerable#select`). + # + # @return [Array] an array containing each value for which the block returns true + # @yield the operation to be performed on each struct member + # @yieldparam value [Object] each struct value (in order) + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#67 def select(&block); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#18 + # Returns the values for this struct as an Array. + # + # @return [Array] the values for this struct + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#21 def to_a; end + # Returns a hash containing the names and values for the struct’s members. + # + # @return [Hash] the names and values for the struct’s members + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#40 def to_h; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#29 + # Describe the contents of this struct in a string. + # + # @return [String] the contents of this struct in a string + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#32 def to_s; end + # Returns the values for this struct as an Array. + # + # @return [Array] the values for this struct + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#18 def values; end + # Returns the struct member values for each selector as an Array. + # + # A selector may be either an Integer offset or a Range of offsets (as in `Array#values_at`). + # + # @param indexes [Fixnum, Range] the index(es) from which to obatin the values (in order) + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#24 def values_at(*indexes); end @@ -9600,6 +9963,36 @@ module Concurrent::SettableStruct def initialize_copy(original); end class << self + # Factory for creating new struct classes. + # + # ``` + # new([class_name] [, member_name]+>) -> StructClass click to toggle source + # new([class_name] [, member_name]+>) {|StructClass| block } -> StructClass + # new(value, ...) -> obj + # StructClass[value, ...] -> obj + # ``` + # + # The first two forms are used to create a new struct subclass `class_name` + # that can contain a value for each member_name . This subclass can be + # used to create instances of the structure like any other Class . + # + # If the `class_name` is omitted an anonymous struct class will be created. + # Otherwise, the name of this struct will appear as a constant in the struct class, + # so it must be unique for all structs under this base class and must start with a + # capital letter. Assigning a struct class to a constant also gives the class + # the name of the constant. + # + # If a block is given it will be evaluated in the context of `StructClass`, passing + # the created class as a parameter. This is the recommended way to customize a struct. + # Subclassing an anonymous struct creates an extra anonymous class that will never be used. + # + # The last two forms create a new instance of a struct subclass. The number of value + # parameters must be less than or equal to the number of attributes defined for the + # struct. Unset parameters default to nil. Passing more parameters than number of attributes + # will raise an `ArgumentError`. + # + # @see http://ruby-doc.org/core/Struct.html#method-c-new Ruby standard library `Struct#new` + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/settable_struct.rb#105 def new(*args, &block); end end @@ -9621,14 +10014,14 @@ Concurrent::SettableStruct::FACTORY = T.let(T.unsafe(nil), T.untyped) # # @note Intended for use primarily in testing and debugging. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#18 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#21 class Concurrent::SimpleExecutorService < ::Concurrent::RubyExecutorService # Submit a task to the executor for asynchronous processing. # # @param task [Proc] the asynchronous task to perform # @return [self] returns itself # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#53 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#56 def <<(task); end # Begin an immediate shutdown. In-progress tasks will be allowed to @@ -9636,7 +10029,7 @@ class Concurrent::SimpleExecutorService < ::Concurrent::RubyExecutorService # will be accepted. Has no additional effect if the thread pool is # not running. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#81 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#84 def kill; end # Submit a task to the executor for asynchronous processing. @@ -9647,35 +10040,35 @@ class Concurrent::SimpleExecutorService < ::Concurrent::RubyExecutorService # is not running # @yield the asynchronous task to perform # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#37 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#40 def post(*args, &task); end # Is the executor running? # # @return [Boolean] `true` when running, `false` when shutting down or shutdown # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#59 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#62 def running?; end # Begin an orderly shutdown. Tasks already in the queue will be executed, # but no new tasks will be accepted. Has no additional effect if the # thread pool is not running. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#74 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#77 def shutdown; end # Is the executor shutdown? # # @return [Boolean] `true` when shutdown, `false` when shutting down or running # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#69 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#72 def shutdown?; end # Is the executor shuttingdown? # # @return [Boolean] `true` when not running and not shutdown, else `false` # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#64 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#67 def shuttingdown?; end # Block until executor shutdown is complete or until `timeout` seconds have @@ -9686,12 +10079,12 @@ class Concurrent::SimpleExecutorService < ::Concurrent::RubyExecutorService # @param timeout [Integer] the maximum number of seconds to wait for shutdown to complete # @return [Boolean] `true` if shutdown complete or false on `timeout` # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#88 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#91 def wait_for_termination(timeout = T.unsafe(nil)); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#94 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#97 def ns_initialize(*args); end class << self @@ -9700,7 +10093,7 @@ class Concurrent::SimpleExecutorService < ::Concurrent::RubyExecutorService # @param task [Proc] the asynchronous task to perform # @return [self] returns itself # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#31 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#34 def <<(task); end # Submit a task to the executor for asynchronous processing. @@ -9711,7 +10104,7 @@ class Concurrent::SimpleExecutorService < ::Concurrent::RubyExecutorService # is not running # @yield the asynchronous task to perform # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#21 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb#24 def post(*args); end end end @@ -9726,7 +10119,7 @@ end # is received. This pattern has several issues. The thread itself is highly # susceptible to errors during processing. Also, the thread itself must be # constantly monitored and restarted should it die. `SingleThreadExecutor` -# encapsulates all these bahaviors. The task processor is highly resilient +# encapsulates all these behaviors. The task processor is highly resilient # to errors from within tasks. Also, should the thread die it will # automatically be restarted. # @@ -9738,13 +10131,15 @@ class Concurrent::SingleThreadExecutor < ::Concurrent::RubySingleThreadExecutor; # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb#10 Concurrent::SingleThreadExecutorImplementation = Concurrent::RubySingleThreadExecutor -# {include:file:docs-source/synchronization.md} -# {include:file:docs-source/synchronization-notes.md} -# # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#2 -module Concurrent::Synchronization; end +module Concurrent::Synchronization + class << self + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/full_memory_barrier.rb#7 + def full_memory_barrier; end + end +end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#5 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#9 class Concurrent::Synchronization::AbstractLockableObject < ::Concurrent::Synchronization::Object protected @@ -9760,7 +10155,7 @@ class Concurrent::Synchronization::AbstractLockableObject < ::Concurrent::Synchr # @raise [NotImplementedError] # @return [self] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#92 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#96 def ns_broadcast; end # Signal one waiting thread. @@ -9775,7 +10170,7 @@ class Concurrent::Synchronization::AbstractLockableObject < ::Concurrent::Synchr # @raise [NotImplementedError] # @return [self] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#77 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#81 def ns_signal; end # Wait until another thread calls #signal or #broadcast, @@ -9792,7 +10187,7 @@ class Concurrent::Synchronization::AbstractLockableObject < ::Concurrent::Synchr # @raise [NotImplementedError] # @return [self] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#62 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#66 def ns_wait(timeout = T.unsafe(nil)); end # Wait until condition is met or timeout passes, @@ -9810,7 +10205,7 @@ class Concurrent::Synchronization::AbstractLockableObject < ::Concurrent::Synchr # @yield condition to be met # @yieldreturn [true, false] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#33 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#37 def ns_wait_until(timeout = T.unsafe(nil), &condition); end # @note can by made public in descendants if required by `public :synchronize` @@ -9818,29 +10213,27 @@ class Concurrent::Synchronization::AbstractLockableObject < ::Concurrent::Synchr # @yield runs the block synchronized against this object, # equivalent of java's `synchronize(this) {}` # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#14 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb#18 def synchronize; end end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#6 class Concurrent::Synchronization::AbstractObject - # @abstract has to be implemented based on Ruby runtime - # @raise [NotImplementedError] # @return [AbstractObject] a new instance of AbstractObject # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#9 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#7 def initialize; end # @abstract # @raise [NotImplementedError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#15 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#13 def full_memory_barrier; end class << self # @raise [NotImplementedError] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#19 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb#17 def attr_volatile(*names); end end end @@ -9868,41 +10261,107 @@ module Concurrent::Synchronization::AbstractStruct # # @return [Fixnum] the number of struct members # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#19 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#22 def size; end protected + # Yields the value of each struct member in order. If no block is given + # an enumerator is returned. + # + # @yield the operation to be performed on each struct member + # @yieldparam value [Object] each struct value (in order) + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#82 def ns_each; end + # Yields the name and value of each struct member in order. If no block is + # given an enumerator is returned. + # + # @yield the operation to be performed on each struct member/value pair + # @yieldparam member [Object] each struct member (in order) + # @yieldparam value [Object] each struct value (in order) + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#89 def ns_each_pair; end + # Equality + # + # @return [Boolean] true if other has the same struct subclass and has + # equal member values (according to `Object#==`) + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#75 def ns_equality(other); end + # Attribute Reference + # + # @param member [Symbol, String, Integer] the string or symbol name of the member + # for which to obtain the value or the member's index + # @raise [NameError] if the member does not exist + # @raise [IndexError] if the index is out of range. + # @return [Object] the value of the given struct member or the member at the given index. + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#59 def ns_get(member); end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#119 def ns_initialize_copy; end + # Describe the contents of this struct in a string. + # + # @return [String] the contents of this struct in a string + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#105 def ns_inspect; end + # Returns a new struct containing the contents of `other` and the contents + # of `self`. If no block is specified, the value for entries with duplicate + # keys will be that of `other`. Otherwise the value for each duplicate key + # is determined by calling the block with the key, its value in `self` and + # its value in `other`. + # + # @param other [Hash] the hash from which to set the new values + # @raise [ArgumentError] of given a member that is not defined in the struct + # @return [Synchronization::AbstractStruct] a new struct with the new values + # @yield an options block for resolving duplicate keys + # @yieldparam member [String, Symbol] the name of the member which is duplicated + # @yieldparam othervalue [Object] the value of the member in `other` + # @yieldparam selfvalue [Object] the value of the member in `self` + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#114 def ns_merge(other, &block); end + # Yields each member value from the struct to the block and returns an Array + # containing the member values from the struct for which the given block + # returns a true value (equivalent to `Enumerable#select`). + # + # @return [Array] an array containing each value for which the block returns true + # @yield the operation to be performed on each struct member + # @yieldparam value [Object] each struct value (in order) + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#98 def ns_select; end + # Returns a hash containing the names and values for the struct’s members. + # + # @return [Hash] the names and values for the struct’s members + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#52 def ns_to_h; end + # Returns the values for this struct as an Array. + # + # @return [Array] the values for this struct + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#38 def ns_values; end + # Returns the struct member values for each selector as an Array. + # + # A selector may be either an Integer offset or a Range of offsets (as in `Array#values_at`). + # + # @param indexes [Fixnum, Range] the index(es) from which to obatin the values (in order) + # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb#45 def ns_values_at(indexes); end @@ -9917,68 +10376,88 @@ end # TODO (pitr-ch 04-Dec-2016): should be in edge # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#6 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#8 class Concurrent::Synchronization::Condition < ::Concurrent::Synchronization::LockableObject # @return [Condition] a new instance of Condition # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#16 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#18 def initialize(lock); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#45 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#47 def broadcast; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#49 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#51 def ns_broadcast; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#41 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#43 def ns_signal; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#25 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#27 def ns_wait(timeout = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#33 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#35 def ns_wait_until(timeout = T.unsafe(nil), &condition); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#37 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#39 def signal; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#21 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#23 def wait(timeout = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#29 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#31 def wait_until(timeout = T.unsafe(nil), &condition); end class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#15 def private_new(*args, &block); end + + private + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#16 + def new(*args, &block); end end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#7 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#8 module Concurrent::Synchronization::ConditionSignalling protected - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#15 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#16 def ns_broadcast; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#10 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#11 def ns_signal; end end # TODO (pitr-ch 04-Dec-2016): should be in edge # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#7 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#8 class Concurrent::Synchronization::Lock < ::Concurrent::Synchronization::LockableObject - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#29 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#31 def broadcast; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#23 - def signal; end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#35 + def ns_broadcast; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#29 + def ns_signal; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#17 + def ns_wait(timeout = T.unsafe(nil)); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#23 + def ns_wait_until(timeout = T.unsafe(nil), &condition); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#25 + def signal; end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#11 + def synchronize; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#13 def wait(timeout = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#17 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lock.rb#19 def wait_until(timeout = T.unsafe(nil), &condition); end end @@ -10007,103 +10486,63 @@ end # end # end # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb#47 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb#50 class Concurrent::Synchronization::LockableObject < ::Concurrent::Synchronization::MutexLockableObject - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#55 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/condition.rb#57 def new_condition; end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb#6 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb#11 Concurrent::Synchronization::LockableObjectImplementation = Concurrent::Synchronization::MutexLockableObject -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#59 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#60 class Concurrent::Synchronization::MonitorLockableObject < ::Concurrent::Synchronization::AbstractLockableObject include ::Concurrent::Synchronization::ConditionSignalling + extend ::Concurrent::Synchronization::SafeInitialization # @return [MonitorLockableObject] a new instance of MonitorLockableObject # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#64 - def initialize(*defaults); end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#65 + def initialize; end protected - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#82 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#83 def ns_wait(timeout = T.unsafe(nil)); end # TODO may be a problem with lock.synchronize { lock.wait } # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#78 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#79 def synchronize; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#70 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#71 def initialize_copy(other); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 - def new(*args, &block); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mri_object.rb#5 -module Concurrent::Synchronization::MriAttrVolatile - mixes_in_class_methods ::Concurrent::Synchronization::MriAttrVolatile::ClassMethods - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mri_object.rb#28 - def full_memory_barrier; end - - class << self - # @private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mri_object.rb#6 - def included(base); end - end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mri_object.rb#10 -module Concurrent::Synchronization::MriAttrVolatile::ClassMethods - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mri_object.rb#11 - def attr_volatile(*names); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mri_object.rb#36 -class Concurrent::Synchronization::MriObject < ::Concurrent::Synchronization::AbstractObject - include ::Concurrent::Synchronization::MriAttrVolatile - extend ::Concurrent::Synchronization::MriAttrVolatile::ClassMethods - - # @return [MriObject] a new instance of MriObject - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mri_object.rb#39 - def initialize; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#24 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#25 class Concurrent::Synchronization::MutexLockableObject < ::Concurrent::Synchronization::AbstractLockableObject include ::Concurrent::Synchronization::ConditionSignalling + extend ::Concurrent::Synchronization::SafeInitialization # @return [MutexLockableObject] a new instance of MutexLockableObject # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#29 - def initialize(*defaults); end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#30 + def initialize; end protected - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#51 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#52 def ns_wait(timeout = T.unsafe(nil)); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#43 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#44 def synchronize; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#35 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb#36 def initialize_copy(other); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 - def new(*args, &block); end - end end # Abstract object providing final, volatile, ans CAS extensions to build other concurrent abstractions. @@ -10111,35 +10550,38 @@ end # - volatile instance variables see {Object.attr_volatile} # - volatile instance variables see {Object.attr_atomic} # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#26 -class Concurrent::Synchronization::Object < ::Concurrent::Synchronization::MriObject +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#15 +class Concurrent::Synchronization::Object < ::Concurrent::Synchronization::AbstractObject + include ::Concurrent::Synchronization::Volatile + extend ::Concurrent::Synchronization::Volatile::ClassMethods + # Has to be called by children. # # @return [Object] a new instance of Object # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#36 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#28 def initialize; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#178 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#146 def __initialize_atomic_fields__; end class << self # @return [true, false] is the attribute with name atomic? # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#157 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#125 def atomic_attribute?(name); end # @param inherited [true, false] should inherited volatile with CAS fields be returned? # @return [::Array] Returns defined volatile with CAS fields on this class. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#151 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#119 def atomic_attributes(inherited = T.unsafe(nil)); end # Creates methods for reading and writing to a instance variable with # volatile (Java) semantic as {.attr_volatile} does. - # The instance variable should be accessed oly through generated methods. + # The instance variable should be accessed only through generated methods. # This method generates following methods: `value`, `value=(new_value) #=> new_value`, # `swap_value(new_value) #=> old_value`, # `compare_and_set_value(expected, value) #=> true || false`, `update_value(&block)`. @@ -10147,7 +10589,7 @@ class Concurrent::Synchronization::Object < ::Concurrent::Synchronization::MriOb # @param names [::Array] of the instance variables to be volatile with CAS. # @return [::Array] names of defined method names. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#116 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#84 def attr_atomic(*names); end # For testing purposes, quite slow. Injects assert code to new method which will raise if class instance contains @@ -10156,135 +10598,48 @@ class Concurrent::Synchronization::Object < ::Concurrent::Synchronization::MriOb # @raise when offend found # @return [true] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#77 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#45 def ensure_safe_initialization_when_final_fields_are_present; end - # By calling this method on a class, it and all its children are marked to be constructed safely. Meaning that - # all writes (ivar initializations) are made visible to all readers of newly constructed object. It ensures - # same behaviour as Java's final fields. - # - # @example - # class AClass < Concurrent::Synchronization::Object - # safe_initialization! - # - # def initialize - # @AFinalValue = 'value' # published safely, does not have to be synchronized - # end - # end - # @return [true] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#53 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#33 def safe_initialization!; end - # @return [true, false] if this class is safely initialized. + # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#68 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#37 def safe_initialization?; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#163 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#131 def define_initialize_atomic_fields; end end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#6 -Concurrent::Synchronization::ObjectImplementation = Concurrent::Synchronization::MriObject - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/rbx_object.rb#5 -module Concurrent::Synchronization::RbxAttrVolatile - mixes_in_class_methods ::Concurrent::Synchronization::RbxAttrVolatile::ClassMethods - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/rbx_object.rb#32 - def full_memory_barrier; end - - class << self - # @private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/rbx_object.rb#6 - def included(base); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/rbx_object.rb#10 -module Concurrent::Synchronization::RbxAttrVolatile::ClassMethods - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/rbx_object.rb#12 - def attr_volatile(*names); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/rbx_lockable_object.rb#6 -class Concurrent::Synchronization::RbxLockableObject < ::Concurrent::Synchronization::AbstractLockableObject - # @return [RbxLockableObject] a new instance of RbxLockableObject - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/rbx_lockable_object.rb#9 - def initialize(*defaults); end - - protected - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/rbx_lockable_object.rb#65 - def ns_broadcast; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/rbx_lockable_object.rb#60 - def ns_signal; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/rbx_lockable_object.rb#40 - def ns_wait(timeout = T.unsafe(nil)); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/rbx_lockable_object.rb#23 - def synchronize(&block); end - - private - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/rbx_lockable_object.rb#15 - def initialize_copy(other); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 - def new(*args, &block); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/rbx_object.rb#41 -class Concurrent::Synchronization::RbxObject < ::Concurrent::Synchronization::AbstractObject - include ::Concurrent::Synchronization::RbxAttrVolatile - extend ::Concurrent::Synchronization::RbxAttrVolatile::ClassMethods - - # @return [RbxObject] a new instance of RbxObject - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/rbx_object.rb#44 - def initialize; end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/truffleruby_object.rb#5 -module Concurrent::Synchronization::TruffleRubyAttrVolatile - mixes_in_class_methods ::Concurrent::Synchronization::TruffleRubyAttrVolatile::ClassMethods - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/truffleruby_object.rb#32 - def full_memory_barrier; end - - class << self - # @private - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/truffleruby_object.rb#6 - def included(base); end - end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/truffleruby_object.rb#10 -module Concurrent::Synchronization::TruffleRubyAttrVolatile::ClassMethods - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/truffleruby_object.rb#11 - def attr_volatile(*names); end -end - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/truffleruby_object.rb#39 -class Concurrent::Synchronization::TruffleRubyObject < ::Concurrent::Synchronization::AbstractObject - include ::Concurrent::Synchronization::TruffleRubyAttrVolatile - extend ::Concurrent::Synchronization::TruffleRubyAttrVolatile::ClassMethods - - # @return [TruffleRubyObject] a new instance of TruffleRubyObject - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/truffleruby_object.rb#42 - def initialize; end +# By extending this module, a class and all its children are marked to be constructed safely. Meaning that +# all writes (ivar initializations) are made visible to all readers of newly constructed object. It ensures +# same behaviour as Java's final fields. +# +# Due to using Kernel#extend, the module is not included again if already present in the ancestors, +# which avoids extra overhead. +# +# @example +# class AClass < Concurrent::Synchronization::Object +# extend Concurrent::Synchronization::SafeInitialization +# +# def initialize +# @AFinalValue = 'value' # published safely, #foo will never return nil +# end +# +# def foo +# @AFinalValue +# end +# end +# +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb#28 +module Concurrent::Synchronization::SafeInitialization + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb#29 + def new(*args, &block); end end # Volatile adds the attr_volatile class method when included. @@ -10306,8 +10661,26 @@ end # end # end # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#23 -Concurrent::Synchronization::Volatile = Concurrent::Synchronization::MriAttrVolatile +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#28 +module Concurrent::Synchronization::Volatile + mixes_in_class_methods ::Concurrent::Synchronization::Volatile::ClassMethods + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#33 + def full_memory_barrier; end + + class << self + # @private + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#29 + def included(base); end + end +end + +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#37 +module Concurrent::Synchronization::Volatile::ClassMethods + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/volatile.rb#39 + def attr_volatile(*names); end +end # This class provides a trivial way to synchronize all calls to a given object # by wrapping it with a `Delegator` that performs `Monitor#enter/exit` calls @@ -10324,20 +10697,20 @@ Concurrent::Synchronization::Volatile = Concurrent::Synchronization::MriAttrVola # This class is currently being considered for inclusion into stdlib, via # https://bugs.ruby-lang.org/issues/8556 # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#23 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#21 class Concurrent::SynchronizedDelegator < ::SimpleDelegator # @return [SynchronizedDelegator] a new instance of SynchronizedDelegator # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#33 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#31 def initialize(obj); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#38 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#36 def method_missing(method, *args, &block); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#24 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#22 def setup; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#29 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb#27 def teardown; end end @@ -10380,6 +10753,8 @@ end # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#12 class Concurrent::TVar < ::Concurrent::Synchronization::Object + extend ::Concurrent::Synchronization::SafeInitialization + # Create a new `TVar` with an initial value. # # @return [TVar] a new instance of TVar @@ -10405,17 +10780,21 @@ class Concurrent::TVar < ::Concurrent::Synchronization::Object # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#29 def value=(value); end - - class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/synchronization/object.rb#58 - def new(*args, &block); end - end end # A `ThreadLocalVar` is a variable where the value is different for each thread. # Each variable may have a default value, but when you modify the variable only # the current thread will ever see that change. # +# This is similar to Ruby's built-in thread-local variables (`Thread#thread_variable_get`), +# but with these major advantages: +# * `ThreadLocalVar` has its own identity, it doesn't need a Symbol. +# * Each Ruby's built-in thread-local variable leaks some memory forever (it's a Symbol held forever on the thread), +# so it's only OK to create a small amount of them. +# `ThreadLocalVar` has no such issue and it is fine to create many of them. +# * Ruby's built-in thread-local variables leak forever the value set on each thread (unless set to nil explicitly). +# `ThreadLocalVar` automatically removes the mapping for each thread once the `ThreadLocalVar` instance is GC'd. +# # # ## Thread-safe Variable Classes # @@ -10470,13 +10849,63 @@ end # end # # v.value #=> 14 -# @see https://docs.oracle.com/javase/7/docs/api/java/lang/ThreadLocal.html Java ThreadLocal # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#102 -class Concurrent::ThreadLocalVar < ::Concurrent::RubyThreadLocalVar; end +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#43 +class Concurrent::ThreadLocalVar + # Creates a thread local variable. + # + # @param default [Object] the default value when otherwise unset + # @param default_block [Proc] Optional block that gets called to obtain the + # default value for each thread + # @return [ThreadLocalVar] a new instance of ThreadLocalVar + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#51 + def initialize(default = T.unsafe(nil), &default_block); end + + # Bind the given value to thread local storage during + # execution of the given block. + # + # @param value [Object] the value to bind + # @return [Object] the value + # @yield the operation to be performed with the bound variable + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#88 + def bind(value); end + + # Returns the value in the current thread's copy of this thread-local variable. + # + # @return [Object] the current value + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#70 + def value; end + + # Sets the current thread's copy of this thread-local variable to the specified value. + # + # @param value [Object] the value to set + # @return [Object] the new value + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#78 + def value=(value); end + + protected + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#103 + def default; end +end + +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#44 +Concurrent::ThreadLocalVar::LOCALS = T.let(T.unsafe(nil), Concurrent::ThreadLocals) + +# An array-backed storage of indexed variables per thread. +# +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#141 +class Concurrent::ThreadLocals < ::Concurrent::AbstractLocals + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#142 + def locals; end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb#60 -Concurrent::ThreadLocalVarImplementation = Concurrent::RubyThreadLocalVar + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/atomic/locals.rb#146 + def locals!; end +end # An abstraction composed of one or more threads and a task queue. Tasks # (blocks or `proc` objects) are submitted to the pool and added to the queue. @@ -10511,6 +10940,57 @@ Concurrent::ThreadLocalVarImplementation = Concurrent::RubyThreadLocalVar # > background thread), that preconfigure settings for the most common usage # > scenarios. # +# **Thread Pool Options** +# +# Thread pools support several configuration options: +# +# * `idletime`: The number of seconds that a thread may be idle before being reclaimed. +# * `name`: The name of the executor (optional). Printed in the executor's `#to_s` output and +# a `-worker-` name is given to its threads if supported by used Ruby +# implementation. `` is uniq for each thread. +# * `max_queue`: The maximum number of tasks that may be waiting in the work queue at +# any one time. When the queue size reaches `max_queue` and no new threads can be created, +# subsequent tasks will be rejected in accordance with the configured `fallback_policy`. +# * `auto_terminate`: When true (default), the threads started will be marked as daemon. +# * `fallback_policy`: The policy defining how rejected tasks are handled. +# +# Three fallback policies are supported: +# +# * `:abort`: Raise a `RejectedExecutionError` exception and discard the task. +# * `:discard`: Discard the task and return false. +# * `:caller_runs`: Execute the task on the calling thread. +# +# **Shutting Down Thread Pools** +# +# Killing a thread pool while tasks are still being processed, either by calling +# the `#kill` method or at application exit, will have unpredictable results. There +# is no way for the thread pool to know what resources are being used by the +# in-progress tasks. When those tasks are killed the impact on those resources +# cannot be predicted. The *best* practice is to explicitly shutdown all thread +# pools using the provided methods: +# +# * Call `#shutdown` to initiate an orderly termination of all in-progress tasks +# * Call `#wait_for_termination` with an appropriate timeout interval an allow +# the orderly shutdown to complete +# * Call `#kill` *only when* the thread pool fails to shutdown in the allotted time +# +# On some runtime platforms (most notably the JVM) the application will not +# exit until all thread pools have been shutdown. To prevent applications from +# "hanging" on exit, all threads can be marked as daemon according to the +# `:auto_terminate` option. +# +# ```ruby +# pool1 = Concurrent::FixedThreadPool.new(5) # threads will be marked as daemon +# pool2 = Concurrent::FixedThreadPool.new(5, auto_terminate: false) # mark threads as non-daemon +# ``` +# +# @note Failure to properly shutdown a thread pool can lead to unpredictable results. +# Please read *Shutting Down Thread Pools* for more information. +# @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html Java Executors class +# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html Java ExecutorService interface +# @see http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html Java Tutorials: Thread Pools +# @see https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setDaemon-boolean- +# # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/thread_pool_executor.rb#56 class Concurrent::ThreadPoolExecutor < ::Concurrent::RubyThreadPoolExecutor; end @@ -10523,13 +11003,10 @@ module Concurrent::ThreadSafe; end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util.rb#7 module Concurrent::ThreadSafe::Util class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#15 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#16 def make_synchronized_on_cruby(klass); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#40 - def make_synchronized_on_rbx(klass); end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#77 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb#41 def make_synchronized_on_truffleruby(klass); end end end @@ -10582,8 +11059,8 @@ class Concurrent::TimerSet < ::Concurrent::RubyExecutorService # delay is less than 1/100th of a second the task will be immediately post # to the executor. # - # @param delay [Float] the number of seconds to wait for before executing the task. # @param args [Array] the arguments passed to the task on execution. + # @param delay [Float] the number of seconds to wait for before executing the task. # @raise [ArgumentError] if the intended execution time is not in the future. # @raise [ArgumentError] if no block is given. # @return [Concurrent::ScheduledTask, false] IVar representing the task if the post @@ -10595,22 +11072,25 @@ class Concurrent::TimerSet < ::Concurrent::RubyExecutorService private + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#67 + def <<(task); end + # Initialize the object. # # @param opts [Hash] the options to create the object with. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#74 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#75 def ns_initialize(opts); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#94 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#95 def ns_post_task(task); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#129 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#132 def ns_reset_if_forked; end # `ExecutorService` callback called during shutdown. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#122 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#123 def ns_shutdown_execution; end # Post the task to the internal queue. @@ -10619,7 +11099,7 @@ class Concurrent::TimerSet < ::Concurrent::RubyExecutorService # only. It is not intended to be used directly. Post a task # by using the `SchedulesTask#execute` method. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#89 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#90 def post_task(task); end # Run a loop and execute tasks in the scheduled order and at the approximate @@ -10627,7 +11107,7 @@ class Concurrent::TimerSet < ::Concurrent::RubyExecutorService # garbage collection can occur. If there are no ready tasks it will sleep # for up to 60 seconds waiting for the next scheduled task. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#143 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#146 def process_tasks; end # Remove the given task from the queue. @@ -10636,7 +11116,7 @@ class Concurrent::TimerSet < ::Concurrent::RubyExecutorService # only. It is not intended to be used directly. Cancel a task # by using the `ScheduledTask#cancel` method. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#115 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/executor/timer_set.rb#116 def remove_task(task); end end @@ -10663,6 +11143,17 @@ end # be tested separately then passed to the `TimerTask` for scheduling and # running. # +# A `TimerTask` supports two different types of interval calculations. +# A fixed delay will always wait the same amount of time between the +# completion of one task and the start of the next. A fixed rate will +# attempt to maintain a constant rate of execution regardless of the +# duration of the task. For example, if a fixed rate task is scheduled +# to run every 60 seconds but the task itself takes 10 seconds to +# complete, the next task will be scheduled to run 50 seconds after +# the start of the previous task. If the task takes 70 seconds to +# complete, the next task will be start immediately after the previous +# task completes. Tasks will not be executed concurrently. +# # In some cases it may be necessary for a `TimerTask` to affect its own # execution cycle. To facilitate this, a reference to the TimerTask instance # is passed as an argument to the provided block every time the task is @@ -10695,24 +11186,14 @@ end # end # # task.execution_interval #=> 5 -# @example Immediate execution with `:run_now` -# task = Concurrent::TimerTask.new(run_now: true){ puts 'Boom!' } -# task.execute -# -# #=> 'Boom!' -# @example Last `#value` and `Dereferenceable` mixin -# task = Concurrent::TimerTask.new( -# dup_on_deref: true, -# execution_interval: 5 -# ){ Time.now } -# -# task.execute -# Time.now #=> 2013-11-07 18:06:50 -0500 -# sleep(10) -# task.value #=> 2013-11-07 18:06:55 -0500 +# @example Configuring `:interval_type` with either :fixed_delay or :fixed_rate, default is :fixed_delay +# task = Concurrent::TimerTask.new(execution_interval: 5, interval_type: :fixed_rate) do +# puts 'Boom!' +# end +# task.interval_type #=> :fixed_rate # @example Controlling execution from within the block # timer_task = Concurrent::TimerTask.new(execution_interval: 1) do |task| -# task.execution_interval.times{ print 'Boom! ' } +# task.execution_interval.to_i.times{ print 'Boom! ' } # print "\n" # task.execution_interval += 1 # if task.execution_interval > 5 @@ -10721,13 +11202,28 @@ end # end # end # -# timer_task.execute # blocking call - this task will stop itself +# timer_task.execute # #=> Boom! # #=> Boom! Boom! # #=> Boom! Boom! Boom! # #=> Boom! Boom! Boom! Boom! # #=> Boom! Boom! Boom! Boom! Boom! # #=> Stopping... +# @example Immediate execution with `:run_now` +# task = Concurrent::TimerTask.new(run_now: true){ puts 'Boom!' } +# task.execute +# +# #=> 'Boom!' +# @example Last `#value` and `Dereferenceable` mixin +# task = Concurrent::TimerTask.new( +# dup_on_deref: true, +# execution_interval: 5 +# ){ Time.now } +# +# task.execute +# Time.now #=> 2013-11-07 18:06:50 -0500 +# sleep(10) +# task.value #=> 2013-11-07 18:06:55 -0500 # @example Observation # class TaskObserver # def update(time, result, ex) @@ -10766,10 +11262,10 @@ end # #=> (2013-10-13 19:09:38 -0400) Execution failed with error StandardError # #=> (2013-10-13 19:09:39 -0400) Execution failed with error StandardError # task.shutdown -# @see http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html # @see http://docs.oracle.com/javase/7/docs/api/java/util/TimerTask.html +# @see http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#148 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#166 class Concurrent::TimerTask < ::Concurrent::RubyExecutorService include ::Concurrent::Concern::Dereferenceable include ::Concurrent::Concern::Observable @@ -10778,6 +11274,7 @@ class Concurrent::TimerTask < ::Concurrent::RubyExecutorService # # @option opts # @option opts + # @option opts # @param opts [Hash] the options defining task execution. # @raise ArgumentError when no block is given. # @return [TimerTask] the new `TimerTask` @@ -10788,70 +11285,84 @@ class Concurrent::TimerTask < ::Concurrent::RubyExecutorService # refer to the execution context of the block rather than the running # `TimerTask`. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#180 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#210 def initialize(opts = T.unsafe(nil), &task); end # Execute a previously created `TimerTask`. # + # @example Instance and execute in one line + # task = Concurrent::TimerTask.new(execution_interval: 10){ print "Hello World\n" }.execute + # task.running? #=> true # @example Instance and execute in separate steps # task = Concurrent::TimerTask.new(execution_interval: 10){ print "Hello World\n" } # task.running? #=> false # task.execute # task.running? #=> true - # @example Instance and execute in one line - # task = Concurrent::TimerTask.new(execution_interval: 10){ print "Hello World\n" }.execute - # task.running? #=> true # @return [TimerTask] a reference to `self` # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#206 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#236 def execute; end # @return [Fixnum] Number of seconds after the task completes before the # task is performed again. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#230 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#261 def execution_interval; end # @return [Fixnum] Number of seconds after the task completes before the # task is performed again. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#237 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#268 def execution_interval=(value); end + # @return [Symbol] method to calculate the interval between executions + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#278 + def interval_type; end + # Is the executor running? # # @return [Boolean] `true` when running, `false` when shutting down or shutdown # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#189 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#219 def running?; end # @return [Fixnum] Number of seconds the task can run before it is # considered to have failed. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#248 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#283 def timeout_interval; end # @return [Fixnum] Number of seconds the task can run before it is # considered to have failed. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#255 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#290 def timeout_interval=(value); end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#297 - def execute_task(completion); end + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#294 + def <<(task); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#357 + def calculate_next_interval(start_time); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#339 + def execute_task(completion, age_when_scheduled); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#263 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#298 def ns_initialize(opts, &task); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#285 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#327 def ns_kill_execution; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#279 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#321 def ns_shutdown_execution; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#291 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#294 + def post(*args, &task); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#333 def schedule_next_task(interval = T.unsafe(nil)); end class << self @@ -10862,6 +11373,7 @@ class Concurrent::TimerTask < ::Concurrent::RubyExecutorService # task.running? #=> true # @option opts # @option opts + # @option opts # @param opts [Hash] the options defining task execution. # @raise ArgumentError when no block is given. # @return [TimerTask] the new `TimerTask` @@ -10872,69 +11384,83 @@ class Concurrent::TimerTask < ::Concurrent::RubyExecutorService # refer to the execution context of the block rather than the running # `TimerTask`. # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#223 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#254 def execute(opts = T.unsafe(nil), &task); end end end +# Default `:interval_type` +# +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#182 +Concurrent::TimerTask::DEFAULT_INTERVAL_TYPE = T.let(T.unsafe(nil), Symbol) + # Default `:execution_interval` in seconds. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#153 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#171 Concurrent::TimerTask::EXECUTION_INTERVAL = T.let(T.unsafe(nil), Integer) -# Default `:timeout_interval` in seconds. +# Maintain the interval between the end of one execution and the start of the next execution. +# +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#174 +Concurrent::TimerTask::FIXED_DELAY = T.let(T.unsafe(nil), Symbol) + +# Maintain the interval between the start of one execution and the start of the next. +# If execution time exceeds the interval, the next execution will start immediately +# after the previous execution finishes. Executions will not run concurrently. # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#156 -Concurrent::TimerTask::TIMEOUT_INTERVAL = T.let(T.unsafe(nil), Integer) +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/timer_task.rb#179 +Concurrent::TimerTask::FIXED_RATE = T.let(T.unsafe(nil), Symbol) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#152 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#153 class Concurrent::Transaction # @return [Transaction] a new instance of Transaction # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#161 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#162 def initialize; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#191 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#192 def abort; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#195 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#196 def commit; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#176 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#177 def open(tvar); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#165 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#166 def read(tvar); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#205 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#206 def unlock; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#170 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#171 def write(tvar, value); end class << self - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#211 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#212 def current; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#215 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#216 def current=(transaction); end end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#154 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#155 Concurrent::Transaction::ABORTED = T.let(T.unsafe(nil), Object) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#158 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#159 class Concurrent::Transaction::AbortError < ::StandardError; end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#159 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#160 class Concurrent::Transaction::LeaveError < ::StandardError; end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#156 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157 class Concurrent::Transaction::OpenEntry < ::Struct # Returns the value of attribute modified # # @return [Object] the current value of modified + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157 def modified; end # Sets the attribute modified @@ -10942,12 +11468,14 @@ class Concurrent::Transaction::OpenEntry < ::Struct # @param value [Object] the value to set the attribute modified to. # @return [Object] the newly set value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#156 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157 def modified=(_); end # Returns the value of attribute value # # @return [Object] the current value of value + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157 def value; end # Sets the attribute value @@ -10955,13 +11483,23 @@ class Concurrent::Transaction::OpenEntry < ::Struct # @param value [Object] the value to set the attribute value to. # @return [Object] the newly set value # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#156 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157 def value=(_); end class << self + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157 def [](*_arg0); end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157 def inspect; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157 + def keyword_init?; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157 def members; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tvar.rb#157 def new(*_arg0); end end end @@ -10977,9 +11515,9 @@ end # tuple.compare_and_set(0, :foo, :bar) #=> true | strong CAS # tuple.cas(0, :foo, :baz) #=> false | strong CAS # tuple.get(0) #=> :bar | volatile read -# @see https://en.wikipedia.org/wiki/Tuple Tuple entry at Wikipedia -# @see http://www.erlang.org/doc/reference_manual/data_types.html#id70396 Erlang Tuple # @see http://ruby-doc.org/core-2.2.2/Enumerable.html Enumerable +# @see http://www.erlang.org/doc/reference_manual/data_types.html#id70396 Erlang Tuple +# @see https://en.wikipedia.org/wiki/Tuple Tuple entry at Wikipedia # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#20 class Concurrent::Tuple @@ -10990,15 +11528,15 @@ class Concurrent::Tuple # @param size [Integer] the number of elements in the tuple # @return [Tuple] a new instance of Tuple # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#33 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#29 def initialize(size); end # Set the value at the given index to the new value if and only if the current # value matches the given old value. # # @param i [Integer] the index for the element to set - # @param old_value [Object] the value to compare against the current value # @param new_value [Object] the value to set at the given index + # @param old_value [Object] the value to compare against the current value # @return [Boolean] true if the value at the given element was set else false # # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#73 @@ -11008,18 +11546,18 @@ class Concurrent::Tuple # value matches the given old value. # # @param i [Integer] the index for the element to set - # @param old_value [Object] the value to compare against the current value # @param new_value [Object] the value to set at the given index + # @param old_value [Object] the value to compare against the current value # @return [Boolean] true if the value at the given element was set else false # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#73 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#69 def compare_and_set(i, old_value, new_value); end # Calls the given block once for each element in self, passing that element as a parameter. # # @yieldparam ref [Object] the `Concurrent::AtomicReference` object at the current index # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#82 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#78 def each; end # Get the value of the element at the given index. @@ -11027,7 +11565,7 @@ class Concurrent::Tuple # @param i [Integer] the index from which to retrieve the value # @return [Object] the value at the given index or nil if the index is out of bounds # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#47 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#43 def get(i); end # Set the element at the given index to the given value @@ -11036,7 +11574,7 @@ class Concurrent::Tuple # @param value [Object] the value to set at the given index # @return [Object] the new value of the element at the given index or nil if the index is out of bounds # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#59 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#55 def set(i, value); end # The (fixed) size of the tuple. @@ -11062,201 +11600,151 @@ class Concurrent::Tuple def volatile_set(i, value); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/tuple.rb#27 -Concurrent::Tuple::Tuple = Array - -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#2 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#3 module Concurrent::Utility; end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#5 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#6 module Concurrent::Utility::EngineDetector # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#14 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#7 def on_cruby?; end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#6 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#11 def on_jruby?; end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#10 - def on_jruby_9000?; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#34 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#27 def on_linux?; end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#30 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#23 def on_osx?; end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#18 - def on_rbx?; end - - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#22 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#15 def on_truffleruby?; end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#26 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#19 def on_windows?; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#38 - def ruby_engine; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#42 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/engine.rb#31 def ruby_version(version = T.unsafe(nil), comparison, major, minor, patch); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#8 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#9 module Concurrent::Utility::NativeExtensionLoader # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#10 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#11 def allow_c_extensions?; end # @return [Boolean] # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#14 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#15 def c_extensions_loaded?; end - # @return [Boolean] - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#18 - def java_extensions_loaded?; end - - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#22 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#19 def load_native_extensions; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#45 + # @return [Boolean] + # + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#50 + def java_extensions_loaded?; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#38 def load_error_path(error); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#53 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#46 def set_c_extensions_loaded; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#57 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#54 def set_java_extensions_loaded; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#61 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb#58 def try_load_c_extension(path); end end # @private # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#4 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#5 module Concurrent::Utility::NativeInteger extend ::Concurrent::Utility::NativeInteger - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#23 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#24 def ensure_integer(value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#30 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#31 def ensure_integer_and_bounds(value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#16 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#17 def ensure_lower_bound(value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#36 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#37 def ensure_positive(value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#43 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#44 def ensure_positive_and_no_zero(value); end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#9 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#10 def ensure_upper_bound(value); end end -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#7 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#8 Concurrent::Utility::NativeInteger::MAX_VALUE = T.let(T.unsafe(nil), Integer) # http://stackoverflow.com/questions/535721/ruby-max-integer # -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#6 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/native_integer.rb#7 Concurrent::Utility::NativeInteger::MIN_VALUE = T.let(T.unsafe(nil), Integer) -# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#9 +# source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#10 class Concurrent::Utility::ProcessorCounter # @return [ProcessorCounter] a new instance of ProcessorCounter # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#10 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#11 def initialize; end - # Number of physical processor cores on the current system. For performance - # reasons the calculated value will be memoized on the first call. - # - # On Windows the Win32 API will be queried for the `NumberOfCores from - # Win32_Processor`. This will return the total number "of cores for the - # current instance of the processor." On Unix-like operating systems either - # the `hwprefs` or `sysctl` utility will be called in a subshell and the - # returned value will be used. In the rare case where none of these methods - # work or an exception is raised the function will simply return 1. - # - # @return [Integer] number physical processor cores on the current system - # @see https://github.com/grosser/parallel/blob/4fc8b89d08c7091fe0419ca8fba1ec3ce5a8d185/lib/parallel.rb - # @see http://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx - # @see http://www.unix.com/man-page/osx/1/HWPREFS/ - # @see http://linux.die.net/man/8/sysctl - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#73 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#26 + def available_processor_count; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#41 + def cpu_quota; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#45 + def cpu_shares; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#22 def physical_processor_count; end - # Number of processors seen by the OS and used for process scheduling. For - # performance reasons the calculated value will be memoized on the first - # call. - # - # When running under JRuby the Java runtime call - # `java.lang.Runtime.getRuntime.availableProcessors` will be used. According - # to the Java documentation this "value may change during a particular - # invocation of the virtual machine... [applications] should therefore - # occasionally poll this property." Subsequently the result will NOT be - # memoized under JRuby. - # - # Ruby's Etc.nprocessors will be used if available (MRI 2.2+). - # - # On Windows the Win32 API will be queried for the - # `NumberOfLogicalProcessors from Win32_Processor`. This will return the - # total number "logical processors for the current instance of the - # processor", which taked into account hyperthreading. - # - # * AIX: /usr/sbin/pmcycles (AIX 5+), /usr/sbin/lsdev - # * Alpha: /usr/bin/nproc (/proc/cpuinfo exists but cannot be used) - # * BSD: /sbin/sysctl - # * Cygwin: /proc/cpuinfo - # * Darwin: /usr/bin/hwprefs, /usr/sbin/sysctl - # * HP-UX: /usr/sbin/ioscan - # * IRIX: /usr/sbin/sysconf - # * Linux: /proc/cpuinfo - # * Minix 3+: /proc/cpuinfo - # * Solaris: /usr/sbin/psrinfo - # * Tru64 UNIX: /usr/sbin/psrinfo - # * UnixWare: /usr/sbin/psrinfo - # - # @return [Integer] number of processors seen by the OS or Java runtime - # @see https://github.com/grosser/parallel/blob/4fc8b89d08c7091fe0419ca8fba1ec3ce5a8d185/lib/parallel.rb - # @see http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#availableProcessors() - # @see http://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx - # - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#52 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#18 def processor_count; end private - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#87 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#104 + def compute_cpu_quota; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#124 + def compute_cpu_shares; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#59 def compute_physical_processor_count; end - # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#79 + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#51 def compute_processor_count; end + + # source://concurrent-ruby//lib/concurrent-ruby/concurrent/utility/processor_counter.rb#99 + def run(command); end end # source://concurrent-ruby//lib/concurrent-ruby/concurrent/version.rb#2 diff --git a/sorbet/rbi/gems/connection_pool@3.0.2.rbi b/sorbet/rbi/gems/connection_pool@3.0.2.rbi new file mode 100644 index 0000000..3d9f595 --- /dev/null +++ b/sorbet/rbi/gems/connection_pool@3.0.2.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `connection_pool` gem. +# Please instead update this file by running `bin/tapioca gem connection_pool`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/constant_resolver@0.2.0.rbi b/sorbet/rbi/gems/constant_resolver@0.3.0.rbi similarity index 79% rename from sorbet/rbi/gems/constant_resolver@0.2.0.rbi rename to sorbet/rbi/gems/constant_resolver@0.3.0.rbi index 75ef4ab..a80924e 100644 --- a/sorbet/rbi/gems/constant_resolver@0.2.0.rbi +++ b/sorbet/rbi/gems/constant_resolver@0.3.0.rbi @@ -4,6 +4,7 @@ # This is an autogenerated file for types exported from the `constant_resolver` gem. # Please instead update this file by running `bin/tapioca gem constant_resolver`. + # Get information about (partially qualified) constants without loading the application code. # We infer the fully qualified name and the filepath. # @@ -25,24 +26,25 @@ class ConstantResolver # root_path: Rails.root.to_s, # load_paths: load_paths # ) - # @param root_path [String] The root path of the application to analyze - # @param load_paths [Array] The autoload paths of the application. + # @param exclude [Array] Paths to exclude to scan for constants. # @param inflector [Object] Any object that implements a `camelize` function. + # @param load_paths [Array] The autoload paths of the application. + # @param root_path [String] The root path of the application to analyze # @return [ConstantResolver] a new instance of ConstantResolver # - # source://constant_resolver//lib/constant_resolver.rb#42 - def initialize(root_path:, load_paths:, inflector: T.unsafe(nil)); end + # source://constant_resolver//lib/constant_resolver.rb#46 + def initialize(root_path:, load_paths:, exclude: T.unsafe(nil), inflector: T.unsafe(nil)); end # @api private # - # source://constant_resolver//lib/constant_resolver.rb#113 + # source://constant_resolver//lib/constant_resolver.rb#122 def config; end # Maps constant names to file paths. # # @return [Hash] # - # source://constant_resolver//lib/constant_resolver.rb#73 + # source://constant_resolver//lib/constant_resolver.rb#78 def file_map; end # Resolve a constant via its name. @@ -53,38 +55,46 @@ class ConstantResolver # used, e.g. ["Apps", "Models"] for `Apps::Models`. Defaults to [] which means top level. # @return [ConstantResolver::ConstantContext] # - # source://constant_resolver//lib/constant_resolver.rb#58 + # source://constant_resolver//lib/constant_resolver.rb#63 def resolve(const_name, current_namespace_path: T.unsafe(nil)); end private + # @return [Boolean] + # # source://constant_resolver//lib/constant_resolver.rb#131 + def allowed?(path); end + + # source://constant_resolver//lib/constant_resolver.rb#144 def ambiguous_constant_message(const_name, paths); end - # source://constant_resolver//lib/constant_resolver.rb#122 + # source://constant_resolver//lib/constant_resolver.rb#135 def coerce_load_paths(load_paths); end - # source://constant_resolver//lib/constant_resolver.rb#138 + # source://constant_resolver//lib/constant_resolver.rb#151 def glob_path(path); end - # source://constant_resolver//lib/constant_resolver.rb#142 + # source://constant_resolver//lib/constant_resolver.rb#155 def resolve_constant(const_name, current_namespace_path, original_name: T.unsafe(nil)); end - # source://constant_resolver//lib/constant_resolver.rb#155 + # source://constant_resolver//lib/constant_resolver.rb#168 def resolve_traversing_namespace_path(const_name, current_namespace_path); end end -# source://constant_resolver//lib/constant_resolver.rb#17 +# source://constant_resolver//lib/constant_resolver.rb#19 class ConstantResolver::ConstantContext < ::Struct; end -# source://constant_resolver//lib/constant_resolver.rb#19 +# source://constant_resolver//lib/constant_resolver.rb#21 class ConstantResolver::DefaultInflector - # source://constant_resolver//lib/constant_resolver.rb#20 + # source://constant_resolver//lib/constant_resolver.rb#22 def camelize(string); end end -# source://constant_resolver//lib/constant_resolver.rb#16 +# source://constant_resolver//lib/constant_resolver.rb#18 class ConstantResolver::Error < ::StandardError; end +# source://constant_resolver//lib/constant_resolver.rb#16 +ConstantResolver::RUBY_FILES_GLOB = T.let(T.unsafe(nil), String) + # source://constant_resolver//lib/constant_resolver/version.rb#4 ConstantResolver::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/crass@1.0.6.rbi b/sorbet/rbi/gems/crass@1.0.6.rbi index 4d267c0..0979e2f 100644 --- a/sorbet/rbi/gems/crass@1.0.6.rbi +++ b/sorbet/rbi/gems/crass@1.0.6.rbi @@ -4,6 +4,7 @@ # This is an autogenerated file for types exported from the `crass` gem. # Please instead update this file by running `bin/tapioca gem crass`. + # A CSS parser based on the CSS Syntax Module Level 3 spec. # # source://crass//lib/crass/token-scanner.rb#3 diff --git a/sorbet/rbi/gems/date@3.5.1.rbi b/sorbet/rbi/gems/date@3.5.1.rbi new file mode 100644 index 0000000..794e846 --- /dev/null +++ b/sorbet/rbi/gems/date@3.5.1.rbi @@ -0,0 +1,403 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `date` gem. +# Please instead update this file by running `bin/tapioca gem date`. + + +# source://date//lib/date.rb#6 +class Date + include ::Comparable + + # source://date//lib/date.rb#4 + def initialize(*_arg0); end + + # source://date//lib/date.rb#4 + def +(other); end + + # source://date//lib/date.rb#4 + def -(other); end + + # source://date//lib/date.rb#4 + def <<(_arg0); end + + # source://date//lib/date.rb#4 + def <=>(other); end + + # source://date//lib/date.rb#4 + def ===(_arg0); end + + # source://date//lib/date.rb#4 + def >>(_arg0); end + + # source://date//lib/date.rb#4 + def ajd; end + + # source://date//lib/date.rb#4 + def amjd; end + + # source://date//lib/date.rb#4 + def asctime; end + + # source://date//lib/date.rb#4 + def ctime; end + + # source://date//lib/date.rb#4 + def cwday; end + + # source://date//lib/date.rb#4 + def cweek; end + + # source://date//lib/date.rb#4 + def cwyear; end + + # source://date//lib/date.rb#4 + def day; end + + # source://date//lib/date.rb#4 + def day_fraction; end + + # source://date//lib/date.rb#4 + def deconstruct_keys(_arg0); end + + # source://date//lib/date.rb#4 + def downto(_arg0); end + + # source://date//lib/date.rb#4 + def england; end + + # source://date//lib/date.rb#4 + def eql?(_arg0); end + + # source://date//lib/date.rb#4 + def friday?; end + + # source://date//lib/date.rb#4 + def gregorian; end + + # source://date//lib/date.rb#4 + def gregorian?; end + + # source://date//lib/date.rb#4 + def hash; end + + # source://date//lib/date.rb#4 + def httpdate; end + + # call-seq: + # infinite? -> false + # + # Returns +false+ + # + # @return [Boolean] + # + # source://date//lib/date.rb#13 + def infinite?; end + + # source://date//lib/date.rb#4 + def inspect; end + + # source://date//lib/date.rb#4 + def iso8601; end + + # source://date//lib/date.rb#4 + def italy; end + + # source://date//lib/date.rb#4 + def jd; end + + # source://date//lib/date.rb#4 + def jisx0301; end + + # source://date//lib/date.rb#4 + def julian; end + + # source://date//lib/date.rb#4 + def julian?; end + + # source://date//lib/date.rb#4 + def ld; end + + # source://date//lib/date.rb#4 + def leap?; end + + # source://date//lib/date.rb#4 + def marshal_dump; end + + # source://date//lib/date.rb#4 + def marshal_load(_arg0); end + + # source://date//lib/date.rb#4 + def mday; end + + # source://date//lib/date.rb#4 + def mjd; end + + # source://date//lib/date.rb#4 + def mon; end + + # source://date//lib/date.rb#4 + def monday?; end + + # source://date//lib/date.rb#4 + def month; end + + # source://date//lib/date.rb#4 + def new_start(*_arg0); end + + # source://date//lib/date.rb#4 + def next; end + + # source://date//lib/date.rb#4 + def next_day(*_arg0); end + + # source://date//lib/date.rb#4 + def next_month(*_arg0); end + + # source://date//lib/date.rb#4 + def next_year(*_arg0); end + + # source://date//lib/date.rb#4 + def prev_day(*_arg0); end + + # source://date//lib/date.rb#4 + def prev_month(*_arg0); end + + # source://date//lib/date.rb#4 + def prev_year(*_arg0); end + + # source://date//lib/date.rb#4 + def rfc2822; end + + # source://date//lib/date.rb#4 + def rfc3339; end + + # source://date//lib/date.rb#4 + def rfc822; end + + # source://date//lib/date.rb#4 + def saturday?; end + + # source://date//lib/date.rb#4 + def start; end + + # source://date//lib/date.rb#4 + def step(*_arg0); end + + # source://date//lib/date.rb#4 + def strftime(*_arg0); end + + # source://date//lib/date.rb#4 + def succ; end + + # source://date//lib/date.rb#4 + def sunday?; end + + # source://date//lib/date.rb#4 + def thursday?; end + + # source://date//lib/date.rb#4 + def to_date; end + + # source://date//lib/date.rb#4 + def to_datetime; end + + # source://date//lib/date.rb#4 + def to_s; end + + # source://date//lib/date.rb#4 + def to_time(form = T.unsafe(nil)); end + + # source://date//lib/date.rb#4 + def tuesday?; end + + # source://date//lib/date.rb#4 + def upto(_arg0); end + + # source://date//lib/date.rb#4 + def wday; end + + # source://date//lib/date.rb#4 + def wednesday?; end + + # source://date//lib/date.rb#4 + def xmlschema; end + + # source://date//lib/date.rb#4 + def yday; end + + # source://date//lib/date.rb#4 + def year; end + + private + + # source://date//lib/date.rb#4 + def hour; end + + # source://date//lib/date.rb#4 + def initialize_copy(_arg0); end + + # source://date//lib/date.rb#4 + def min; end + + # source://date//lib/date.rb#4 + def minute; end + + # source://date//lib/date.rb#4 + def sec; end + + # source://date//lib/date.rb#4 + def second; end + + class << self + # source://date//lib/date.rb#4 + def _httpdate(*_arg0); end + + # source://date//lib/date.rb#4 + def _iso8601(*_arg0); end + + # source://date//lib/date.rb#4 + def _jisx0301(*_arg0); end + + # source://date//lib/date.rb#4 + def _load(_arg0); end + + # source://date//lib/date.rb#4 + def _parse(*_arg0); end + + # source://date//lib/date.rb#4 + def _rfc2822(*_arg0); end + + # source://date//lib/date.rb#4 + def _rfc3339(*_arg0); end + + # source://date//lib/date.rb#4 + def _rfc822(*_arg0); end + + # source://date//lib/date.rb#4 + def _strptime(*_arg0); end + + # source://date//lib/date.rb#4 + def _xmlschema(*_arg0); end + + # source://date//lib/date.rb#4 + def civil(*_arg0); end + + # source://date//lib/date.rb#4 + def commercial(*_arg0); end + + # source://date//lib/date.rb#4 + def gregorian_leap?(_arg0); end + + # source://date//lib/date.rb#4 + def httpdate(*_arg0); end + + # source://date//lib/date.rb#4 + def iso8601(*_arg0); end + + # source://date//lib/date.rb#4 + def jd(*_arg0); end + + # source://date//lib/date.rb#4 + def jisx0301(*_arg0); end + + # source://date//lib/date.rb#4 + def julian_leap?(_arg0); end + + # source://date//lib/date.rb#4 + def leap?(_arg0); end + + # source://date//lib/date.rb#4 + def ordinal(*_arg0); end + + # source://date//lib/date.rb#4 + def parse(*_arg0); end + + # source://date//lib/date.rb#4 + def rfc2822(*_arg0); end + + # source://date//lib/date.rb#4 + def rfc3339(*_arg0); end + + # source://date//lib/date.rb#4 + def rfc822(*_arg0); end + + # source://date//lib/date.rb#4 + def strptime(*_arg0); end + + # source://date//lib/date.rb#4 + def today(*_arg0); end + + # source://date//lib/date.rb#4 + def valid_civil?(*_arg0); end + + # source://date//lib/date.rb#4 + def valid_commercial?(*_arg0); end + + # source://date//lib/date.rb#4 + def valid_date?(*_arg0); end + + # source://date//lib/date.rb#4 + def valid_jd?(*_arg0); end + + # source://date//lib/date.rb#4 + def valid_ordinal?(*_arg0); end + + # source://date//lib/date.rb#4 + def xmlschema(*_arg0); end + end +end + +# source://date//lib/date.rb#17 +class Date::Infinity < ::Numeric + # @return [Infinity] a new instance of Infinity + # + # source://date//lib/date.rb#19 + def initialize(d = T.unsafe(nil)); end + + # source://date//lib/date.rb#33 + def +@; end + + # source://date//lib/date.rb#32 + def -@; end + + # source://date//lib/date.rb#35 + def <=>(other); end + + # source://date//lib/date.rb#30 + def abs; end + + # source://date//lib/date.rb#51 + def coerce(other); end + + # @return [Boolean] + # + # source://date//lib/date.rb#26 + def finite?; end + + # @return [Boolean] + # + # source://date//lib/date.rb#27 + def infinite?; end + + # @return [Boolean] + # + # source://date//lib/date.rb#28 + def nan?; end + + # source://date//lib/date.rb#59 + def to_f; end + + # @return [Boolean] + # + # source://date//lib/date.rb#25 + def zero?; end + + protected + + # source://date//lib/date.rb#21 + def d; end +end + +# source://date//lib/date.rb#7 +Date::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/diff-lcs@1.5.0.rbi b/sorbet/rbi/gems/diff-lcs@1.5.0.rbi deleted file mode 100644 index 7c80d24..0000000 --- a/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +++ /dev/null @@ -1,8 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `diff-lcs` gem. -# Please instead update this file by running `bin/tapioca gem diff-lcs`. - -# THIS IS AN EMPTY RBI FILE. -# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/drb@2.2.3.rbi b/sorbet/rbi/gems/drb@2.2.3.rbi new file mode 100644 index 0000000..7bd8c98 --- /dev/null +++ b/sorbet/rbi/gems/drb@2.2.3.rbi @@ -0,0 +1,1661 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `drb` gem. +# Please instead update this file by running `bin/tapioca gem drb`. + + +# == Overview +# +# dRuby is a distributed object system for Ruby. It is written in +# pure Ruby and uses its own protocol. No add-in services are needed +# beyond those provided by the Ruby runtime, such as TCP sockets. It +# does not rely on or interoperate with other distributed object +# systems such as CORBA, RMI, or .NET. +# +# dRuby allows methods to be called in one Ruby process upon a Ruby +# object located in another Ruby process, even on another machine. +# References to objects can be passed between processes. Method +# arguments and return values are dumped and loaded in marshalled +# format. All of this is done transparently to both the caller of the +# remote method and the object that it is called upon. +# +# An object in a remote process is locally represented by a +# DRb::DRbObject instance. This acts as a sort of proxy for the +# remote object. Methods called upon this DRbObject instance are +# forwarded to its remote object. This is arranged dynamically at run +# time. There are no statically declared interfaces for remote +# objects, such as CORBA's IDL. +# +# dRuby calls made into a process are handled by a DRb::DRbServer +# instance within that process. This reconstitutes the method call, +# invokes it upon the specified local object, and returns the value to +# the remote caller. Any object can receive calls over dRuby. There +# is no need to implement a special interface, or mixin special +# functionality. Nor, in the general case, does an object need to +# explicitly register itself with a DRbServer in order to receive +# dRuby calls. +# +# One process wishing to make dRuby calls upon another process must +# somehow obtain an initial reference to an object in the remote +# process by some means other than as the return value of a remote +# method call, as there is initially no remote object reference it can +# invoke a method upon. This is done by attaching to the server by +# URI. Each DRbServer binds itself to a URI such as +# 'druby://example.com:8787'. A DRbServer can have an object attached +# to it that acts as the server's *front* *object*. A DRbObject can +# be explicitly created from the server's URI. This DRbObject's +# remote object will be the server's front object. This front object +# can then return references to other Ruby objects in the DRbServer's +# process. +# +# Method calls made over dRuby behave largely the same as normal Ruby +# method calls made within a process. Method calls with blocks are +# supported, as are raising exceptions. In addition to a method's +# standard errors, a dRuby call may also raise one of the +# dRuby-specific errors, all of which are subclasses of DRb::DRbError. +# +# Any type of object can be passed as an argument to a dRuby call or +# returned as its return value. By default, such objects are dumped +# or marshalled at the local end, then loaded or unmarshalled at the +# remote end. The remote end therefore receives a copy of the local +# object, not a distributed reference to it; methods invoked upon this +# copy are executed entirely in the remote process, not passed on to +# the local original. This has semantics similar to pass-by-value. +# +# However, if an object cannot be marshalled, a dRuby reference to it +# is passed or returned instead. This will turn up at the remote end +# as a DRbObject instance. All methods invoked upon this remote proxy +# are forwarded to the local object, as described in the discussion of +# DRbObjects. This has semantics similar to the normal Ruby +# pass-by-reference. +# +# The easiest way to signal that we want an otherwise marshallable +# object to be passed or returned as a DRbObject reference, rather +# than marshalled and sent as a copy, is to include the +# DRb::DRbUndumped mixin module. +# +# dRuby supports calling remote methods with blocks. As blocks (or +# rather the Proc objects that represent them) are not marshallable, +# the block executes in the local, not the remote, context. Each +# value yielded to the block is passed from the remote object to the +# local block, then the value returned by each block invocation is +# passed back to the remote execution context to be collected, before +# the collected values are finally returned to the local context as +# the return value of the method invocation. +# +# == Examples of usage +# +# For more dRuby samples, see the +samples+ directory in the full +# dRuby distribution. +# +# === dRuby in client/server mode +# +# This illustrates setting up a simple client-server drb +# system. Run the server and client code in different terminals, +# starting the server code first. +# +# ==== Server code +# +# require 'drb/drb' +# +# # The URI for the server to connect to +# URI="druby://localhost:8787" +# +# class TimeServer +# +# def get_current_time +# return Time.now +# end +# +# end +# +# # The object that handles requests on the server +# FRONT_OBJECT=TimeServer.new +# +# DRb.start_service(URI, FRONT_OBJECT) +# # Wait for the drb server thread to finish before exiting. +# DRb.thread.join +# +# ==== Client code +# +# require 'drb/drb' +# +# # The URI to connect to +# SERVER_URI="druby://localhost:8787" +# +# # Start a local DRbServer to handle callbacks. +# # +# # Not necessary for this small example, but will be required +# # as soon as we pass a non-marshallable object as an argument +# # to a dRuby call. +# # +# # Note: this must be called at least once per process to take any effect. +# # This is particularly important if your application forks. +# DRb.start_service +# +# timeserver = DRbObject.new_with_uri(SERVER_URI) +# puts timeserver.get_current_time +# +# === Remote objects under dRuby +# +# This example illustrates returning a reference to an object +# from a dRuby call. The Logger instances live in the server +# process. References to them are returned to the client process, +# where methods can be invoked upon them. These methods are +# executed in the server process. +# +# ==== Server code +# +# require 'drb/drb' +# +# URI="druby://localhost:8787" +# +# class Logger +# +# # Make dRuby send Logger instances as dRuby references, +# # not copies. +# include DRb::DRbUndumped +# +# def initialize(n, fname) +# @name = n +# @filename = fname +# end +# +# def log(message) +# File.open(@filename, "a") do |f| +# f.puts("#{Time.now}: #{@name}: #{message}") +# end +# end +# +# end +# +# # We have a central object for creating and retrieving loggers. +# # This retains a local reference to all loggers created. This +# # is so an existing logger can be looked up by name, but also +# # to prevent loggers from being garbage collected. A dRuby +# # reference to an object is not sufficient to prevent it being +# # garbage collected! +# class LoggerFactory +# +# def initialize(bdir) +# @basedir = bdir +# @loggers = {} +# end +# +# def get_logger(name) +# if !@loggers.has_key? name +# # make the filename safe, then declare it to be so +# fname = name.gsub(/[.\/\\\:]/, "_") +# @loggers[name] = Logger.new(name, @basedir + "/" + fname) +# end +# return @loggers[name] +# end +# +# end +# +# FRONT_OBJECT=LoggerFactory.new("/tmp/dlog") +# +# DRb.start_service(URI, FRONT_OBJECT) +# DRb.thread.join +# +# ==== Client code +# +# require 'drb/drb' +# +# SERVER_URI="druby://localhost:8787" +# +# DRb.start_service +# +# log_service=DRbObject.new_with_uri(SERVER_URI) +# +# ["loga", "logb", "logc"].each do |logname| +# +# logger=log_service.get_logger(logname) +# +# logger.log("Hello, world!") +# logger.log("Goodbye, world!") +# logger.log("=== EOT ===") +# +# end +# +# == Security +# +# As with all network services, security needs to be considered when +# using dRuby. By allowing external access to a Ruby object, you are +# not only allowing outside clients to call the methods you have +# defined for that object, but by default to execute arbitrary Ruby +# code on your server. Consider the following: +# +# # !!! UNSAFE CODE !!! +# ro = DRbObject::new_with_uri("druby://your.server.com:8989") +# class << ro +# undef :instance_eval # force call to be passed to remote object +# end +# ro.instance_eval("`rm -rf *`") +# +# The dangers posed by instance_eval and friends are such that a +# DRbServer should only be used when clients are trusted. +# +# A DRbServer can be configured with an access control list to +# selectively allow or deny access from specified IP addresses. The +# main druby distribution provides the ACL class for this purpose. In +# general, this mechanism should only be used alongside, rather than +# as a replacement for, a good firewall. +# +# == dRuby internals +# +# dRuby is implemented using three main components: a remote method +# call marshaller/unmarshaller; a transport protocol; and an +# ID-to-object mapper. The latter two can be directly, and the first +# indirectly, replaced, in order to provide different behaviour and +# capabilities. +# +# Marshalling and unmarshalling of remote method calls is performed by +# a DRb::DRbMessage instance. This uses the Marshal module to dump +# the method call before sending it over the transport layer, then +# reconstitute it at the other end. There is normally no need to +# replace this component, and no direct way is provided to do so. +# However, it is possible to implement an alternative marshalling +# scheme as part of an implementation of the transport layer. +# +# The transport layer is responsible for opening client and server +# network connections and forwarding dRuby request across them. +# Normally, it uses DRb::DRbMessage internally to manage marshalling +# and unmarshalling. The transport layer is managed by +# DRb::DRbProtocol. Multiple protocols can be installed in +# DRbProtocol at the one time; selection between them is determined by +# the scheme of a dRuby URI. The default transport protocol is +# selected by the scheme 'druby:', and implemented by +# DRb::DRbTCPSocket. This uses plain TCP/IP sockets for +# communication. An alternative protocol, using UNIX domain sockets, +# is implemented by DRb::DRbUNIXSocket in the file drb/unix.rb, and +# selected by the scheme 'drbunix:'. A sample implementation over +# HTTP can be found in the samples accompanying the main dRuby +# distribution. +# +# The ID-to-object mapping component maps dRuby object ids to the +# objects they refer to, and vice versa. The implementation to use +# can be specified as part of a DRb::DRbServer's configuration. The +# default implementation is provided by DRb::DRbIdConv. It uses an +# object's ObjectSpace id as its dRuby id. This means that the dRuby +# reference to that object only remains meaningful for the lifetime of +# the object's process and the lifetime of the object within that +# process. A modified implementation is provided by DRb::TimerIdConv +# in the file drb/timeridconv.rb. This implementation retains a local +# reference to all objects exported over dRuby for a configurable +# period of time (defaulting to ten minutes), to prevent them being +# garbage-collected within this time. Another sample implementation +# is provided in sample/name.rb in the main dRuby distribution. This +# allows objects to specify their own id or "name". A dRuby reference +# can be made persistent across processes by having each process +# register an object using the same dRuby name. +# +# source://drb//lib/drb/eq.rb#2 +module DRb + private + + # Get the configuration of the current server. + # + # If there is no current server, this returns the default configuration. + # See #current_server and DRbServer::make_config. + # + # source://drb//lib/drb/drb.rb#1882 + def config; end + + # Get the 'current' server. + # + # In the context of execution taking place within the main + # thread of a dRuby server (typically, as a result of a remote + # call on the server or one of its objects), the current + # server is that server. Otherwise, the current server is + # the primary server. + # + # If the above rule fails to find a server, a DRbServerNotFound + # error is raised. + # + # @raise [DRbServerNotFound] + # + # source://drb//lib/drb/drb.rb#1839 + def current_server; end + + # Retrieves the server with the given +uri+. + # + # See also regist_server and remove_server. + # + # source://drb//lib/drb/drb.rb#1984 + def fetch_server(uri); end + + # Get the front object of the current server. + # + # This raises a DRbServerNotFound error if there is no current server. + # See #current_server. + # + # source://drb//lib/drb/drb.rb#1893 + def front; end + + # Is +uri+ the URI for the current local server? + # + # @return [Boolean] + # + # source://drb//lib/drb/drb.rb#1872 + def here?(uri); end + + # Set the default ACL to +acl+. + # + # See DRb::DRbServer.default_acl. + # + # source://drb//lib/drb/drb.rb#1938 + def install_acl(acl); end + + # Set the default id conversion object. + # + # This is expected to be an instance such as DRb::DRbIdConv that responds to + # #to_id and #to_obj that can convert objects to and from DRb references. + # + # See DRbServer#default_id_conv. + # + # source://drb//lib/drb/drb.rb#1930 + def install_id_conv(idconv); end + + # source://drb//lib/drb/drb.rb#1944 + def mutex; end + + # The primary local dRuby server. + # + # This is the server created by the #start_service call. + # + # source://drb//lib/drb/drb.rb#1826 + def primary_server; end + + # The primary local dRuby server. + # + # This is the server created by the #start_service call. + # + # source://drb//lib/drb/drb.rb#1826 + def primary_server=(_arg0); end + + # Registers +server+ with DRb. + # + # This is called when a new DRb::DRbServer is created. + # + # If there is no primary server then +server+ becomes the primary server. + # + # Example: + # + # require 'drb' + # + # s = DRb::DRbServer.new # automatically calls regist_server + # DRb.fetch_server s.uri #=> # + # + # source://drb//lib/drb/drb.rb#1962 + def regist_server(server); end + + # Removes +server+ from the list of registered servers. + # + # source://drb//lib/drb/drb.rb#1971 + def remove_server(server); end + + # Start a dRuby server locally. + # + # The new dRuby server will become the primary server, even + # if another server is currently the primary server. + # + # +uri+ is the URI for the server to bind to. If nil, + # the server will bind to random port on the default local host + # name and use the default dRuby protocol. + # + # +front+ is the server's front object. This may be nil. + # + # +config+ is the configuration for the new server. This may + # be nil. + # + # See DRbServer::new. + # + # source://drb//lib/drb/drb.rb#1818 + def start_service(uri = T.unsafe(nil), front = T.unsafe(nil), config = T.unsafe(nil)); end + + # Stop the local dRuby server. + # + # This operates on the primary server. If there is no primary + # server currently running, it is a noop. + # + # source://drb//lib/drb/drb.rb#1851 + def stop_service; end + + # Get the thread of the primary server. + # + # This returns nil if there is no primary server. See #primary_server. + # + # source://drb//lib/drb/drb.rb#1919 + def thread; end + + # Get a reference id for an object using the current server. + # + # This raises a DRbServerNotFound error if there is no current server. + # See #current_server. + # + # source://drb//lib/drb/drb.rb#1910 + def to_id(obj); end + + # Convert a reference into an object using the current server. + # + # This raises a DRbServerNotFound error if there is no current server. + # See #current_server. + # + # source://drb//lib/drb/drb.rb#1902 + def to_obj(ref); end + + # Get the URI defining the local dRuby space. + # + # This is the URI of the current server. See #current_server. + # + # source://drb//lib/drb/drb.rb#1860 + def uri; end + + class << self + # Get the configuration of the current server. + # + # If there is no current server, this returns the default configuration. + # See #current_server and DRbServer::make_config. + # + # source://drb//lib/drb/drb.rb#1887 + def config; end + + # Get the 'current' server. + # + # In the context of execution taking place within the main + # thread of a dRuby server (typically, as a result of a remote + # call on the server or one of its objects), the current + # server is that server. Otherwise, the current server is + # the primary server. + # + # If the above rule fails to find a server, a DRbServerNotFound + # error is raised. + # + # @raise [DRbServerNotFound] + # + # source://drb//lib/drb/drb.rb#1845 + def current_server; end + + # Retrieves the server with the given +uri+. + # + # See also regist_server and remove_server. + # + # source://drb//lib/drb/drb.rb#1987 + def fetch_server(uri); end + + # Get the front object of the current server. + # + # This raises a DRbServerNotFound error if there is no current server. + # See #current_server. + # + # source://drb//lib/drb/drb.rb#1896 + def front; end + + # Is +uri+ the URI for the current local server? + # + # @return [Boolean] + # + # source://drb//lib/drb/drb.rb#1876 + def here?(uri); end + + # Set the default ACL to +acl+. + # + # See DRb::DRbServer.default_acl. + # + # source://drb//lib/drb/drb.rb#1941 + def install_acl(acl); end + + # Set the default id conversion object. + # + # This is expected to be an instance such as DRb::DRbIdConv that responds to + # #to_id and #to_obj that can convert objects to and from DRb references. + # + # See DRbServer#default_id_conv. + # + # source://drb//lib/drb/drb.rb#1933 + def install_id_conv(idconv); end + + # source://drb//lib/drb/drb.rb#1947 + def mutex; end + + # The primary local dRuby server. + # + # This is the server created by the #start_service call. + # + # source://drb//lib/drb/drb.rb#1827 + def primary_server; end + + # The primary local dRuby server. + # + # This is the server created by the #start_service call. + # + # source://drb//lib/drb/drb.rb#1827 + def primary_server=(_arg0); end + + # Registers +server+ with DRb. + # + # This is called when a new DRb::DRbServer is created. + # + # If there is no primary server then +server+ becomes the primary server. + # + # Example: + # + # require 'drb' + # + # s = DRb::DRbServer.new # automatically calls regist_server + # DRb.fetch_server s.uri #=> # + # + # source://drb//lib/drb/drb.rb#1968 + def regist_server(server); end + + # Removes +server+ from the list of registered servers. + # + # source://drb//lib/drb/drb.rb#1979 + def remove_server(server); end + + # Start a dRuby server locally. + # + # The new dRuby server will become the primary server, even + # if another server is currently the primary server. + # + # +uri+ is the URI for the server to bind to. If nil, + # the server will bind to random port on the default local host + # name and use the default dRuby protocol. + # + # +front+ is the server's front object. This may be nil. + # + # +config+ is the configuration for the new server. This may + # be nil. + # + # See DRbServer::new. + # + # source://drb//lib/drb/drb.rb#1821 + def start_service(uri = T.unsafe(nil), front = T.unsafe(nil), config = T.unsafe(nil)); end + + # Stop the local dRuby server. + # + # This operates on the primary server. If there is no primary + # server currently running, it is a noop. + # + # source://drb//lib/drb/drb.rb#1855 + def stop_service; end + + # Get the thread of the primary server. + # + # This returns nil if there is no primary server. See #primary_server. + # + # source://drb//lib/drb/drb.rb#1922 + def thread; end + + # Get a reference id for an object using the current server. + # + # This raises a DRbServerNotFound error if there is no current server. + # See #current_server. + # + # source://drb//lib/drb/drb.rb#1913 + def to_id(obj); end + + # Convert a reference into an object using the current server. + # + # This raises a DRbServerNotFound error if there is no current server. + # See #current_server. + # + # source://drb//lib/drb/drb.rb#1914 + def to_obj(ref); end + + # Get the URI defining the local dRuby space. + # + # This is the URI of the current server. See #current_server. + # + # source://drb//lib/drb/drb.rb#1869 + def uri; end + end +end + +# +# This is an internal singleton instance. This must not be used +# by users. +# +# source://drb//lib/drb/drb.rb#382 +DRb::DRB_OBJECT_SPACE = T.let(T.unsafe(nil), DRb::DRbObjectSpace) + +# An Array wrapper that can be sent to another server via DRb. +# +# All entries in the array will be dumped or be references that point to +# the local server. +# +# source://drb//lib/drb/drb.rb#546 +class DRb::DRbArray + # Creates a new DRbArray that either dumps or wraps all the items in the + # Array +ary+ so they can be loaded by a remote DRb server. + # + # @return [DRbArray] a new instance of DRbArray + # + # source://drb//lib/drb/drb.rb#551 + def initialize(ary); end + + # source://drb//lib/drb/drb.rb#570 + def _dump(lv); end + + class << self + # source://drb//lib/drb/drb.rb#566 + def _load(s); end + end +end + +# Class handling the connection between a DRbObject and the +# server the real object lives on. +# +# This class maintains a pool of connections, to reduce the +# overhead of starting and closing down connections for each +# method call. +# +# This class is used internally by DRbObject. The user does +# not normally need to deal with it directly. +# +# source://drb//lib/drb/drb.rb#1284 +class DRb::DRbConn + # @return [DRbConn] a new instance of DRbConn + # + # source://drb//lib/drb/drb.rb#1345 + def initialize(remote_uri); end + + # @return [Boolean] + # + # source://drb//lib/drb/drb.rb#1361 + def alive?; end + + # source://drb//lib/drb/drb.rb#1356 + def close; end + + # source://drb//lib/drb/drb.rb#1351 + def send_message(ref, msg_id, arg, block); end + + # source://drb//lib/drb/drb.rb#1349 + def uri; end + + class << self + # source://drb//lib/drb/drb.rb#1287 + def make_pool; end + + # source://drb//lib/drb/drb.rb#1325 + def open(remote_uri); end + + # source://drb//lib/drb/drb.rb#1320 + def stop_pool; end + end +end + +# Class responsible for converting between an object and its id. +# +# This, the default implementation, uses an object's local ObjectSpace +# __id__ as its id. This means that an object's identification over +# drb remains valid only while that object instance remains alive +# within the server runtime. +# +# For alternative mechanisms, see DRb::TimerIdConv in drb/timeridconv.rb +# and DRbNameIdConv in sample/name.rb in the full drb distribution. +# +# source://drb//lib/drb/drb.rb#393 +class DRb::DRbIdConv + # Convert an object into a reference id. + # + # This implementation returns the object's __id__ in the local + # object space. + # + # source://drb//lib/drb/drb.rb#407 + def to_id(obj); end + + # Convert an object reference id to an object. + # + # This implementation looks up the reference id in the local object + # space and returns the object it refers to. + # + # source://drb//lib/drb/drb.rb#399 + def to_obj(ref); end +end + +# Handler for sending and receiving drb messages. +# +# This takes care of the low-level marshalling and unmarshalling +# of drb requests and responses sent over the wire between server +# and client. This relieves the implementor of a new drb +# protocol layer with having to deal with these details. +# +# The user does not have to directly deal with this object in +# normal use. +# +# source://drb//lib/drb/drb.rb#584 +class DRb::DRbMessage + # @return [DRbMessage] a new instance of DRbMessage + # + # source://drb//lib/drb/drb.rb#585 + def initialize(config); end + + # source://drb//lib/drb/drb.rb#590 + def dump(obj, error = T.unsafe(nil)); end + + # @raise [DRbConnError] + # + # source://drb//lib/drb/drb.rb#607 + def load(soc); end + + # source://drb//lib/drb/drb.rb#667 + def recv_reply(stream); end + + # @raise [DRbConnError] + # + # source://drb//lib/drb/drb.rb#647 + def recv_request(stream); end + + # source://drb//lib/drb/drb.rb#661 + def send_reply(stream, succ, result); end + + # source://drb//lib/drb/drb.rb#633 + def send_request(stream, ref, msg_id, arg, b); end + + private + + # source://drb//lib/drb/drb.rb#674 + def make_proxy(obj, error = T.unsafe(nil)); end +end + +# source://drb//lib/drb/eq.rb#3 +class DRb::DRbObject + # Create a new remote object stub. + # + # +obj+ is the (local) object we want to create a stub for. Normally + # this is +nil+. +uri+ is the URI of the remote object that this + # will be a stub for. + # + # @return [DRbObject] a new instance of DRbObject + # + # source://drb//lib/drb/drb.rb#1117 + def initialize(obj, uri = T.unsafe(nil)); end + + # source://drb//lib/drb/eq.rb#4 + def ==(other); end + + # Get the reference of the object, if local. + # + # source://drb//lib/drb/drb.rb#1143 + def __drbref; end + + # Get the URI of the remote object. + # + # source://drb//lib/drb/drb.rb#1138 + def __drburi; end + + # Marshall this object. + # + # The URI and ref of the object are marshalled. + # + # source://drb//lib/drb/drb.rb#1108 + def _dump(lv); end + + # source://drb//lib/drb/eq.rb#13 + def eql?(other); end + + # source://drb//lib/drb/eq.rb#9 + def hash; end + + # source://drb//lib/drb/drb.rb#1163 + def method_missing(msg_id, *a, **_arg2, &b); end + + # source://drb//lib/drb/drb.rb#1215 + def pretty_print(q); end + + # source://drb//lib/drb/drb.rb#1219 + def pretty_print_cycle(q); end + + # Routes respond_to? to the referenced remote object. + # + # @return [Boolean] + # + # source://drb//lib/drb/drb.rb#1151 + def respond_to?(msg_id, priv = T.unsafe(nil)); end + + class << self + # Unmarshall a marshalled DRbObject. + # + # If the referenced object is located within the local server, then + # the object itself is returned. Otherwise, a new DRbObject is + # created to act as a stub for the remote referenced object. + # + # source://drb//lib/drb/drb.rb#1079 + def _load(s); end + + # Creates a DRb::DRbObject given the reference information to the remote + # host +uri+ and object +ref+. + # + # source://drb//lib/drb/drb.rb#1093 + def new_with(uri, ref); end + + # Create a new DRbObject from a URI alone. + # + # source://drb//lib/drb/drb.rb#1101 + def new_with_uri(uri); end + + # Returns a modified backtrace from +result+ with the +uri+ where each call + # in the backtrace came from. + # + # source://drb//lib/drb/drb.rb#1201 + def prepare_backtrace(uri, result); end + + # Given the +uri+ of another host executes the block provided. + # + # source://drb//lib/drb/drb.rb#1188 + def with_friend(uri); end + end +end + +# source://drb//lib/drb/drb.rb#351 +class DRb::DRbObjectSpace + include ::MonitorMixin + + # @return [DRbObjectSpace] a new instance of DRbObjectSpace + # + # source://drb//lib/drb/drb.rb#357 + def initialize; end + + # source://drb//lib/drb/drb.rb#362 + def to_id(obj); end + + # source://drb//lib/drb/drb.rb#369 + def to_obj(ref); end +end + +# Module managing the underlying network protocol(s) used by drb. +# +# By default, drb uses the DRbTCPSocket protocol. Other protocols +# can be defined. A protocol must define the following class methods: +# +# [open(uri, config)] Open a client connection to the server at +uri+, +# using configuration +config+. Return a protocol +# instance for this connection. +# [open_server(uri, config)] Open a server listening at +uri+, +# using configuration +config+. Return a +# protocol instance for this listener. +# [uri_option(uri, config)] Take a URI, possibly containing an option +# component (e.g. a trailing '?param=val'), +# and return a [uri, option] tuple. +# +# All of these methods should raise a DRbBadScheme error if the URI +# does not identify the protocol they support (e.g. "druby:" for +# the standard Ruby protocol). This is how the DRbProtocol module, +# given a URI, determines which protocol implementation serves that +# protocol. +# +# The protocol instance returned by #open_server must have the +# following methods: +# +# [accept] Accept a new connection to the server. Returns a protocol +# instance capable of communicating with the client. +# [close] Close the server connection. +# [uri] Get the URI for this server. +# +# The protocol instance returned by #open must have the following methods: +# +# [send_request (ref, msg_id, arg, b)] +# Send a request to +ref+ with the given message id and arguments. +# This is most easily implemented by calling DRbMessage.send_request, +# providing a stream that sits on top of the current protocol. +# [recv_reply] +# Receive a reply from the server and return it as a [success-boolean, +# reply-value] pair. This is most easily implemented by calling +# DRb.recv_reply, providing a stream that sits on top of the +# current protocol. +# [alive?] +# Is this connection still alive? +# [close] +# Close this connection. +# +# The protocol instance returned by #open_server().accept() must have +# the following methods: +# +# [recv_request] +# Receive a request from the client and return a [object, message, +# args, block] tuple. This is most easily implemented by calling +# DRbMessage.recv_request, providing a stream that sits on top of +# the current protocol. +# [send_reply(succ, result)] +# Send a reply to the client. This is most easily implemented +# by calling DRbMessage.send_reply, providing a stream that sits +# on top of the current protocol. +# [close] +# Close this connection. +# +# A new protocol is registered with the DRbProtocol module using +# the add_protocol method. +# +# For examples of other protocols, see DRbUNIXSocket in drb/unix.rb, +# and HTTP0 in sample/http0.rb and sample/http0serv.rb in the full +# drb distribution. +# +# source://drb//lib/drb/drb.rb#749 +module DRb::DRbProtocol + private + + # Add a new protocol to the DRbProtocol module. + # + # source://drb//lib/drb/drb.rb#752 + def add_protocol(prot); end + + # source://drb//lib/drb/drb.rb#830 + def auto_load(uri); end + + # Open a client connection to +uri+ with the configuration +config+. + # + # The DRbProtocol module asks each registered protocol in turn to + # try to open the URI. Each protocol signals that it does not handle that + # URI by raising a DRbBadScheme error. If no protocol recognises the + # URI, then a DRbBadURI error is raised. If a protocol accepts the + # URI, but an error occurs in opening it, a DRbConnError is raised. + # + # @raise [DRbBadURI] + # + # source://drb//lib/drb/drb.rb#764 + def open(uri, config, first = T.unsafe(nil)); end + + # Open a server listening for connections at +uri+ with + # configuration +config+. + # + # The DRbProtocol module asks each registered protocol in turn to + # try to open a server at the URI. Each protocol signals that it does + # not handle that URI by raising a DRbBadScheme error. If no protocol + # recognises the URI, then a DRbBadURI error is raised. If a protocol + # accepts the URI, but an error occurs in opening it, the underlying + # error is passed on to the caller. + # + # @raise [DRbBadURI] + # + # source://drb//lib/drb/drb.rb#792 + def open_server(uri, config, first = T.unsafe(nil)); end + + # Parse +uri+ into a [uri, option] pair. + # + # The DRbProtocol module asks each registered protocol in turn to + # try to parse the URI. Each protocol signals that it does not handle that + # URI by raising a DRbBadScheme error. If no protocol recognises the + # URI, then a DRbBadURI error is raised. + # + # @raise [DRbBadURI] + # + # source://drb//lib/drb/drb.rb#813 + def uri_option(uri, config, first = T.unsafe(nil)); end + + class << self + # Add a new protocol to the DRbProtocol module. + # + # source://drb//lib/drb/drb.rb#755 + def add_protocol(prot); end + + # source://drb//lib/drb/drb.rb#835 + def auto_load(uri); end + + # Open a client connection to +uri+ with the configuration +config+. + # + # The DRbProtocol module asks each registered protocol in turn to + # try to open the URI. Each protocol signals that it does not handle that + # URI by raising a DRbBadScheme error. If no protocol recognises the + # URI, then a DRbBadURI error is raised. If a protocol accepts the + # URI, but an error occurs in opening it, a DRbConnError is raised. + # + # @raise [DRbBadURI] + # + # source://drb//lib/drb/drb.rb#781 + def open(uri, config, first = T.unsafe(nil)); end + + # Open a server listening for connections at +uri+ with + # configuration +config+. + # + # The DRbProtocol module asks each registered protocol in turn to + # try to open a server at the URI. Each protocol signals that it does + # not handle that URI by raising a DRbBadScheme error. If no protocol + # recognises the URI, then a DRbBadURI error is raised. If a protocol + # accepts the URI, but an error occurs in opening it, the underlying + # error is passed on to the caller. + # + # @raise [DRbBadURI] + # + # source://drb//lib/drb/drb.rb#805 + def open_server(uri, config, first = T.unsafe(nil)); end + + # Parse +uri+ into a [uri, option] pair. + # + # The DRbProtocol module asks each registered protocol in turn to + # try to parse the URI. Each protocol signals that it does not handle that + # URI by raising a DRbBadScheme error. If no protocol recognises the + # URI, then a DRbBadURI error is raised. + # + # @raise [DRbBadURI] + # + # source://drb//lib/drb/drb.rb#828 + def uri_option(uri, config, first = T.unsafe(nil)); end + end +end + +# An exception wrapping an error object +# +# source://drb//lib/drb/drb.rb#459 +class DRb::DRbRemoteError < ::DRb::DRbError + # Creates a new remote error that wraps the Exception +error+ + # + # @return [DRbRemoteError] a new instance of DRbRemoteError + # + # source://drb//lib/drb/drb.rb#462 + def initialize(error); end + + # the class of the error, as a string. + # + # source://drb//lib/drb/drb.rb#469 + def reason; end +end + +# Class representing a drb server instance. +# +# A DRbServer must be running in the local process before any incoming +# dRuby calls can be accepted, or any local objects can be passed as +# dRuby references to remote processes, even if those local objects are +# never actually called remotely. You do not need to start a DRbServer +# in the local process if you are only making outgoing dRuby calls +# passing marshalled parameters. +# +# Unless multiple servers are being used, the local DRbServer is normally +# started by calling DRb.start_service. +# +# source://drb//lib/drb/drb.rb#1378 +class DRb::DRbServer + # Create a new DRbServer instance. + # + # +uri+ is the URI to bind to. This is normally of the form + # 'druby://:' where is a hostname of + # the local machine. If nil, then the system's default hostname + # will be bound to, on a port selected by the system; these value + # can be retrieved from the +uri+ attribute. 'druby:' specifies + # the default dRuby transport protocol: another protocol, such + # as 'drbunix:', can be specified instead. + # + # +front+ is the front object for the server, that is, the object + # to which remote method calls on the server will be passed. If + # nil, then the server will not accept remote method calls. + # + # If +config_or_acl+ is a hash, it is the configuration to + # use for this server. The following options are recognised: + # + # :idconv :: an id-to-object conversion object. This defaults + # to an instance of the class DRb::DRbIdConv. + # :verbose :: if true, all unsuccessful remote calls on objects + # in the server will be logged to $stdout. false + # by default. + # :tcp_acl :: the access control list for this server. See + # the ACL class from the main dRuby distribution. + # :load_limit :: the maximum message size in bytes accepted by + # the server. Defaults to 25 MB (26214400). + # :argc_limit :: the maximum number of arguments to a remote + # method accepted by the server. Defaults to + # 256. + # The default values of these options can be modified on + # a class-wide basis by the class methods #default_argc_limit, + # #default_load_limit, #default_acl, #default_id_conv, + # and #verbose= + # + # If +config_or_acl+ is not a hash, but is not nil, it is + # assumed to be the access control list for this server. + # See the :tcp_acl option for more details. + # + # If no other server is currently set as the primary server, + # this will become the primary server. + # + # The server will immediately start running in its own thread. + # + # @return [DRbServer] a new instance of DRbServer + # + # source://drb//lib/drb/drb.rb#1479 + def initialize(uri = T.unsafe(nil), front = T.unsafe(nil), config_or_acl = T.unsafe(nil)); end + + # Is this server alive? + # + # @return [Boolean] + # + # source://drb//lib/drb/drb.rb#1534 + def alive?; end + + # Check that a method is callable via dRuby. + # + # +obj+ is the object we want to invoke the method on. +msg_id+ is the + # method name, as a Symbol. + # + # If the method is an insecure method (see #insecure_method?) a + # SecurityError is thrown. If the method is private or undefined, + # a NameError is thrown. + # + # @raise [ArgumentError] + # + # source://drb//lib/drb/drb.rb#1622 + def check_insecure_method(obj, msg_id); end + + # The configuration of this DRbServer + # + # source://drb//lib/drb/drb.rb#1521 + def config; end + + # The front object of the DRbServer. + # + # This object receives remote method calls made on the server's + # URI alone, with an object id. + # + # source://drb//lib/drb/drb.rb#1518 + def front; end + + # Is +uri+ the URI for this server? + # + # @return [Boolean] + # + # source://drb//lib/drb/drb.rb#1539 + def here?(uri); end + + # Stop this server. + # + # source://drb//lib/drb/drb.rb#1544 + def stop_service; end + + # The main thread of this DRbServer. + # + # This is the thread that listens for and accepts connections + # from clients, not that handles each client's request-response + # session. + # + # source://drb//lib/drb/drb.rb#1512 + def thread; end + + # Convert a local object to a dRuby reference. + # + # source://drb//lib/drb/drb.rb#1561 + def to_id(obj); end + + # Convert a dRuby reference to the local object it refers to. + # + # source://drb//lib/drb/drb.rb#1554 + def to_obj(ref); end + + # The URI of this DRbServer. + # + # source://drb//lib/drb/drb.rb#1505 + def uri; end + + # Get whether the server is in verbose mode. + # + # In verbose mode, failed calls are logged to stdout. + # + # source://drb//lib/drb/drb.rb#1531 + def verbose; end + + # Set whether to operate in verbose mode. + # + # In verbose mode, failed calls are logged to stdout. + # + # source://drb//lib/drb/drb.rb#1526 + def verbose=(v); end + + private + + # Coerce an object to a string, providing our own representation if + # to_s is not defined for the object. + # + # source://drb//lib/drb/drb.rb#1608 + def any_to_s(obj); end + + # source://drb//lib/drb/drb.rb#1746 + def error_print(exception); end + + # Has a method been included in the list of insecure methods? + # + # @return [Boolean] + # + # source://drb//lib/drb/drb.rb#1602 + def insecure_method?(msg_id); end + + # The main loop performed by a DRbServer's internal thread. + # + # Accepts a connection from a client, and starts up its own + # thread to handle it. This thread loops, receiving requests + # from the client, invoking them on a local object, and + # returning responses, until the client closes the connection + # or a local method call fails. + # + # source://drb//lib/drb/drb.rb#1764 + def main_loop; end + + # Starts the DRb main loop in a new thread. + # + # source://drb//lib/drb/drb.rb#1583 + def run; end + + # source://drb//lib/drb/drb.rb#1568 + def shutdown; end + + class << self + # Set the default access control list to +acl+. The default ACL is +nil+. + # + # See also DRb::ACL and #new() + # + # source://drb//lib/drb/drb.rb#1403 + def default_acl(acl); end + + # Set the default value for the :argc_limit option. + # + # See #new(). The initial default value is 256. + # + # source://drb//lib/drb/drb.rb#1389 + def default_argc_limit(argc); end + + # Set the default value for the :id_conv option. + # + # See #new(). The initial default value is a DRbIdConv instance. + # + # source://drb//lib/drb/drb.rb#1410 + def default_id_conv(idconv); end + + # Set the default value for the :load_limit option. + # + # See #new(). The initial default value is 25 MB. + # + # source://drb//lib/drb/drb.rb#1396 + def default_load_limit(sz); end + + # source://drb//lib/drb/drb.rb#1426 + def make_config(hash = T.unsafe(nil)); end + + # Get the default value of the :verbose option. + # + # source://drb//lib/drb/drb.rb#1422 + def verbose; end + + # Set the default value of the :verbose option. + # + # See #new(). The initial default value is false. + # + # source://drb//lib/drb/drb.rb#1417 + def verbose=(on); end + end +end + +# source://drb//lib/drb/drb.rb#1652 +class DRb::DRbServer::InvokeMethod + # @return [InvokeMethod] a new instance of InvokeMethod + # + # source://drb//lib/drb/drb.rb#1653 + def initialize(drb_server, client); end + + # source://drb//lib/drb/drb.rb#1658 + def perform; end + + private + + # source://drb//lib/drb/drb.rb#1704 + def block_yield(x); end + + # source://drb//lib/drb/drb.rb#1695 + def check_insecure_method; end + + # source://drb//lib/drb/drb.rb#1687 + def init_with_client; end + + # source://drb//lib/drb/drb.rb#1711 + def perform_with_block; end + + # source://drb//lib/drb/drb.rb#1731 + def perform_without_block; end + + # source://drb//lib/drb/drb.rb#1699 + def setup_message; end +end + +# The default drb protocol which communicates over a TCP socket. +# +# The DRb TCP protocol URI looks like: +# druby://:?. The option is optional. +# +# source://drb//lib/drb/drb.rb#843 +class DRb::DRbTCPSocket + # Create a new DRbTCPSocket instance. + # + # +uri+ is the URI we are connected to. + # +soc+ is the tcp socket we are bound to. +config+ is our + # configuration. + # + # @return [DRbTCPSocket] a new instance of DRbTCPSocket + # + # source://drb//lib/drb/drb.rb#931 + def initialize(uri, soc, config = T.unsafe(nil)); end + + # On the server side, for an instance returned by #open_server, + # accept a client connection and return a new instance to handle + # the server's side of this client-server session. + # + # source://drb//lib/drb/drb.rb#999 + def accept; end + + # Check to see if this connection is alive. + # + # @return [Boolean] + # + # source://drb//lib/drb/drb.rb#1029 + def alive?; end + + # Close the connection. + # + # If this is an instance returned by #open_server, then this stops + # listening for new connections altogether. If this is an instance + # returned by #open or by #accept, then it closes this particular + # client-server session. + # + # source://drb//lib/drb/drb.rb#981 + def close; end + + # Get the address of our TCP peer (the other end of the socket + # we are bound to. + # + # source://drb//lib/drb/drb.rb#946 + def peeraddr; end + + # On the client side, receive a reply from the server. + # + # source://drb//lib/drb/drb.rb#969 + def recv_reply; end + + # On the server side, receive a request from the client. + # + # source://drb//lib/drb/drb.rb#959 + def recv_request; end + + # On the server side, send a reply to the client. + # + # source://drb//lib/drb/drb.rb#964 + def send_reply(succ, result); end + + # On the client side, send a request to the server. + # + # source://drb//lib/drb/drb.rb#954 + def send_request(ref, msg_id, arg, b); end + + # source://drb//lib/drb/drb.rb#1038 + def set_sockopt(soc); end + + # Graceful shutdown + # + # source://drb//lib/drb/drb.rb#1024 + def shutdown; end + + # Get the socket. + # + # source://drb//lib/drb/drb.rb#951 + def stream; end + + # Get the URI that we are connected to. + # + # source://drb//lib/drb/drb.rb#942 + def uri; end + + private + + # source://drb//lib/drb/drb.rb#1014 + def accept_or_shutdown; end + + # source://drb//lib/drb/drb.rb#990 + def close_shutdown_pipe; end + + class << self + # Returns the hostname of this server + # + # source://drb//lib/drb/drb.rb#873 + def getservername; end + + # Open a client connection to +uri+ (DRb URI string) using configuration + # +config+. + # + # This can raise DRb::DRbBadScheme or DRb::DRbBadURI if +uri+ is not for a + # recognized protocol. See DRb::DRbServer.new for information on built-in + # URI protocols. + # + # source://drb//lib/drb/drb.rb#866 + def open(uri, config); end + + # Open a server listening for connections at +uri+ using + # configuration +config+. + # + # source://drb//lib/drb/drb.rb#904 + def open_server(uri, config); end + + # For the families available for +host+, returns a TCPServer on +port+. + # If +port+ is 0 the first available port is used. IPv4 servers are + # preferred over IPv6 servers. + # + # source://drb//lib/drb/drb.rb#889 + def open_server_inaddr_any(host, port); end + + # source://drb//lib/drb/drb.rb#846 + def parse_uri(uri); end + + # Parse +uri+ into a [uri, option] pair. + # + # source://drb//lib/drb/drb.rb#921 + def uri_option(uri, config); end + end +end + +# Implements DRb over a UNIX socket +# +# DRb UNIX socket URIs look like drbunix:?. The +# option is optional. +# +# source://drb//lib/drb/unix.rb#15 +class DRb::DRbUNIXSocket < ::DRb::DRbTCPSocket + # @return [DRbUNIXSocket] a new instance of DRbUNIXSocket + # + # source://drb//lib/drb/unix.rb#62 + def initialize(uri, soc, config = T.unsafe(nil), server_mode = T.unsafe(nil)); end + + # source://drb//lib/drb/unix.rb#105 + def accept; end + + # source://drb//lib/drb/unix.rb#95 + def close; end + + # source://drb//lib/drb/unix.rb#111 + def set_sockopt(soc); end + + class << self + # source://drb//lib/drb/unix.rb#28 + def open(uri, config); end + + # source://drb//lib/drb/unix.rb#34 + def open_server(uri, config); end + + # :stopdoc: + # + # source://drb//lib/drb/unix.rb#17 + def parse_uri(uri); end + + # source://drb//lib/drb/unix.rb#72 + def temp_server; end + + # source://drb//lib/drb/unix.rb#57 + def uri_option(uri, config); end + end +end + +# import from tempfile.rb +# +# source://drb//lib/drb/unix.rb#70 +DRb::DRbUNIXSocket::Max_try = T.let(T.unsafe(nil), Integer) + +# source://drb//lib/drb/drb.rb#1049 +class DRb::DRbURIOption + # @return [DRbURIOption] a new instance of DRbURIOption + # + # source://drb//lib/drb/drb.rb#1050 + def initialize(option); end + + # source://drb//lib/drb/drb.rb#1056 + def ==(other); end + + # source://drb//lib/drb/drb.rb#1065 + def eql?(other); end + + # source://drb//lib/drb/drb.rb#1061 + def hash; end + + # Returns the value of attribute option. + # + # source://drb//lib/drb/drb.rb#1053 + def option; end + + # source://drb//lib/drb/drb.rb#1054 + def to_s; end +end + +# Mixin module making an object undumpable or unmarshallable. +# +# If an object which includes this module is returned by method +# called over drb, then the object remains in the server space +# and a reference to the object is returned, rather than the +# object being marshalled and moved into the client space. +# +# source://drb//lib/drb/drb.rb#418 +module DRb::DRbUndumped + # @raise [TypeError] + # + # source://drb//lib/drb/drb.rb#419 + def _dump(dummy); end +end + +# Class wrapping a marshalled object whose type is unknown locally. +# +# If an object is returned by a method invoked over drb, but the +# class of the object is unknown in the client namespace, or +# the object is a constant unknown in the client namespace, then +# the still-marshalled object is returned wrapped in a DRbUnknown instance. +# +# If this object is passed as an argument to a method invoked over +# drb, then the wrapped object is passed instead. +# +# The class or constant name of the object can be read from the +# +name+ attribute. The marshalled object is held in the +buf+ +# attribute. +# +# source://drb//lib/drb/drb.rb#485 +class DRb::DRbUnknown + # Create a new DRbUnknown object. + # + # +buf+ is a string containing a marshalled object that could not + # be unmarshalled. +err+ is the error message that was raised + # when the unmarshalling failed. It is used to determine the + # name of the unmarshalled object. + # + # @return [DRbUnknown] a new instance of DRbUnknown + # + # source://drb//lib/drb/drb.rb#493 + def initialize(err, buf); end + + # source://drb//lib/drb/drb.rb#522 + def _dump(lv); end + + # Buffer contained the marshalled, unknown object. + # + # source://drb//lib/drb/drb.rb#512 + def buf; end + + # Create a DRbUnknownError exception containing this object. + # + # source://drb//lib/drb/drb.rb#536 + def exception; end + + # The name of the unknown thing. + # + # Class name for unknown objects; variable name for unknown + # constants. + # + # source://drb//lib/drb/drb.rb#509 + def name; end + + # Attempt to load the wrapped marshalled object again. + # + # If the class of the object is now known locally, the object + # will be unmarshalled and returned. Otherwise, a new + # but identical DRbUnknown object will be returned. + # + # source://drb//lib/drb/drb.rb#531 + def reload; end + + class << self + # source://drb//lib/drb/drb.rb#514 + def _load(s); end + end +end + +# An exception wrapping a DRb::DRbUnknown object +# +# source://drb//lib/drb/drb.rb#438 +class DRb::DRbUnknownError < ::DRb::DRbError + # Create a new DRbUnknownError for the DRb::DRbUnknown object +unknown+ + # + # @return [DRbUnknownError] a new instance of DRbUnknownError + # + # source://drb//lib/drb/drb.rb#441 + def initialize(unknown); end + + # source://drb//lib/drb/drb.rb#453 + def _dump(lv); end + + # Get the wrapped DRb::DRbUnknown object. + # + # source://drb//lib/drb/drb.rb#447 + def unknown; end + + class << self + # source://drb//lib/drb/drb.rb#449 + def _load(s); end + end +end + +# source://drb//lib/drb/drb.rb#1227 +class DRb::ThreadObject + include ::MonitorMixin + + # @return [ThreadObject] a new instance of ThreadObject + # + # source://drb//lib/drb/drb.rb#1230 + def initialize(&blk); end + + # source://drb//lib/drb/drb.rb#1265 + def _execute; end + + # @return [Boolean] + # + # source://drb//lib/drb/drb.rb#1241 + def alive?; end + + # source://drb//lib/drb/drb.rb#1245 + def kill; end + + # source://drb//lib/drb/drb.rb#1250 + def method_missing(msg, *arg, &blk); end +end + +# source://drb//lib/drb/version.rb#2 +DRb::VERSION = T.let(T.unsafe(nil), String) + +# source://drb//lib/drb/drb.rb#1993 +DRbIdConv = DRb::DRbIdConv + +# :stopdoc: +# +# source://drb//lib/drb/drb.rb#1991 +DRbObject = DRb::DRbObject + +# source://drb//lib/drb/drb.rb#1992 +DRbUndumped = DRb::DRbUndumped diff --git a/sorbet/rbi/gems/erb@6.0.2.rbi b/sorbet/rbi/gems/erb@6.0.2.rbi new file mode 100644 index 0000000..fd8779a --- /dev/null +++ b/sorbet/rbi/gems/erb@6.0.2.rbi @@ -0,0 +1,815 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `erb` gem. +# Please instead update this file by running `bin/tapioca gem erb`. + + +# source://erb//lib/erb/version.rb#2 +class ERB + # :markup: markdown + # + # :call-seq: + # ERB.new(template, trim_mode: nil, eoutvar: '_erbout') + # + # Returns a new \ERB object containing the given string +template+. + # + # For details about `template`, its embedded tags, and generated results, see ERB. + # + # **Keyword Argument `trim_mode`** + # + # You can use keyword argument `trim_mode: '%'` + # to enable the [shorthand format][shorthand format] for execution tags. + # + # This value allows [blank line control][blank line control]: + # + # - `'-'`: Omit each blank line ending with `'%>'`. + # + # Other values allow [newline control][newline control]: + # + # - `'>'`: Omit newline for each line ending with `'%>'`. + # - `'<>'`: Omit newline for each line starting with `'<%'` and ending with `'%>'`. + # + # You can also [combine trim modes][combine trim modes]. + # + # **Keyword Argument `eoutvar`** + # + # The string value of keyword argument `eoutvar` specifies the name of the variable + # that method #result uses to construct its result string; + # see #src. + # + # This is useful when you need to run multiple \ERB templates through the same binding + # and/or when you want to control where output ends up. + # + # It's good practice to choose a variable name that begins with an underscore: `'_'`. + # + # [blank line control]: rdoc-ref:ERB@Suppressing+Unwanted+Blank+Lines + # [combine trim modes]: rdoc-ref:ERB@Combining+Trim+Modes + # [newline control]: rdoc-ref:ERB@Suppressing+Unwanted+Newlines + # [shorthand format]: rdoc-ref:ERB@Shorthand+Format+for+Execution+Tags + # + # @return [ERB] a new instance of ERB + # + # source://erb//lib/erb.rb#832 + def initialize(str, trim_mode: T.unsafe(nil), eoutvar: T.unsafe(nil)); end + + # :markup: markdown + # + # :call-seq: + # def_class(super_class = Object, method_name = 'result') -> new_class + # + # Returns a new nameless class whose superclass is `super_class`, + # and which has instance method `method_name`. + # + # Create a template from HTML that has embedded expression tags that use `@arg1` and `@arg2`: + # + # ``` + # html = <