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: - # - #