diff --git a/Gemfile b/Gemfile index 62663e4..d4f76ec 100644 --- a/Gemfile +++ b/Gemfile @@ -29,4 +29,6 @@ group :development, :test do # Tools # gem 'overcommit', '~> 0.59' gem 'pry-rails' + gem 'sorbet' + gem 'tapioca', require: false end diff --git a/bin/srb b/bin/srb new file mode 100755 index 0000000..a011f9a --- /dev/null +++ b/bin/srb @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'srb' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + 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.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sorbet", "srb") diff --git a/bin/srb-rbi b/bin/srb-rbi new file mode 100755 index 0000000..268aad3 --- /dev/null +++ b/bin/srb-rbi @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'srb-rbi' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + 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.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sorbet", "srb-rbi") diff --git a/bin/tapioca b/bin/tapioca new file mode 100755 index 0000000..24617c7 --- /dev/null +++ b/bin/tapioca @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'tapioca' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + 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.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("tapioca", "tapioca") diff --git a/extra/hanami_app/Gemfile b/extra/hanami_app/Gemfile new file mode 100644 index 0000000..005c85e --- /dev/null +++ b/extra/hanami_app/Gemfile @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +gem 'rack' +gem 'webrick' + +gem 'hanami-router' + +gem 'tiny_admin', path: '../../' diff --git a/extra/hanami_app/app.rb b/extra/hanami_app/app.rb index 61ae7d7..1e10a96 100644 --- a/extra/hanami_app/app.rb +++ b/extra/hanami_app/app.rb @@ -1,24 +1,8 @@ # frozen_string_literal: true -# --- dependencies ------------------------------------------------------------- -begin - require 'bundler/inline' -rescue LoadError => e - abort "#{e} - Bundler version 1.10 or later is required. Please update your Bundler" -end - -gemfile(true) do - source 'https://rubygems.org' - - gem 'rack' - gem 'webrick' - - gem 'hanami-router' - - gem 'tiny_admin', path: '../../' -end +require 'bundler' +Bundler.require -# --- Hanami application ------------------------------------------------------- require_relative '../tiny_admin_settings' app = Hanami::Router.new do @@ -27,4 +11,4 @@ mount TinyAdmin::Router, at: '/admin' end -Rack::Server.new(app: app, Port: 3000).start +Rack::Server.new(app: app, Port: 3000).start if __FILE__ == $PROGRAM_NAME diff --git a/extra/rails_app/Gemfile b/extra/rails_app/Gemfile new file mode 100644 index 0000000..7a455aa --- /dev/null +++ b/extra/rails_app/Gemfile @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +gem 'rails', '~> 7.0' +gem 'webrick' + +gem 'tiny_admin', path: '../../' diff --git a/extra/rails_app/app.rb b/extra/rails_app/app.rb index 8ee6d2b..90fdd52 100644 --- a/extra/rails_app/app.rb +++ b/extra/rails_app/app.rb @@ -1,26 +1,12 @@ # frozen_string_literal: true -# --- dependencies ------------------------------------------------------------- -begin - require 'bundler/inline' -rescue LoadError => e - abort "#{e} - Bundler version 1.10 or later is required. Please update your Bundler" -end - -gemfile(true) do - source 'https://rubygems.org' - - gem 'rails', '~> 7.0' - gem 'webrick' - - gem 'tiny_admin', path: '../../' -end +require 'bundler' +Bundler.require -# --- Rails application -------------------------------------------------------- require 'action_controller/railtie' require_relative '../tiny_admin_settings' -class App < Rails::Application +class RailsApp < Rails::Application routes.append do root to: proc { [200, {}, ['Root page']] } @@ -30,6 +16,6 @@ class App < Rails::Application config.eager_load = false end -App.initialize! +RailsApp.initialize! -Rack::Server.new(app: App, Port: 3000).start +Rack::Server.new(app: RailsApp, Port: 3000).start if __FILE__ == $PROGRAM_NAME diff --git a/extra/roda_app/Gemfile b/extra/roda_app/Gemfile new file mode 100644 index 0000000..651c01b --- /dev/null +++ b/extra/roda_app/Gemfile @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +gem 'rack' +gem 'rackup' +gem 'webrick' + +gem 'roda' + +gem 'tiny_admin', path: '../../' diff --git a/extra/roda_app/app.rb b/extra/roda_app/app.rb index 004282f..4fc2a32 100644 --- a/extra/roda_app/app.rb +++ b/extra/roda_app/app.rb @@ -1,28 +1,11 @@ # frozen_string_literal: true -# --- dependencies ------------------------------------------------------------- -begin - require 'bundler/inline' -rescue LoadError => e - abort "#{e} - Bundler version 1.10 or later is required. Please update your Bundler" -end - -gemfile(true) do - source 'https://rubygems.org' - - gem 'rack' - gem 'rackup' - gem 'webrick' - - gem 'roda' - - gem 'tiny_admin', path: '../../' -end +require 'bundler' +Bundler.require -# --- Roda application --------------------------------------------------------- require_relative '../tiny_admin_settings' -class App < Roda +class RodaApp < Roda route do |r| r.root do 'Root page' @@ -34,4 +17,4 @@ class App < Roda end end -Rackup::Server.new(app: App, Port: 3000).start +Rackup::Server.new(app: RodaApp, Port: 3000).start if __FILE__ == $PROGRAM_NAME diff --git a/extra/standalone_app/Gemfile b/extra/standalone_app/Gemfile new file mode 100644 index 0000000..1d49483 --- /dev/null +++ b/extra/standalone_app/Gemfile @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +gem 'rack' +gem 'rackup' +gem 'webrick' + +gem 'tiny_admin', path: '../../' diff --git a/extra/standalone_app/app.rb b/extra/standalone_app/app.rb index 1d83ff1..72120ab 100644 --- a/extra/standalone_app/app.rb +++ b/extra/standalone_app/app.rb @@ -1,27 +1,12 @@ # frozen_string_literal: true -# --- dependencies ------------------------------------------------------------- -begin - require 'bundler/inline' -rescue LoadError => e - abort "#{e} - Bundler version 1.10 or later is required. Please update your Bundler" -end - -gemfile(true) do - source 'https://rubygems.org' - - gem 'rack' - gem 'rackup' - gem 'webrick' - - gem 'tiny_admin', path: '../../' -end +require 'bundler' +Bundler.require -# --- Standalone application --------------------------------------------------- require_relative '../tiny_admin_settings' TinyAdmin.configure do |settings| settings.root_path = '/' end -Rackup::Server.new(app: TinyAdmin::Router, Port: 3000).start +Rackup::Server.new(app: TinyAdmin::Router, Port: 3000).start if __FILE__ == $PROGRAM_NAME diff --git a/lib/tiny_admin.rb b/lib/tiny_admin.rb index 9809665..e730de5 100644 --- a/lib/tiny_admin.rb +++ b/lib/tiny_admin.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# typed: true require 'phlex' require 'roda' diff --git a/lib/tiny_admin/support.rb b/lib/tiny_admin/support.rb index a5be97a..cb9d6da 100644 --- a/lib/tiny_admin/support.rb +++ b/lib/tiny_admin/support.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# typed: true module TinyAdmin class Support diff --git a/lib/tiny_admin/utils.rb b/lib/tiny_admin/utils.rb index d4aa948..d9cb0e7 100644 --- a/lib/tiny_admin/utils.rb +++ b/lib/tiny_admin/utils.rb @@ -1,7 +1,10 @@ # frozen_string_literal: true +# typed: true module TinyAdmin module Utils + include Kernel + def params_to_s(params) list = params.each_with_object([]) do |(param, value), result| if value.is_a?(Hash) diff --git a/lib/tiny_admin/version.rb b/lib/tiny_admin/version.rb index 4ed157c..f3bba63 100644 --- a/lib/tiny_admin/version.rb +++ b/lib/tiny_admin/version.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# typed: true module TinyAdmin VERSION = '0.7.0' diff --git a/sorbet/config b/sorbet/config new file mode 100644 index 0000000..019c966 --- /dev/null +++ b/sorbet/config @@ -0,0 +1,9 @@ +--dir +. +--ignore=_misc/ +--ignore=bin/ +--ignore=coverage/ +--ignore=extra/ +--ignore=tmp/ +--ignore=vendor/ +--ignore=spec/ diff --git a/sorbet/rbi/annotations/actionmailer.rbi b/sorbet/rbi/annotations/actionmailer.rbi new file mode 100644 index 0000000..e806f99 --- /dev/null +++ b/sorbet/rbi/annotations/actionmailer.rbi @@ -0,0 +1,10 @@ +# typed: strict + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +class ActionMailer::Base + sig { params(headers: T.untyped, block: T.nilable(T.proc.void)).returns(Mail::Message) } + def mail(headers = nil, &block); end +end diff --git a/sorbet/rbi/annotations/actionpack.rbi b/sorbet/rbi/annotations/actionpack.rbi new file mode 100644 index 0000000..c4f5212 --- /dev/null +++ b/sorbet/rbi/annotations/actionpack.rbi @@ -0,0 +1,428 @@ +# typed: strict + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +class ActionController::API + MODULES = T.let(T.unsafe(nil), T::Array[T.untyped]) +end + +module ActionController::Flash::ClassMethods + sig { params(types: Symbol).void } + def add_flash_types(*types); end +end + +module ActionController::Helpers::ClassMethods + sig { returns(ActionView::Base) } + def helpers; end +end + +class ActionController::Metal < AbstractController::Base + sig { returns(ActionController::Parameters) } + def params; end + + sig { returns(ActionDispatch::Request) } + def request; end + + sig { returns(ActionDispatch::Response) } + def response; end +end + +module ActionController::MimeResponds + sig { params(mimes: T.nilable(Symbol), block: T.nilable(T.proc.params(arg0: ActionController::MimeResponds::Collector).void)).void } + def respond_to(*mimes, &block); end +end + +class ActionController::Parameters + sig { params(other: T.any(String, ActionController::Parameters)).returns(T::Boolean) } + def ==(other); end + + sig { params(key: T.any(String, Symbol), value: T.untyped).void } + def []=(key, value); end + + sig { returns(T.nilable(T::Array[T.any(String, Symbol)])) } + def always_permitted_parameters; end + + sig { params(obj: T.nilable(T::Array[T.any(String, Symbol)])).void } + def always_permitted_parameters=(obj); end + + sig { returns(T.untyped) } + def deep_dup; end + + sig { params(key: T.any(String, Symbol), block: T.untyped).returns(T.untyped) } + def delete(key, &block); end + + sig { params(keys: T.any(String, Symbol)).returns(T.untyped) } + def dig(*keys); end + + sig { params(block: T.untyped).returns(T.untyped) } + def each_pair(&block); end + + # each is an alias of each_pair + sig { params(block: T.untyped).returns(T.untyped) } + def each(&block); end + + sig { params(keys: T.any(String, Symbol)).returns(ActionController::Parameters) } + def except(*keys); end + + sig { params(keys: T.any(String, Symbol)).returns(T.untyped) } + def extract!(*keys); end + + sig { params(key: T.any(String, Symbol), args: T.untyped).returns(T.untyped) } + def fetch(key, *args); end + + sig { returns(String) } + def inspect; end + + sig { params(other_hash: T.untyped).returns(ActionController::Parameters) } + def merge!(other_hash); end + + sig { params(other_hash: T.untyped).returns(ActionController::Parameters) } + def merge(other_hash); end + + sig { returns(T.untyped) } + def parameters; end + + sig { returns(T.self_type) } + def permit!; end + + # You can pass _a lot_ of stuff to permit, so filters is left untyped for now. + sig { params(filters: T.untyped).returns(ActionController::Parameters) } + def permit(*filters); end + + sig { params(new_permitted: T.untyped).void } + def permitted=(new_permitted); end + + sig { returns(T::Boolean) } + def permitted?; end + + sig { params(block: T.untyped).returns(T.untyped) } + def reject!(&block); end + + # delete_if is an alias of reject! + sig { params(block: T.untyped).returns(T.untyped) } + def delete_if(&block); end + + sig { params(block: T.untyped).returns(T.untyped) } + def reject(&block); end + + sig { params(key: T.any(String, Symbol)).returns(T.untyped) } + def [](key); end + + sig { params(key: T.any(String, Symbol, T::Array[T.any(String, Symbol)])).returns(T.untyped) } + def require(key); end + + # required is an alias of require + sig { params(key: T.any(String, Symbol, T::Array[T.any(String, Symbol)])).returns(T.untyped) } + def required(key); end + + sig { params(other_hash: T.untyped).returns(ActionController::Parameters) } + def reverse_merge!(other_hash); end + + # with_defaults! is an alias of reverse_merge! + sig { params(other_hash: T.untyped).returns(ActionController::Parameters) } + def with_defaults!(other_hash); end + + sig { params(other_hash: T.untyped).returns(ActionController::Parameters) } + def reverse_merge(other_hash); end + + # with_defaults is an alias of reverse_merge + sig { params(other_hash: T.untyped).returns(ActionController::Parameters) } + def with_defaults(other_hash); end + + sig { params(block: T.untyped).returns(T.nilable(ActionController::Parameters)) } + def select!(&block); end + + # keep_if is an alias of select! + sig { params(block: T.untyped).returns(T.nilable(ActionController::Parameters)) } + def keep_if(&block); end + + sig { params(block: T.untyped).returns(ActionController::Parameters) } + def select(&block); end + + sig { returns(T.any(Symbol, T::Boolean)) } + def self.action_on_unpermitted_parameters; end + + sig { params(obj: T.any(Symbol, T::Boolean)).void } + def self.action_on_unpermitted_parameters=(obj); end + + sig { returns(T::Array[T.any(String, Symbol)]) } + def self.always_permitted_parameters; end + + sig { params(obj: T::Array[T.any(String, Symbol)]).void } + def self.always_permitted_parameters=(obj); end + + sig { returns(T::Boolean) } + def self.permit_all_parameters; end + + sig { params(obj: T::Boolean).void } + def self.permit_all_parameters=(obj); end + + sig { params(keys: T.any(String, Symbol)).returns(ActionController::Parameters) } + def slice!(*keys); end + + sig { params(keys: T.any(String, Symbol)).returns(ActionController::Parameters) } + def slice(*keys); end + + sig { params(block: T.nilable(Proc)).returns(ActiveSupport::HashWithIndifferentAccess) } + def to_h(&block); end + + sig { returns(T::Hash[T.untyped, T.untyped]) } + def to_hash; end + + # to_param is an alias of to_query + sig { params(args: String).returns(T.nilable(String)) } + def to_param(*args); end + + sig { params(args: String).returns(T.nilable(String)) } + def to_query(*args); end + + sig { returns(ActiveSupport::HashWithIndifferentAccess) } + def to_unsafe_h; end + + # to_unsafe_hash is an alias of to_unsafe_h + sig { returns(ActiveSupport::HashWithIndifferentAccess) } + def to_unsafe_hash; end + + sig { params(block: T.untyped).returns(ActionController::Parameters) } + def transform_keys!(&block); end + + sig { params(block: T.untyped).returns(ActionController::Parameters) } + def transform_keys(&block); end + + sig { returns(ActionController::Parameters) } + def transform_values!; end + + sig { returns(ActionController::Parameters) } + def transform_values; end + + sig { params(keys: T.any(String, Symbol)).returns(T.untyped) } + def values_at(*keys); end +end + +module ActionController::RequestForgeryProtection + sig { returns(T::Boolean) } + def protect_against_forgery?; end + + sig { params(form_options: T::Hash[T.untyped, T.untyped]).returns(String) } + def form_authenticity_token(form_options: {}); end +end + +module ActionController::RequestForgeryProtection::ClassMethods + sig { params(options: T::Hash[T.untyped, T.untyped]).void } + def skip_forgery_protection(options = T.unsafe(nil)); end +end + +module ActionController::StrongParameters + sig { returns(ActionController::Parameters) } + def params; end +end + +module ActionDispatch::Http::Parameters + sig { returns(ActionController::Parameters) } + def parameters; end + + # params is an alias of parameters + sig { returns(ActionController::Parameters) } + def params; end +end + +module ActionDispatch::Integration::Runner + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { params(host: String).returns(String) } + def host!(host); end + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { params(flag: T::Boolean).returns(T::Boolean) } + def https!(flag = true); end +end + +class ActionDispatch::IntegrationTest + # The following methods are accessible on `IntegrationTest` + # through the following delegation chain: + # - `IntegrationTest` includes `IntegrationTest::Behavior` + # - `IntegrationTest::Behavior` includes `Integration::Runner` + # - `Integration::Runner#method_missing` delegates to `Integration::Session` + # + # Then `Integration::Session` either implements the methods + # directly or further delegates to `TestProcess` (included) or + # `TestResponse` / `Request` (via `delegate`). + # + # Cf. https://github.com/Shopify/rbi-central/pull/138 for more context. + # @method_missing: delegated to ActionDispatch::TestProcess + sig { returns(ActionDispatch::Flash::FlashHash) } + def flash; end + + # @method_missing: delegated to ActionDispatch::TestProcess + sig { returns(ActionDispatch::Request::Session) } + def session; end + + # @method_missing: delegated to ActionDispatch::TestResponse + sig { returns(T.nilable(Integer)) } + def status; end + + # @method_missing: delegated to ActionDispatch::TestResponse + sig { returns(T.nilable(String)) } + def status_message; end + + # @method_missing: delegated to ActionDispatch::TestResponse + sig { returns(ActionDispatch::Response::Header) } + def headers; end + + # @method_missing: delegated to ActionDispatch::TestResponse + sig { returns(T.nilable(String)) } + def body; end + + # @method_missing: delegated to ActionDispatch::TestResponse + sig { returns(T.nilable(T::Boolean)) } + def redirect?; end + + # @method_missing: delegated to ActionDispatch::Request + sig { returns(T.nilable(String)) } + def path; end + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(String) } + def host; end + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { params(host: String).returns(String) } + attr_writer :host + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(T.nilable(String)) } + attr_accessor :remote_addr + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(T.nilable(String)) } + attr_accessor :accept + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(Rack::Test::CookieJar) } + def cookies; end + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(T.nilable(ActionController::Base)) } + attr_reader :controller + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(ActionDispatch::TestRequest) } + attr_reader :request + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(ActionDispatch::TestResponse) } + attr_reader :response + + # @method_missing: delegated to ActionDispatch::Integration::Session + sig { returns(Integer) } + attr_accessor :request_count +end + +class ActionDispatch::Request + # Provides access to the request's HTTP headers, for example: + # + # ```ruby + # request.headers["Content-Type"] # => "text/plain" + # ``` + sig { returns(ActionDispatch::Http::Headers) } + def headers; end + + # Returns a `String` with the last requested path including their params. + # + # ```ruby + # # get '/foo' + # request.original_fullpath # => '/foo' + # + # # get '/foo?bar' + # request.original_fullpath # => '/foo?bar' + # ``` + sig { returns(String) } + def original_fullpath; end + + # Returns the `String` full path including params of the last URL requested. + # + # ```ruby + # # get "/articles" + # request.fullpath # => "/articles" + # + # # get "/articles?page=2" + # request.fullpath # => "/articles?page=2" + # ``` + sig { returns(String) } + def fullpath; end + + # Returns the original request URL as a `String`. + # + # ```ruby + # # get "/articles?page=2" + # request.original_url # => "http://www.example.com/articles?page=2" + # ``` + sig { returns(String) } + def original_url; end + + # The `String` MIME type of the request. + # + # ``` + # # get "/articles" + # request.media_type # => "application/x-www-form-urlencoded" + # ``` + sig { returns(String) } + def media_type; end + + # Returns the content length of the request as an integer. + sig { returns(Integer) } + def content_length; end + + # Returns the IP address of client as a `String`. + sig { returns(String) } + def ip; end + + # Returns the IP address of client as a `String`, + # usually set by the RemoteIp middleware. + sig { returns(String) } + def remote_ip; end + + # Returns the unique request id, which is based on either the X-Request-Id header that can + # be generated by a firewall, load balancer, or web server or by the RequestId middleware + # (which sets the action_dispatch.request_id environment variable). + # + # This unique ID is useful for tracing a request from end-to-end as part of logging or debugging. + # This relies on the Rack variable set by the ActionDispatch::RequestId middleware. + sig { returns(T.nilable(String)) } + def request_id; end + + # Returns true if the request has a header matching the given key parameter. + # + # ```ruby + # request.key? :ip_spoofing_check # => true + # ``` + sig { params(key: Symbol).returns(T::Boolean) } + def key?(key); end + + # True if the request came from localhost, 127.0.0.1, or ::1. + sig { returns(T::Boolean) } + def local?; end +end + +module ActionDispatch::Routing::Mapper::Resources + sig { params(name: T.untyped).returns(T.untyped) } + def action_path(name); end + + sig { params(block: T.untyped).returns(T.untyped) } + def collection(&block); end + + sig { params(block: T.untyped).returns(T.untyped) } + def member(&block); end + + sig { returns(T.untyped) } + def shallow; end + + sig { returns(T::Boolean) } + def shallow?; end +end + +class ActionDispatch::Routing::RouteSet + sig { params(block: T.proc.bind(ActionDispatch::Routing::Mapper).void).void } + def draw(&block); end +end diff --git a/sorbet/rbi/annotations/actionview.rbi b/sorbet/rbi/annotations/actionview.rbi new file mode 100644 index 0000000..eb3b6b9 --- /dev/null +++ b/sorbet/rbi/annotations/actionview.rbi @@ -0,0 +1,77 @@ +# typed: strong + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module ActionView + TemplateError = T.type_alias { + Template::Error +} + + class MissingTemplate < ActionView::ActionViewError + sig { returns(String) } + def path; end + end +end + +class ActionView::Helpers::FormBuilder + sig { returns(T.untyped) } + def object; end +end + +module ActionView::Helpers::NumberHelper + sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) } + def number_to_currency(number, options = T.unsafe(nil)); end + + sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) } + def number_to_human(number, options = T.unsafe(nil)); end + + sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) } + def number_to_human_size(number, options = T.unsafe(nil)); end + + sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) } + def number_to_percentage(number, options = T.unsafe(nil)); end + + sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) } + def number_to_phone(number, options = T.unsafe(nil)); end + + sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) } + def number_with_delimiter(number, options = T.unsafe(nil)); end + + sig { params(number: T.untyped, options: T::Hash[T.untyped, T.untyped]).returns(T.nilable(String)) } + def number_with_precision(number, options = T.unsafe(nil)); end +end + +module ActionView::Helpers::SanitizeHelper + mixes_in_class_methods ActionView::Helpers::SanitizeHelper::ClassMethods +end + +module ActionView::Helpers::UrlHelper + extend ActiveSupport::Concern + include ActionView::Helpers::TagHelper + mixes_in_class_methods ActionView::Helpers::UrlHelper::ClassMethods + + sig { params(name: T.nilable(String), options: T.untyped, html_options: T.untyped, block: T.untyped).returns(ActiveSupport::SafeBuffer) } + def link_to(name = nil, options = nil, html_options = nil, &block); end + + sig { params(condition: T.untyped, name: String, options: T.untyped, html_options: T.untyped, block: T.untyped).returns(T.untyped) } + def link_to_if(condition, name, options = {}, html_options = {}, &block); end +end + +module ActionView::Layouts + mixes_in_class_methods ActionView::Layouts::ClassMethods +end + +module ActionView::Rendering + mixes_in_class_methods ActionView::Rendering::ClassMethods +end + +module ActionView::ViewPaths + mixes_in_class_methods ActionView::ViewPaths::ClassMethods +end + +module ActionView::ViewPaths::ClassMethods + sig { params(value: T.any(String, T::Array[String])).void } + def append_view_path(value); end +end diff --git a/sorbet/rbi/annotations/activemodel.rbi b/sorbet/rbi/annotations/activemodel.rbi new file mode 100644 index 0000000..d90bcfe --- /dev/null +++ b/sorbet/rbi/annotations/activemodel.rbi @@ -0,0 +1,91 @@ +# typed: strict + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +class ActiveModel::Errors + Elem = type_member { + { fixed: ActiveModel::Error } +} + + sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) } + def [](attribute); end + + sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(ActiveModel::Error) } + def add(attribute, type = :invalid, **options); end + + sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T::Boolean) } + def added?(attribute, type = :invalid, options = {}); end + + sig { params(options: T.untyped).returns(T::Hash[T.untyped, T.untyped]) } + def as_json(options = nil); end + + sig { returns(T::Array[Symbol]) } + def attribute_names; end + + sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T.nilable(T::Array[String])) } + def delete(attribute, type = nil, **options); end + + sig { returns(T::Hash[Symbol, T::Array[T::Hash[Symbol, T.untyped]]]) } + def details; end + + sig { returns(T::Array[Elem]) } + def errors; end + + sig { params(attribute: T.any(Symbol, String), message: String).returns(String) } + def full_message(attribute, message); end + + sig { returns(T::Array[String]) } + def full_messages; end + + sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) } + def full_messages_for(attribute); end + + sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(String) } + def generate_message(attribute, type = :invalid, options = {}); end + + sig { returns(T::Hash[Symbol, T::Array[ActiveModel::Error]]) } + def group_by_attribute; end + + sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) } + def has_key?(attribute); end + + sig { params(error: ActiveModel::Error, override_options: T.untyped).returns(T::Array[ActiveModel::Error]) } + def import(error, override_options = {}); end + + sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) } + def include?(attribute); end + + sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) } + def key?(attribute); end + + sig { params(other: T.untyped).returns(T::Array[ActiveModel::Error]) } + def merge!(other); end + + sig { returns(T::Hash[Symbol, T::Array[String]]) } + def messages; end + + sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) } + def messages_for(attribute); end + + sig { returns(T::Array[Elem]) } + def objects; end + + sig { params(attribute: T.any(Symbol, String), type: T.untyped).returns(T::Boolean) } + def of_kind?(attribute, type = :invalid); end + + sig { returns(T::Array[String]) } + def to_a; end + + sig { params(full_messages: T.untyped).returns(T::Hash[Symbol, T::Array[String]]) } + def to_hash(full_messages = false); end + + sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T::Array[ActiveModel::Error]) } + def where(attribute, type = nil, **options); end +end + +module ActiveModel::Validations + sig { returns(ActiveModel::Errors) } + def errors; end +end diff --git a/sorbet/rbi/annotations/activerecord.rbi b/sorbet/rbi/annotations/activerecord.rbi new file mode 100644 index 0000000..82e9f9c --- /dev/null +++ b/sorbet/rbi/annotations/activerecord.rbi @@ -0,0 +1,77 @@ +# typed: strict + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +class ActiveRecord::Schema + sig { params(info: T::Hash[T.untyped, T.untyped], blk: T.proc.bind(ActiveRecord::Schema).void).void } + def self.define(info = nil, &blk); end +end + +class ActiveRecord::Migration + # @shim: Methods on migration are delegated to `SchemaStatements` using `method_missing` + include ActiveRecord::ConnectionAdapters::SchemaStatements + + # @shim: Methods on migration are delegated to `DatabaseaStatements` using `method_missing` + include ActiveRecord::ConnectionAdapters::DatabaseStatements +end + +class ActiveRecord::Base + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_initialize(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_find(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_touch(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.before_validation(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_validation(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.before_save(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.around_save(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_save(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.before_create(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.around_create(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_create(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.before_update(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.around_update(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_update(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.before_destroy(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.around_destroy(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_destroy(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_commit(*args, **options, &block); end + + sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void } + def self.after_rollback(*args, **options, &block); end +end diff --git a/sorbet/rbi/annotations/activesupport.rbi b/sorbet/rbi/annotations/activesupport.rbi new file mode 100644 index 0000000..ac7c6e4 --- /dev/null +++ b/sorbet/rbi/annotations/activesupport.rbi @@ -0,0 +1,136 @@ +# typed: strict + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module ActiveSupport::Testing::Declarative + sig { params(name: String, block: T.proc.bind(T.untyped).void).void } + def test(name, &block); end +end + +class ActiveSupport::EnvironmentInquirer + sig { returns(T::Boolean) } + def development?; end + + sig { returns(T::Boolean) } + def production?; end + + sig { returns(T::Boolean) } + def test?; end + + # @method_missing: delegated to String through ActiveSupport::StringInquirer + sig { returns(T::Boolean) } + def staging?; end +end + +module ActiveSupport::Testing::SetupAndTeardown::ClassMethods + sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.untyped).void)).void } + def setup(*args, &block); end + + sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.untyped).void)).void } + def teardown(*args, &block); end +end + +class ActiveSupport::TestCase + sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).void)).void } + def self.setup(*args, &block); end + + sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).void)).void } + def self.teardown(*args, &block); end + + sig { params(name: String, block: T.proc.bind(T.attached_class).void).void } + def self.test(name, &block); end +end + +class ActiveSupport::TimeWithZone + # @shim: Methods on ActiveSupport::TimeWithZone are delegated to `Time` using `method_missing + include ::DateAndTime::Zones + + # @shim: Methods on ActiveSupport::TimeWithZone are delegated to `Time` using `method_missing + include ::DateAndTime::Calculations +end + +class Object + sig { returns(T::Boolean) } + def blank?; end + + sig { returns(T::Boolean) } + def present?; end +end + +class Hash + sig { returns(T::Boolean) } + def extractable_options?; end +end + +class Array + sig { params(position: Integer).returns(T.self_type) } + def from(position); end + + sig { params(position: Integer).returns(T.self_type) } + def to(position); end + + sig { params(elements: T.untyped).returns(T::Array[T.untyped]) } + def including(*elements); end + + sig { params(elements: T.untyped).returns(T.self_type) } + def excluding(*elements); end + + sig { params(elements: T.untyped).returns(T.self_type) } + def without(*elements); end + + sig { returns(T.nilable(Elem)) } + def second; end + + sig { returns(T.nilable(Elem)) } + def third; end + + sig { returns(T.nilable(Elem)) } + def fourth; end + + sig { returns(T.nilable(Elem)) } + def fifth; end + + sig { returns(T.nilable(Elem)) } + def forty_two; end + + sig { returns(T.nilable(Elem)) } + def third_to_last; end + + sig { returns(T.nilable(Elem)) } + def second_to_last; end + + sig { params(options: T::Hash[T.untyped, T.untyped]).returns(String) } + def to_sentence(options = {}); end + + sig { params(format: Symbol).returns(String) } + def to_fs(format = :default); end + + sig { params(format: Symbol).returns(String) } + def to_formatted_s(format = :default); end + + sig { returns(String) } + def to_xml; end + + sig { returns(T::Hash[T.untyped, T.untyped]) } + def extract_options!; end + + sig { type_parameters(:FillType).params(number: Integer, fill_with: T.type_parameter(:FillType), block: T.nilable(T.proc.params(group: T::Array[T.any(Elem, T.type_parameter(:FillType))]).void)).returns(T::Array[T::Array[T.any(Elem, T.type_parameter(:FillType))]]) } + def in_groups(number, fill_with = T.unsafe(nil), &block); end + + sig { type_parameters(:FillType).params(number: Integer, fill_with: T.type_parameter(:FillType), block: T.nilable(T.proc.params(group: T::Array[T.any(Elem, T.type_parameter(:FillType))]).void)).returns(T::Array[T::Array[T.any(Elem, T.type_parameter(:FillType))]]) } + def in_groups_of(number, fill_with = T.unsafe(nil), &block); end + + sig { params(value: T.untyped, block: T.nilable(T.proc.params(element: Elem).returns(T.untyped))).returns(T::Array[T::Array[Elem]]) } + def split(value = nil, &block); end + + sig { params(object: T.untyped).returns(T::Array[T.untyped]) } + def self.wrap(object); end + + sig { returns(T.untyped) } + def extract!; end + + sig { returns(ActiveSupport::ArrayInquirer) } + def inquiry; end +end diff --git a/sorbet/rbi/annotations/globalid.rbi b/sorbet/rbi/annotations/globalid.rbi new file mode 100644 index 0000000..e70d46b --- /dev/null +++ b/sorbet/rbi/annotations/globalid.rbi @@ -0,0 +1,30 @@ +# typed: strict + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +class ActiveRecord::Base + # @shim: this is included at runtime https://github.com/rails/globalid/blob/v1.0.0/lib/global_id/railtie.rb#L38 + include GlobalID::Identification +end + +module GlobalID::Identification + sig { params(options: T::Hash[T.untyped, T.untyped]).returns(GlobalID) } + def to_gid(options = {}); end + + sig { params(options: T::Hash[T.untyped, T.untyped]).returns(String) } + def to_gid_param(options = {}); end + + sig { params(options: T::Hash[T.untyped, T.untyped]).returns(GlobalID) } + def to_global_id(options = {}); end + + sig { params(options: T::Hash[T.untyped, T.untyped]).returns(SignedGlobalID) } + def to_sgid(options = {}); end + + sig { params(options: T::Hash[T.untyped, T.untyped]).returns(String) } + def to_sgid_param(options = {}); end + + sig { params(options: T::Hash[T.untyped, T.untyped]).returns(SignedGlobalID) } + def to_signed_global_id(options = {}); end +end diff --git a/sorbet/rbi/annotations/railties.rbi b/sorbet/rbi/annotations/railties.rbi new file mode 100644 index 0000000..f71f135 --- /dev/null +++ b/sorbet/rbi/annotations/railties.rbi @@ -0,0 +1,58 @@ +# typed: strong + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module Rails + class << self + sig { returns(Rails::Application) } + def application; end + + sig { returns(ActiveSupport::BacktraceCleaner) } + def backtrace_cleaner; end + + sig { returns(ActiveSupport::Cache::Store) } + def cache; end + + sig { returns(ActiveSupport::EnvironmentInquirer) } + def env; end + + sig { returns(ActiveSupport::Logger) } + def logger; end + + sig { returns(Pathname) } + def root; end + + sig { returns(String) } + def version; end + end +end + +class Rails::Application < ::Rails::Engine + class << self + sig { params(block: T.proc.bind(Rails::Application).void).void } + def configure(&block); end + end + + sig { params(block: T.proc.bind(Rails::Application).void).void } + def configure(&block); end + + sig { returns(T.untyped) } + def config; end +end + +class Rails::Engine < ::Rails::Railtie + sig { params(block: T.untyped).returns(ActionDispatch::Routing::RouteSet) } + def routes(&block); end +end + +class Rails::Railtie + sig { params(block: T.proc.bind(Rails::Railtie).void).void } + def configure(&block); end +end + +class Rails::Railtie::Configuration + sig { params(blk: T.proc.bind(ActiveSupport::Reloader).void).void } + def to_prepare(&blk); end +end diff --git a/sorbet/rbi/annotations/rainbow.rbi b/sorbet/rbi/annotations/rainbow.rbi new file mode 100644 index 0000000..60ba90a --- /dev/null +++ b/sorbet/rbi/annotations/rainbow.rbi @@ -0,0 +1,269 @@ +# typed: strict + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module Rainbow + # @shim: https://github.com/sickill/rainbow/blob/master/lib/rainbow.rb#L10-L12 + sig { returns(T::Boolean) } + attr_accessor :enabled + + class Color + sig { returns(Symbol) } + attr_reader :ground + + sig { params(ground: Symbol, values: T.any([Integer], [Integer, Integer, Integer])).returns(Color) } + def self.build(ground, values); end + + sig { params(hex: String).returns([Integer, Integer, Integer]) } + def self.parse_hex_color(hex); end + + class Indexed < Rainbow::Color + sig { returns(Integer) } + attr_reader :num + + sig { params(ground: Symbol, num: Integer).void } + def initialize(ground, num); end + + sig { returns(T::Array[Integer]) } + def codes; end + end + + class Named < Rainbow::Color::Indexed + NAMES = T.let(nil, T::Hash[Symbol, Integer]) + + sig { params(ground: Symbol, name: Symbol).void } + def initialize(ground, name); end + + sig { returns(T::Array[Symbol]) } + def self.color_names; end + + sig { returns(String) } + def self.valid_names; end + end + + class RGB < Rainbow::Color::Indexed + sig { returns(Integer) } + attr_reader :r, :g, :b + + sig { params(ground: Symbol, values: Integer).void } + def initialize(ground, *values); end + + sig { returns(T::Array[Integer]) } + def codes; end + + sig { params(value: Numeric).returns(Integer) } + def self.to_ansi_domain(value); end + end + + class X11Named < Rainbow::Color::RGB + include Rainbow::X11ColorNames + + sig { returns(T::Array[Symbol]) } + def self.color_names; end + + sig { returns(String) } + def self.valid_names; end + + sig { params(ground: Symbol, name: Symbol).void } + def initialize(ground, name); end + end + end + + sig { returns(Wrapper) } + def self.global; end + + sig { returns(T::Boolean) } + def self.enabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def self.enabled=(value); end + + sig { params(string: String).returns(String) } + def self.uncolor(string); end + + class NullPresenter < String + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def color(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def foreground(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def fg(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def background(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def bg(*values); end + + sig { returns(NullPresenter) } + def reset; end + + sig { returns(NullPresenter) } + def bright; end + + sig { returns(NullPresenter) } + def faint; end + + sig { returns(NullPresenter) } + def italic; end + + sig { returns(NullPresenter) } + def underline; end + + sig { returns(NullPresenter) } + def blink; end + + sig { returns(NullPresenter) } + def inverse; end + + sig { returns(NullPresenter) } + def hide; end + + sig { returns(NullPresenter) } + def cross_out; end + + sig { returns(NullPresenter) } + def black; end + + sig { returns(NullPresenter) } + def red; end + + sig { returns(NullPresenter) } + def green; end + + sig { returns(NullPresenter) } + def yellow; end + + sig { returns(NullPresenter) } + def blue; end + + sig { returns(NullPresenter) } + def magenta; end + + sig { returns(NullPresenter) } + def cyan; end + + sig { returns(NullPresenter) } + def white; end + + sig { returns(NullPresenter) } + def bold; end + + sig { returns(NullPresenter) } + def dark; end + + sig { returns(NullPresenter) } + def strike; end + end + + class Presenter < String + TERM_EFFECTS = T.let(nil, T::Hash[Symbol, Integer]) + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def color(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def foreground(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def fg(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def background(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def bg(*values); end + + sig { returns(Presenter) } + def reset; end + + sig { returns(Presenter) } + def bright; end + + sig { returns(Presenter) } + def faint; end + + sig { returns(Presenter) } + def italic; end + + sig { returns(Presenter) } + def underline; end + + sig { returns(Presenter) } + def blink; end + + sig { returns(Presenter) } + def inverse; end + + sig { returns(Presenter) } + def hide; end + + sig { returns(Presenter) } + def cross_out; end + + sig { returns(Presenter) } + def black; end + + sig { returns(Presenter) } + def red; end + + sig { returns(Presenter) } + def green; end + + sig { returns(Presenter) } + def yellow; end + + sig { returns(Presenter) } + def blue; end + + sig { returns(Presenter) } + def magenta; end + + sig { returns(Presenter) } + def cyan; end + + sig { returns(Presenter) } + def white; end + + sig { returns(Presenter) } + def bold; end + + sig { returns(Presenter) } + def dark; end + + sig { returns(Presenter) } + def strike; end + end + + class StringUtils + sig { params(string: String, codes: T::Array[Integer]).returns(String) } + def self.wrap_with_sgr(string, codes); end + + sig { params(string: String).returns(String) } + def self.uncolor(string); end + end + + VERSION = T.let(nil, String) + + class Wrapper + sig { returns(T::Boolean) } + attr_accessor :enabled + + sig { params(enabled: T::Boolean).void } + def initialize(enabled = true); end + + sig { params(string: String).returns(T.any(Rainbow::Presenter, Rainbow::NullPresenter)) } + def wrap(string); end + end + + module X11ColorNames + NAMES = T.let(nil, T::Hash[Symbol, [Integer, Integer, Integer]]) + end +end + +sig { params(string: String).returns(Rainbow::Presenter) } +def Rainbow(string); end diff --git a/sorbet/rbi/gems/actioncable@7.0.4.3.rbi b/sorbet/rbi/gems/actioncable@7.0.4.3.rbi new file mode 100644 index 0000000..bb99ced --- /dev/null +++ b/sorbet/rbi/gems/actioncable@7.0.4.3.rbi @@ -0,0 +1,8 @@ +# 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.3.rbi b/sorbet/rbi/gems/actionmailbox@7.0.4.3.rbi new file mode 100644 index 0000000..2d8eb4f --- /dev/null +++ b/sorbet/rbi/gems/actionmailbox@7.0.4.3.rbi @@ -0,0 +1,8 @@ +# 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.3.rbi b/sorbet/rbi/gems/actionmailer@7.0.4.3.rbi new file mode 100644 index 0000000..2246788 --- /dev/null +++ b/sorbet/rbi/gems/actionmailer@7.0.4.3.rbi @@ -0,0 +1,8 @@ +# 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.3.rbi b/sorbet/rbi/gems/actionpack@7.0.4.3.rbi new file mode 100644 index 0000000..7aff15c --- /dev/null +++ b/sorbet/rbi/gems/actionpack@7.0.4.3.rbi @@ -0,0 +1,19654 @@ +# 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.3/lib/active_support/core_ext/module/attr_internal.rb#33 + def action_name; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/core_ext/module/attr_internal.rb#33 + def formats; end + + # source://activesupport/7.0.4.3/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, **_arg2); end + + # Returns the body of the HTTP response sent by the controller. + # + # source://activesupport/7.0.4.3/lib/active_support/core_ext/module/attr_internal.rb#33 + def response_body; end + + # source://activesupport/7.0.4.3/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, &_arg2); 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, &_arg2); 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, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def bmp(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def css(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def csv(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def gif(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def gzip(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def html(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def ics(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def jpeg(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def js(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def json(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def m4a(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def mp3(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def mp4(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def mpeg(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def multipart_form(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def ogg(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def otf(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def pdf(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def png(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def rss(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def svg(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def text(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def tiff(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def ttf(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def url_encoded_form(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def vcf(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def vtt(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def webm(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def woff(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def woff2(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def xml(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def yaml(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/collector.rb#10 + def zip(*args, **_arg1, &block); end + + private + + # source://actionpack//lib/abstract_controller/collector.rb#26 + def method_missing(symbol, *args, **_arg2, &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/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/exceptions.rb#3 +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.3/lib/active_support/callbacks.rb#68 + def __callbacks; end + + # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 + def __callbacks?; end + + # source://activesupport/7.0.4.3/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.3/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.3/lib/active_support/configurable.rb#113 + def logger; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/rescuable.rb#13 + def rescue_handlers; end + + # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 + def rescue_handlers=(_arg0); end + + # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 + def rescue_handlers?; end + + class << self + # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 + def __callbacks; end + + # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 + def __callbacks=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 + def __callbacks?; end + + # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#932 + def _process_action_callbacks; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/configurable.rb#113 + def logger; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/rescuable.rb#13 + def rescue_handlers; end + + # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 + def rescue_handlers=(value); end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/callbacks.rb#68 + def __callbacks; end + + # source://activesupport/7.0.4.3/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.3/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.3/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.3/lib/active_support/configurable.rb#113 + def allow_forgery_protection; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def allow_forgery_protection=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def asset_host; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def asset_host=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def assets_dir; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def assets_dir=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def default_asset_host_protocol; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def default_asset_host_protocol=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def default_protect_from_forgery; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def default_protect_from_forgery=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def default_static_extension; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/configurable.rb#113 + def enable_fragment_cache_logging; end + + # source://activesupport/7.0.4.3/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, &_arg2); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def forgery_protection_origin_check; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def forgery_protection_origin_check=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def forgery_protection_strategy; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/configurable.rb#113 + def javascripts_dir; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def javascripts_dir=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def log_warning_on_csrf_failure; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def log_warning_on_csrf_failure=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def logger; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/configurable.rb#113 + def per_form_csrf_tokens; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def per_form_csrf_tokens=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def perform_caching; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/configurable.rb#113 + def relative_url_root; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def relative_url_root=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def request_forgery_protection_token; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def request_forgery_protection_token=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 + def rescue_handlers; end + + # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 + def rescue_handlers=(_arg0); end + + # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 + def rescue_handlers?; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def stylesheets_dir; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def stylesheets_dir=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def urlsafe_csrf_tokens; end + + private + + # source://actionview/7.0.4.3/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.3/lib/active_support/callbacks.rb#68 + def __callbacks; end + + # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#68 + def __callbacks=(value); end + + # source://activesupport/7.0.4.3/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.3/lib/action_view/layouts.rb#209 + def _layout; end + + # source://actionview/7.0.4.3/lib/action_view/layouts.rb#209 + def _layout=(value); end + + # source://actionview/7.0.4.3/lib/action_view/layouts.rb#209 + def _layout?; end + + # source://actionview/7.0.4.3/lib/action_view/layouts.rb#210 + def _layout_conditions; end + + # source://actionview/7.0.4.3/lib/action_view/layouts.rb#210 + def _layout_conditions=(value); end + + # source://actionview/7.0.4.3/lib/action_view/layouts.rb#210 + def _layout_conditions?; end + + # source://activesupport/7.0.4.3/lib/active_support/callbacks.rb#932 + def _process_action_callbacks; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/configurable.rb#113 + def allow_forgery_protection; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def allow_forgery_protection=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def asset_host; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def asset_host=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def assets_dir; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def assets_dir=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def default_asset_host_protocol; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def default_asset_host_protocol=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def default_protect_from_forgery; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def default_protect_from_forgery=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def default_static_extension; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/configurable.rb#113 + def enable_fragment_cache_logging; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/configurable.rb#113 + def forgery_protection_origin_check; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def forgery_protection_origin_check=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def forgery_protection_strategy; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/configurable.rb#113 + def javascripts_dir; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def javascripts_dir=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def log_warning_on_csrf_failure; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def log_warning_on_csrf_failure=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def logger; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/configurable.rb#113 + def per_form_csrf_tokens; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def per_form_csrf_tokens=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def perform_caching; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/configurable.rb#113 + def relative_url_root; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def relative_url_root=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def request_forgery_protection_token; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def request_forgery_protection_token=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 + def rescue_handlers; end + + # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 + def rescue_handlers=(value); end + + # source://activesupport/7.0.4.3/lib/active_support/rescuable.rb#13 + def rescue_handlers?; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#113 + def stylesheets_dir; end + + # source://activesupport/7.0.4.3/lib/active_support/configurable.rb#114 + def stylesheets_dir=(value); end + + # source://activesupport/7.0.4.3/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, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/caching/fragments.rb#31 + def combined_fragment_cache_key(*args, **_arg1, &block); end + + # source://actionpack//lib/action_controller/metal/content_security_policy.rb#11 + def content_security_policy?(*args, **_arg1, &block); end + + # source://actionpack//lib/action_controller/metal/content_security_policy.rb#12 + def content_security_policy_nonce(*args, **_arg1, &block); end + + # source://actionpack//lib/action_controller/metal/cookies.rb#8 + def cookies(*args, **_arg1, &block); end + + # source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#106 + def form_authenticity_token(*args, **_arg1, &block); end + + # source://actionpack//lib/action_controller/metal/flash.rb#39 + def notice(*args, **_arg1, &block); end + + # source://actionpack//lib/action_controller/metal/request_forgery_protection.rb#107 + def protect_against_forgery?(*args, **_arg1, &block); end + + # source://actionpack//lib/abstract_controller/caching.rb#43 + def view_cache_dependencies(*args, **_arg1, &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.6.4/lib/rack/response.rb#141 + def error?; end + + # Was the URL not found? + # + # source://rack/2.2.6.4/lib/rack/response.rb#151 + def missing?; end + + # Was the response successful? + # + # source://rack/2.2.6.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, &_arg2); 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, &_arg2); end + + # source://actionpack//lib/action_controller/metal.rb#147 + def location(*_arg0, **_arg1, &_arg2); 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, &_arg2); 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.3/lib/active_support/core_ext/module/attr_internal.rb#33 + def request; end + + # source://activesupport/7.0.4.3/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.3/lib/active_support/core_ext/module/attr_internal.rb#33 + def response; end + + # source://activesupport/7.0.4.3/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, &_arg2); end + + # source://actionpack//lib/action_controller/metal.rb#146 + def session(*_arg0, **_arg1, &_arg2); 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, &_arg2); 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, &_arg2); 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: + # + #